Shopify themes, liquid, logos, and UX
Hi guys,
Ive been trying to create a product page template that limits the quantity drop down to multiples of 3. For example I only want to let a customer select 3,6,9,12,15 etc, and no other numbers.
I have created a new product template, and have linked it to a new section. The page is loading as expected but the multiples requirement is NOT working as expected. Below is an extract of the coding from the section:
<div class="product-form__item product-form__item--quantity">
<label for="Quantity">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="Quantity" name="quantity" value="3" min="3" step="3" class="product-form__input product-form__quantity" >
</div>
When I load the page the qty starts on 3 unit, but clicking the + or - button allows you to move 1 unit, I would like this to move 3 units.
Theme - Venture
Thank you.
Solved! Go to the solution
This is an accepted solution.
Try This
<select id="quantity" name="quantity">
{% for i in (1..10) %}
<option value="{{ i | times:3 }}">{{ i | times:3 }}</option>
{% endfor %}
</select>
This is an accepted solution.
Try This
<select id="quantity" name="quantity">
{% for i in (1..10) %}
<option value="{{ i | times:3 }}">{{ i | times:3 }}</option>
{% endfor %}
</select>
This works perfectly - Thank you.
BUT when in my shopping cart I can adjust the qty by 1....How do I fix this?
Add default 1 value before loop also if useful please like post
<select id="quantity" name="quantity">
{% for i in (1..10) %}
<optio value="1">1</option>
<option value="{{ i | times:3 }}">{{ i | times:3 }}</option>
{% endfor %}
</select>
Still the same, see below once in the shopping cart I can increase to 4, on the product page it works perfectly.
Hi
Under section there is section name cart-template.liquid add step="3" for + and -
Below example is for refrence
<span class="minus">-</span>
<input type="number" min="0" step="3" class="quantity" >
<span class="plus">+</span>
Would this not affect all products?
I only want this function specifically for a single product/product template.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024