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!
Hello,
Try this:
Go to your theme > Edit Code
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
It worked! Thanks, @diego_ezfy
KimmieH
September 9, 2020, 11:50pm
4
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?
KimmieH
September 9, 2020, 11:56pm
5
Having something similar for the check-out page would be nice too.
I wish this was built into the Brooklyn Theme.
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
Hello @rheabue
If you want to limit the product qty
Please check out this app
https://apps.shopify.com/purchase-limit ?