New Shopify Certification now available: Liquid Storefronts for Theme Developers

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
588 48 73

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.

banned