All things Shopify and commerce
Hi there, how can I display stock quantities on my website? Dawn version 14.
Hi,
To display stock quantities on your website, follow these steps:
Edit Theme Code:
Modify Code to Display Stock Quantity:
{% if product.available and product.variants.first.inventory_management %}
{% assign total_inventory = 0 %}
{% for variant in product.variants %}
{% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}
{% endfor %}
<p>In stock: {{ total_inventory }} items</p>
{% else %}
<p>Out of stock</p>
{% endif %}
@sonnisaar hey,
please use this code where you want to show on product page :
{% for variant in product.variants %}
<p> {{ variant.inventory_quantity }} in stock.</p>
{% endfor %}
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025