Code for minimum order quantity for a product is not working on quantity selector on cart page.

Hi,

The code for the minimum order quantity on the product page using metafield is working well. But even after changing the code in main-cart-items.liquid, it is not working. Still, I am able to change the quantity below the minimum order quantity.

{% assign min_quantity = item.product.metafields.moq.minimum_quantity %}
{% if min_quantity == blank %}
{% assign min_quantity = 1 %}
{% endif %}
<input class=“quantity__input”
type=“number”
name=“updates
value=“{{ item.quantity }}”
min=“”{{ min_quantity }}“”
onkeydown=“return false”
aria-label=“{{ ‘products.product.quantity.input_label’ | t: product: item.product.title | escape }}”
id=“Quantity-{{ item.index | plus: 1 }}”
data-index=“{{ item.index | plus: 1 }}”

What might be the mistake in the above-mentioned code?

TIA

Hi @Leenu1994_1

Can you please let me know your store link? I will help to check this problem for you.

Thanks

Hi,

Thanks for the reply. I sent you the message. Kindly check for the link and password

1 Like

Hi @Leenu1994_1

We checked your site and saw that it seems you set the wrong value, making a minimum order quantity error.

On the product page, the minimum value is true

view.png

On the Cart page, the minimum value is wrong

view (1).png

Thus, you should double-check this code. Maybe you misspelled or missed some characters. The value must be min = “3” to be correct.

If our suggestions are helpful to you, please let me know by giving a like or marking it as a solution. Also, please let me know if you need any further help.

1 Like

Hi

Thank you so much for your help!

Yes, I got it. I misspelled some characters.

Fixed now.

1 Like