Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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 }}"
>
Hi,
Have you used Javascript for functionality?
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!
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.
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024