Liquid, JavaScript, themes, sales channels
I am trying to add the quantity of my products so customers are able to see how many products I have in stock on my website.
I cannot find the product template liquid code to paste the quantity code.
Is there a way anyone can help with this issue?
Hello @Rosalynmitchell,
Hope you are doing well.
Find the product.liquid theme file, in that search for the product-template.liquid, hover the pointer over that text and you'll see the pointing arrow, click on that to go to the product template file.
If you don't find the file then please share the full screenshot of the product.liquid file, so that I can check and guide you accordingly.
iCart Cart Drawer Cart Upsell App
do you have a email I can send screenshots too? They don’t upload correctly on here.
Hey @Rosalynmitchell,
Thanks for getting back to me.
Yes, you can send me an email at binal.savani@identixweb.in
iCart Cart Drawer Cart Upsell App
Hi @Rosalynmitchell,
- If your product does not have a variant, you can use code: {{ product.first_available_variant }}
- If your product has multiple variants, you can use the code to display the inventory quantity of each variant: {% for variant in product.variants %} {{ variant.title }} ({{ variant.inventory_quantity }}) {% endfor %}
With variant.inventory_quantity: Return the variant's inventory quantity.
Hope it is clear to you.
If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.
I also don't have product.liquid & product-template.liquid. Is there a reason for that? I have products, collections, size, colour variations for products.
I need to edit the code from product-template.liquid to track add_to_cart button for GA4 but now I can't see that.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024