Top

Create a Quantity Box Dropdown

If you want to sell in bulk or increments for your wholesale store, you can do this yourself with most themes. Take your time if you're not familiar with Liquid code or reach out to someone you know who is.

First, you'll need to open up product.liquid in your store's theme. Once you see the code search for "quantity" which, depending on your theme, may already be commented out. If it is commented out don't worry: just paste the code below the commented space.

This code snippet will create a quantity box drop-down, with values from 1 through 10.

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

What if I sell only in multiples of 4

The code snippet can easily be changed, multiplying the quantity by 4

<label for="quantity">Quantity: </label> 
<select id="quantity" name="quantity">
{% for i in (1..10) %}
<option value="{{ i | times: 4 }}">{{ i | times: 4 }}</option>
{% endfor %}
</select>

Adding the code to your product template will cause every product in the store to have the quantity drop-down menu. You may want to create a separate product page template, add this code to it, and then apply that custom template to any products that you want to have this dropdown. You can find a handy guide on creating a product page template here: 

Can I Create and Use an Alternate Template for Pages, Products, Collections or Blogs?

Have more questions? Submit a request