How and where to set quantity step (incremental value)

Hi everyone,

Does anyone know where/how I set the following variable efficiently?

product.selected_or_first_available_variant.quantity_rule.increment

I need to have product quantities increment by 100. I know I can set it straight in the liquid file or even by script but this seems inefficient.

Thanks!

~ Didier

Hi @didierdonne ,

Since liquid cannot change the value of product.selected_or_first_available_variant.quantity_rule.increment, you can choose to do the following:

  1. Online store → Themes → Edit code

  2. Go to main-product.liquid and set the value incrementValue = 100

{% assign incrementValue = 100 %}
  1. Then set step = incrementValue ;
<input
                    class="quantity__input"
                    type="number"
                    name="quantity"
                    id="Quantity-{{ section.id }}"
                    data-cart-quantity="{{ cart_qty }}"
                    data-min="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    min="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    {% if product.selected_or_first_available_variant.quantity_rule.max != null %}
                      data-max="{{ product.selected_or_first_available_variant.quantity_rule.max }}"
                      max="{{ product.selected_or_first_available_variant.quantity_rule.max }}"
                    {% endif %}
                    step="{{ incrementValue }}"
                    value="{{ product.selected_or_first_available_variant.quantity_rule.min }}"
                    form="{{ product_form_id }}"
                  />

Hope it’s useful to you @didierdonne !

Hi @BSS-Commerce ,

Thank you for your reply! I really appreciate it. Are by any chance aware if this could be set using product metadata?

Thanks!

~ Didier

I need different min qty for my shopify prodcts, ex: 250 | 500 | 1000 | 2500 | etc. or even qty steps like 50-100-150-200-250, etc.. is that possible?