Lost income due to COVID-19? E-junkie is providing 1 year free accounts to sell anything, anywhere. Click Here for more details.

E-junkie Help >

Let buyer enter quantity before clicking Add to Cart

« Return to Shopping Cart Buttons

Normally, you would just tick the box to Let buyer edit quantity in each product's settings, so as soon as they add an item to their cart, they can enter their preferred quantity then or anytime before they proceed to checkout.

However, if you prefer to provide a quantity field or dropdown menu next to your product's Add to Cart button, so the buyer can specify their quantity before they click the button, you can do that with a bit of custom HTML coding.

The menu approach covered at the end of this page is particularly useful if you want to have a maximum allowable quantity, or if you only want buyers to be able to choose from a list of specific predetermined quantities, as buyers would only be able to pick from the quantity range you provide in the menu.

If your product already uses Variations or Variants, you can simply add a text-input field for Quantity: <input type="text" name="quantity"> to the standard button code we generate for such products, like so:

<form method="GET" action="https://www.e-junkie.com/ecom/gb.php" target="ej_ejc" accept-charset="UTF-8">
<input type="hidden" name="cl" value="XXXXXX">
<input type="hidden" name="i" value="YYYYYY">
<input type="hidden" name="c" value="cart">
<input type="hidden" name="ejc" value="2">
Size:<input type="hidden" name="on0" value="Size"><br>
<select name="os0">
<option value="Small">Small</option>
<option value="Large">Large</option>
</select><br>
Quantity:<br>
<input type="text" name="quantity" size="3" value="1"><br>

<input style="display:inline-block;background: #3da5d9 url(https://www.e-junkie.com/ej/images/newaddtocart.png) center/100px no-repeat;border: none;padding: 7px 55px;border-radius: 3px;box-shadow: 1px 2px 2px rgba(0,0,0,0.2);cursor: pointer;" type="submit" value="" onclick="return EJEJC_lc(this.parentNode);" class="ec_ejc_thkbx">
</form>

For products that don't use Variations/Variants, just use the Add to Cart code below, replacing the XXXXXX with your E-junkie Client ID (you can find this in Seller Admin > Manage Seller Account > View Account Summary), and replacing the YYYYYY with the Item Number from the relevant product's settings:

<form method="GET" action="https://www.e-junkie.com/ecom/gb.php" target="ej_ejc" accept-charset="UTF-8">
<input type="hidden" name="cl" value="XXXXXX">
<input type="hidden" name="i" value="YYYYYY">
<input type="hidden" name="c" value="cart">
<input type="hidden" name="ejc" value="2">
Quantity:<br>
<input type="text" name="quantity" size="3" value="1"><br>

<input style="display:inline-block;background: #3da5d9 url(https://www.e-junkie.com/ej/images/newaddtocart.png) center/100px no-repeat;border: none;padding: 7px 55px;border-radius: 3px;box-shadow: 1px 2px 2px rgba(0,0,0,0.2);cursor: pointer;" type="submit" value="" onclick="return EJEJC_lc(this.parentNode);" class="ec_ejc_thkbx">
</form>

If you prefer to show a quantity dropdown menu (rather than a text field), you'd use the version below; you can add as many <option value...etc.> lines as you need, and the text shown to buyers for each menu item (e.g. Single, Two-pack, Case of Six, Dozen in this example) can be customized to say anything you wish.

This approach is particularly useful if you want to have a maximum allowable quantity, or if you only want buyers to be able to choose from a list of specific predetermined quantities, as buyers would only be able to pick from the quantity range you provide in the menu. In that case, you'd untick the box to Let buyer edit quantity in the product settings if you don't want buyers to be able to enter any arbitrary quantity for the item once it's in their cart.

<form method="GET" action="https://www.e-junkie.com/ecom/gb.php" target="ej_ejc" accept-charset="UTF-8">
<input type="hidden" name="cl" value="XXXXXX">
<input type="hidden" name="i" value="YYYYYY">
<input type="hidden" name="c" value="cart">
<input type="hidden" name="ejc" value="2">
Quantity:<br>
<select name="quantity">
<option value="1">Single</option>
<option value="2">Two-pack</option>
<option value="6">Case of Six</option>
<option value="12">Dozen</option>
</select><br>

<input style="display:inline-block;background: #3da5d9 url(https://www.e-junkie.com/ej/images/newaddtocart.png) center/100px no-repeat;border: none;padding: 7px 55px;border-radius: 3px;box-shadow: 1px 2px 2px rgba(0,0,0,0.2);cursor: pointer;" type="submit" value="" onclick="return EJEJC_lc(this.parentNode);" class="ec_ejc_thkbx">
</form>