Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Show Stock level indicator on product page - when ALLOWING products with zero stock to be purchased

Show Stock level indicator on product page - when ALLOWING products with zero stock to be purchased

NoNameNoSlogan
Tourist
4 0 2

Hi

 

I have a client that wants to show stock levels on the product page. That's fine and it works great, except it will not work if we're allowing customers to buy if the stock is at zero.

 

We need to show the stock levels when ALLOWING products with zero stock to be purchased. Does anytbody know how to do that?  I realise the stock figure could theoretically go into minus figures?

 

Thanks in advance

Reply 1 (1)

EcomGraduates
Shopify Partner
794 68 113

Edit the product page template in your Shopify theme to include the stock level information.

Modify the code to show the stock level even if it's zero. You can use the {{ product.variants.first.inventory_quantity }} liquid variable to display the stock level for the first variant of the product.

Adjust the code to allow customers to buy products with zero stock. You can remove or modify any code that prevents customers from buying the product when the stock level is zero.


 If this fixed your issue, likes and accepting as a solution are highly appreciated
|  Build an online presence with our custom-built Shopify Theme: EcomifyTheme
|  Check out our reviews: Trustpilot Reviews
|  We are Shopify Partners: EcomGraduates Shopify Partner