You can modify your theme to do this by following these steps:
- From Shopify's admin, select Online Store.
- Select Actions.
- Select Edit code.
- Under "Templates", select product.liquid.
Note: If your theme contains sections, you may have to make these changes in a different file, like product-template.liquid under "Sections".
- Find the quantity box code like this:
<label for="Quantity">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="Quantity" name="quantity" value="1" min="1" class="product-form__input" pattern="[0-9]*">Note: Some themes, like Radiance, do not have a quantity box. If yours doesn't, you can skip this step.
- Replace with this code:
<label for="quantity">Quantity:</label> <select id="quantity" name="quantity"> {% for i in (1..10) %} <option value="{{ i | times: 1 }}">{{ i | times: 1 }}</option> {% endfor %} </select>
- Select Save.
That's it!
This code will create a drop-down list of the numbers 1 through 10. To customize this code:
{% for i in (1..10%} controls the number of selectable options in the drop downs.
<option value="{{ i | times: 1 }}">{{ i | times: 1 }}</option>
Change the 1 to the number of increments in your discount. So if your discounts change in increments of 25, you would change the 1 to 25.
Comments
Please sign in to leave a comment.