Saturday, November 4, 2017

Setting shopify quantity minimum value

Today faced with problem of shopify:

Ability to set up minimal value for a product quantity

After some research i found some old topics with difficult solutions, for example this one:

In my case it was enough to set minimal value for all products. So here how to do that:

1. Admin / Online Store / 
2. From button "actions" select "edit code"
3. In folder "Sections" find file "product-template.liquid"
4. In my case it was line 172 with code:
class="product-form__input" id="Quantity" name="quantity" pattern="[0-9]*" type="number" value="1"
So i made change here to:
class="product-form__input" id="Quantity" min="10" name="quantity" pattern="[0-9]*" type="number" value="10"
I have set value default to 10 and "min" to 10 too.
5. Press review / save
6. Done

p.s. similar solution found here: