Product Quantity on each listing

New Member
3 0 0
Hey there. I'm using the free theme Brooklyn and I was wondering how can I show on each product listing how many pieces are available? Thank you
0 Likes

Hello @Tazzabell ,
I think your question is confusing.
You want to show Stock Inventory availability on listing or product quantity button next to add to cart.
If you want to show Inventory availability.

You can do the following

1. Add the following code in your product-template.liquid  You should keep the span and span id.

<hr class="hr--small">
 <h4> <span id="inventoryQuantity">{{current_variant.inventory_quantity }}</span> available. <h4>
<hr class="hr--small">

2. In your theme.js.liquid locate the function  productPage: function(evt) { and in this function below the line  // also show SKU  (about line 2039) add the following

 $('#inventoryQuantity').html(variant.inventory_quantity);

 

Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Free Review and advice for sale on store | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | SEO & Digital Marketing | Site Speed Optimization | Performance Site Audit
0 Likes
New Member
3 0 0
Where do I add that first part in the product template liquid?
0 Likes
New Member
3 0 0
I also cant find that product.page thingy
0 Likes