Showing your stock levels on product pages can help create urgency and improve customer trust. Whilst it might seem complicated, adding inventory counts to your Shopify store is straightforward with a few simple code adjustments.
How to display stock count on product page
To begin, head to your Shopify admin panel and navigate to the Online Store section, then click on Themes.
Once there, locate your current theme and click the three dots menu button, followed by selecting ‘Edit code’.
In the code editor, you’ll need to find the Sections directory. Look for either the product-template.liquid or featured-product.liquid file, depending on your theme structure.
Open the file and search for the product form tag, which looks like {% form ‘product’ %}.
The next step is to add the stock display code. Just above the form tag, paste this snippet:
{% if current_variant.inventory_quantity > 0 and current_variant.inventory_management == 'shopify' %}
Stock: {{ current_variant.inventory_quantity }}
{% endif %}
This code tells Shopify to show the current stock level for each product variant, but only when inventory tracking is enabled through Shopify’s system. After adding the code, remember to click the Save button to apply your changes.
The stock count will now appear on your product pages, showing customers exactly how many items are available. This feature works particularly well for products with limited availability, as it can encourage customers to make faster purchasing decisions.
You’ll need to ensure your inventory tracking is properly set up in Shopify for this feature to work correctly. Once everything is in place, your customers will be able to see real-time stock levels whilst browsing your products.
Need help with Shopify issue or want to improve the store?
This solution is suitable if you have good knowledge of coding. If you don’t have coding experience, we recommend consulting with a web developer or booking a free call with Kahunam’s experts to help you implement this feature.