How To Show Inventory Count On The Collection Page

Hi Shopify Community,

I want to show inventory on my product collection page so that customer can see directly the quantity of my product, and they don’t have to click the specific product and enter product page to view stock status.

I use Dawn theme. Is is possible to achieve? Thank you in advance.

Hi @Geedel2022 , go to edit code > snippets > card-product.liquid, add this on line 33:

{% assign firstVariant = card_product.first_available_variant %}

Add this on line 112

{% if template.name == "collection" and firstVariant.inventory_quantity >= 1 %} 

{{firstVariant.inventory_quantity}} product available

 {% endif %}

Thank you for your reply, @MarinaPetrovic . I have added your code into product-card.liquid (can’t find card-product.liquid) as below photos, but nothing changed in my collection page(https://www.geedeldirect.com/collections/all). I supposed that I must miss something. Could you help me with it again? Thank you in advance.

Hi @Geedel2022 , try with this (and add this line below {% endif %}, on 35th line of code)

{% assign firstVariant = product_card.first_available_variant %}

and this (add on 125 line of code. )

{% if template.name == "collection" and firstVariant.inventory_quantity >= 1 %} 

{{firstVariant.inventory_quantity}} product available

 {% endif %}

I have added the code. It still can’t work. Let me know what other information would be helpful in resolving this issue, thank you.