How do I stop the product from going below the set minimum quantity (metafields)?

Hi there,

I have a problem with the quantity selector.

I am trying to prevent the minimum quantity value from going below the set value (using metafields).

I have created a metafield “minimum_quantity”, edited the main-product.liquid (prestige theme), and added the code below.

THE CODE:

{% assign min_quantity = product.metafields.wholesale.minimum_quantity %}

{% if min_quantity == blank %}

{% assign min_quantity = 1 %}

{% endif %}

Any idea what’s wrong?

This is test