Quantity Selector and Max Limit for Brooklyn Theme

Solved
Highlighted
Tourist
15 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
Highlighted
Globetrotter
567 81 102

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.
◦ Hire me! Recommended by 25+ customers, read what they wrote about my work clicking here.
◦ Contact me at: diego.boarutto.fortes@gmail.com
0 Likes
Highlighted
Tourist
15 0 1

It worked! Thanks, @dantepw 

0 Likes