Shopify themes, liquid, logos, and UX
Hello, We are new here and have been looking through all the past forum posts on this topic and it's not completely clear how to do what we are looking for.
We need to be able to restrict the quantity selector from being incremented if the inventory is not available for each variant. We saw this code
<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]*">
Which this ^ appears to work fine for products without variants. We have Variants.
Then it says
If you have variants then you have to change max value using Js from Asset->theme.js from variants select callback function. find if(variants)
But doesn't exactly say how to add this restriction in code for non-coding people.
My ASK:
This person is asking for the same restriction on the quantity selector for the cart page with no answers...
https://community.shopify.com/c/shopify-design/cart-quantity-selector-should-not-exceed-available-in...
I chatted with support and they said they have no answer for this and gave me the same links to forum posts I've already visited. They suggested that I pay for an expert to write the code or pay for an app that does something similar. I don't think we should have to pay for something that seems like it should be basic core functionality.
I'm really hoping that someone can reply that has already figured this out!
Thanks in advance!
Hello @JDV ,
I very much agree with you on "I don't think we should have to pay for something that seems like it should be basic core functionality. "
It's sad that no one have yet replied to this question. I am facing the same issue and have been looking for resources for quite some time. Did you happen to find any solution for this.?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024