Shopify themes, liquid, logos, and UX
Hi,
I wish to set the maximum limit to quantity selector for adding to cart to 19 by default for all products above which an error message must be shown to check the quantity.
Please help in this.
In quantity-input.liquid under class="quantity__input" you can change the max to 19.
<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="{{ variant.quantity_rule.min }}"
{% if variant.quantity_rule.max != null %}
max="19"
{% 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 }}"
>
Hope this helps
There is no file named as quantity-input.liquid in my theme. What should i do in that case.
In that case it should be in main-product.liquid, if you search for class="quantity__input you should find the correct section.
Hi, Tried this but while testing, everytime i add any number of quantity only one quantity is being added to cart. Can you please check.
I was running into similar issues with the trade theme. The changes to the liquid code were not showing up on the site. I got it working with the "Featured Product" section but not on the PDPs or cart. It looks like there is additional code designed exactly for qty, min, max rules but only for shopify plus. I switched to the dawn theme and the liquid code edits worked, except for the cart. It looks like the liquid code is overwritten by the javascript for the cart and the changes are not dynamic. This video helped me but it doesnt work with Trade or Dawn cart https://www.youtube.com/watch?v=X_5xAl1oaAc
Did you ever fix this? Same problem here with the Trade theme. I was able to change the step and min qty on the product page and cart page but not on the collections page when trying to quick-add them. It's somehow rendering a different version of quantity__input class. I've looked through all the .liquid files but no luck
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024