Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Trade Theme Minimum Order Quantities with Metafields

Trade Theme Minimum Order Quantities with Metafields

mattgenefaas
Tourist
9 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 3 (3)

Small_Task_Help
Shopify Partner
830 28 75

Hi,

 

Have you used Javascript for functionality?

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
mattgenefaas
Tourist
9 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!

deeman3
Visitor
2 0 0

Where exactly is it in the JS files? I'm running to the exact same issue on Trade theme. Cart and Product Page works but not on the main collections page.