Dawn 2.0 - Adding quantity available to product page

New Member
2 0 0

I feel like this really shouldn't be that difficult. Would anybody have the code that I need to copy and paste into the product page template?

Shopify Partner
3120 191 571

Merchants that need to buy this customization can contact me at paull.newton+shopifyforums@gmail.com 

Different approaches :

  • Shopify has a tutorial for a few themes, they will install it as well for some themes:
  • There are also various solutions for implementing 'available inventory' throughout the forums found with search.
    • Though the complication will be updating the available amount when the variant changes.
  • A rough non-updating solution is to make a metafield definition then just add a text block and wire it to that metafield definition as a dynamic source, note this is a number you have to manually update.



Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
New Member
2 0 1

I've tried using the same code I used in the old shoplify themes but its not working and only showing me the "this product is available"

So I am also keen for the solution.


{% comment %} Inventory tracking on product page {% endcomment %}
<div id="variant-inventory" class="{% unless current_variant.available %} hide {% endunless %}">
{% if current_variant.inventory_management == "shopify" and current_variant.inventory_policy != "continue" %}
We have {{ current_variant.inventory_quantity }} in stock.
{% else %}
This product is available.
{% endif %}

New Member
2 0 1

Ok ii found this code and it seems to work for me.


<DIV>{% if product.variants.first.inventory_management == "shopify" and product.variants.first.inventory_quantity > 0 %}
We currently have {{ product.variants.first.inventory_quantity }} in stock.
{% endif %}</DIV>

18 2 13

Thank you! Exactly what I was looking for.