To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more

Show Remaining Inventory on DAWN theme

3 0 1

Hi there,


I am  trying to show stock availability on my product page when I add stock in the inventory for each variation. is there any code I can add, I seem to cannot find this feature.

Replies 4 (4)
Shopify Partner
505 57 102


Add this code into your product.template.liquid or main-product.liquid where you want to add


<!-- zworthkey-code  -->
{% assign product_qty = 0 %}
{% for variant in product.variants %}
{% if variant.inventory_quantity > 0 %}
{% assign product_qty = product_qty | plus: variant.inventory_quantity %}
{% endif %}
{% endfor %}
{% if product_qty > 0 %}
      <span class="products-available-container ws-widget" style=" height:25px;margin-bottom:30px;"><span class="products-available" style="color: white; margin-top:6px;"><p style="margin-top:6px;"><span> <span style="background-color: rgb(230, 0, 0); color: rgb(255, 255, 255); border-radius: 3px;">&nbsp;HURRY!&nbsp;</span>&nbsp;Selling out fast! Only <strong style="color: rgb(230, 0, 0);"><span class="glowing odometer">{{ product_qty }}</span></strong> left in stock!</span></p>
      {% endif %}



Let me know if you need any more help.

Thank you.

If helpful, please Like and Accept Solution. Hire Us |
if you Want to modify or Customize your theme | Whatsapp | Email us:
,We have Over 200+ Happy merchants.
Build Successful Shopify Stores with GemPages
3 0 1

which line do i add it too? I have product-template.liquid section under Snippets and Sections

3 0 1

@Mr_RaviRaj see my reply

28 0 5

Thanks, Ravi.

Work well on Dawn Theme.