Display Quantity as drop down list

Highlighted
New Member
3 0 0

I came across a tutorial to display the quantity as a drop down list, which said to replace this line:

<input type="number" id="Quantity" name="quantity" value="1" min="1" class="product-form__input product-form__quantity">

With this:

<select name="quantity" id="quantity" >
{% for i in (1..4) %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>

 

The strange thing is, when I have both of those chunks of code I see a standard quantity selection and a drop down, but when I remove the first line to only display the dropdown I don't see anything. Anyone have an idea how to fix that?

0 Likes