Hello everyone, I know many asked this question before but i’m still struggeling with that. I want to limit order quabtity to 1 for a specific product. I know I have to edit my code at this section:
I know I have to put an if/else snippet here, but I don’t really know how. I tried a few things but everytime an Error pops up like: Liquid syntax error: Unknown tag ‘when’
{% assign limited_product_handle = 'product-handle-string' %}
{% if product.handle == limited_product_handle %}
{% else %}
The alternative is to use alternate templates for those specific product where the custom component <quantity-input class="quantity"> is completely replaced with a basic hidden input.
Or course the deeper problem here is these triput button components are never made to obey the max attributes values on the input itself so the minus/plus will ignore a max="1" declaration.
@PaulNewton sorry that didn’t work for me, when I just put a max attribute to the original code, that works but I can’t point to a specific Item. When i create a new template how can I use this then?
{% assign productTags = product.tags %}
{% if productTags contains "noquantity" %}
{% else %}
@PaulNewton ok that works for me thank you for showing me the right direction.
Did this solution work for you? I have the same situation, I also need to limit a product quantity per order. I need no more than 5 items per order of one product due to specifics of shipping. I do not code at all so I have no idea where to insert this code…