Quantity Selector and Max Limit for Brooklyn Theme

Solved
rheabue
Tourist
18 0 1

Hi,

 

Hope someone can also help me with the quantity selector.

I don't know why it accepts more than the inventory we have for a product.

Example: only available product is 4 but when customer clicks 5 on the quantity selector per product, it still accepts it upon checkout.

the website i'm working on is www.cornerhome.ph

 

Thank you!

0 Likes

This is an accepted solution.

Hello,

Try this:
1. Go to your theme > Edit Code
2. Under the folder "section" find the file "product-template.liquid". Find the quantity box and add this code to it:

max="{{ product.selected_or_first_available_variant.inventory_quantity}}"

It should look something like this:

<input type="number" id="Quantity-{{ section.id }}" name="quantity" max="{{ product.selected_or_first_available_variant.inventory_quantity}}" value="1" min="1" class="product-form__input" pattern="[0-9]*">

If you have variants then you have to change max value using Javascript, in this case it would require hiring a Shopify developer to assist you.

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Add a slider to product page images: Minimal theme | Debut theme | Brooklyn theme
◦ Contact: ezfycode@gmail.com.
0 Likes
rheabue
Tourist
18 0 1

It worked! Thanks, @diego_ezfy 

0 Likes
KimmieH
New Member
4 0 0

I followed these directions (and thank you so much for the help!) but the quantity doesn't change when I select a different variant.  
All it does is copy the amount from the first variant or the first selected variant.  

Hopefully this makes sense.  

Any suggestions?

0 Likes
KimmieH
New Member
4 0 0

Having something similar for the check-out page would be nice too.  
I wish this was built into the Brooklyn Theme.

0 Likes
sfusobuono
New Member
1 0 0

Hello Diego,the solution you provided should be for every theme?

I tried to apply it but selector is 'infinite' and it doesn't stop at the actual available inventory quantity. For a check, website is sfusobuono.com

thanks a lot for a feedback

 

0 Likes