Shopify themes, liquid, logos, and UX
im trying to use this code:
{% if product.variants.first.inventory_quantity < 5 and product.variants.first.inventory_quantity > 0 %} <p style="color: #000000; text-align:center">ONLY {{ product.variants.first.inventory_quantity }} LEFT</p> {% elsif product.variants.first.inventory_quantity < 1 %} <p style="color: #000000; text-align:center">SOLD OUT</p> {% endif %}
but it only seems to work on the first variant and doesnt work when i change variants (ie XS, S, M etc)
Can anyone help with adjusting the code??
Hello, @Andia
What theme are you using? Can you share your store url?
Hi @Andia ,
You will have to modify JS to make this work. Currently you have added only the DOM elements. To make it dynamic, we will have to add custom JS[Most probably in global.js].
how do i do this?!
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024