Minimum Quantity not taking affect in cart

Minimum Quantity not taking affect in cart

Schoppy
New Member
4 0 1

Hello,

 

I have recently learned how to code a tag that applies a minimum quantity on a Product Page.

 

However, in the Cart, it seems that Minimum amounts just don't exist. Even a simple "min=10" seems to have no effect.

 

I am hoping to address this issue as minimum quantity is a feature that would help our shop immensely in regards to smaller items, but with an easily exploitable way around it, the feature won't do much good.

 

Thank you again for your time.

 

Working code on the product page

 

 

 

 

{% if product.tags contains "MIN10" -%}
value="10" min="10"
{% else %}}
value="1" min="1"
{% endif %}

 

 

 

 

Cart code in relation to Quantity in the cart

    <div class="cart__item-sub">
      <div>
        <div class="js-qty__wrapper">
          <label for="cart_updates_{{ product.key }}" class="hidden-label">{{ 'cart.label.quantity' | t }}</label>
          <input type="text"
            id="cart_updates_{{ product.key }}"
            name="updates[]"
            class="js-qty__num"
            value="{{ product.quantity }}"
            min="0"
            pattern="[0-9]*"
            data-id="{{ product.key }}">
          <button type="button"
            class="js-qty__adjust js-qty__adjust--minus"
            aria-label="{{ 'cart.general.reduce_quantity' | t }}">
              <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-minus" viewBox="0 0 64 64"><path class="cls-1" d="M55 32H9"/></svg>
              <span class="icon__fallback-text" aria-hidden="true">&minus;</span>
          </button>
          <button type="button"
            class="js-qty__adjust js-qty__adjust--plus"
            aria-label="{{ 'cart.general.increase_quantity' | t }}">
              <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-plus" viewBox="0 0 64 64"><path class="cls-1" d="M32 9v46m23-23H9"/></svg>
              <span class="icon__fallback-text" aria-hidden="true">+</span>
          </button>
        </div>
Replies 0 (0)