Trade Theme Minimum Order Quantities with Metafields

Trade Theme Minimum Order Quantities with Metafields

8 0 1

Hi all, I am setting up a wholesale website using Trade 15.0 theme.

I have been successful in controlling the product minimum order quantities by using the below code - referencing the products metafields.

I have implemented this on the main-product.liquid page and the modial when 'choose options' is opened (quantity-input.liquid). However I can't seem to make it function on the collection page where the featured collection section is used.

I have attached a screenshot here of where it's not working. Can anyone who is familiar with this theme advise if they are aware of where the quantity__input for that section might be?

My code that's working:

{% assign min_ws_quantity = product.metafields.custom.minimum-quantity %}
{% if min_ws_quantity == blank %}
{% assign min_ws_quntity = 1 %}
{% endif %}

data-quantity-variant-id="{{ }}"
name="updates[{{ variant_id }}]"
{% # theme-check-disable %}
value="{{ cart | item_count_for_variant: }}"
data-cart-quantity="{{ cart | item_count_for_variant: }}"
min="{{ min }}"
data-min="{{ min_ws_quantity }}"
{% if variant.quantity_rule.max != null %}
max="{{ variant.quantity_rule.max }}"
{% endif %}
step="{{ variant.quantity_rule.increment }}"
{% # theme-check-enable %}
aria-label="{{ 'products.product.quantity.input_label' | t: product: variant.title | escape }}"
id="Quantity-{{ }}"
data-index="{{ }}"
Screenshot 2024-07-09 at 11.04.17 AM.png

Replies 2 (2)

Shopify Partner
489 15 34



Have you used Javascript for functionality?

Click here to Contact and Get Shopify Store Help
We are Shopify Experts   from Ecommerce Small Task Company.
8 0 1

Hi there, I have since discovered that the input there is controlled by Javascript. 

However the js is too complicated and outside of my knowledge. 

Do you have any advice of suggestions on how to reference the metafields and have the functionality work in the same way as the liquid verioin?


Thank you!