Trade Theme Minimum Order Quantities with Metafields

Trade Theme Minimum Order Quantities with Metafields

mattgenefaas
Tourist
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 %}

<input
class="quantity__input"
data-quantity-variant-id="{{ variant.id }}"
type="number"
name="updates[{{ variant_id }}]"
{% # theme-check-disable %}
value="{{ cart | item_count_for_variant: variant.id }}"
data-cart-quantity="{{ cart | item_count_for_variant: variant.id }}"
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-{{ variant.id }}"
data-index="{{ variant.id }}"
>
Screenshot 2024-07-09 at 11.04.17 AM.png

Replies 2 (2)

Small_Task_Help
Shopify Partner
489 15 34

Hi,

 

Have you used Javascript for functionality?

Click here to Contact and Get Shopify Store Help
We are Shopify Experts   from Ecommerce Small Task Company.
mattgenefaas
Tourist
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!