E-Junkie Forum http://www.e-junkie.com/bb/ E-Junkie Forum RSS en-us Copyright 2013, 19.5 Degrees. All rights reserved. webmaster@e-junkie.com webmaster@e-junkie.com Thu, 11 Aug 2011 23:14:06 GMT Wed, 22 May 2013 17:26:17 GMT 681 E-JUNKIE 5 E-Junkie Forum http://www.e-junkie.com/bb/ http://www.e-junkie.com/ej/logo.gif 290 104 Post #4 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 Thu, 11 Aug 2011 23:14:06 GMT
<form action="https://www.e-junkie.com/ecom/gb.php?i=XXXXXX&c=cart&cl=178295&ejc=2" method="POST" target="ej_ejc">
Quantity:<br>
<select name="quantity">
<option value="2">
<option value="3">
<option value="4">
<option value="5">
<option value="6">
<option value="7">
<option value="8">
<option value="9">
<option value="10">
</select>
<input type="image" src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" onClick="javascript:return EJEJC_lc(this.parentNode);" alt="Add to Cart" class="ec_ejc_thkbx" border="0"/></form>]]>
E-junkie Discussions; E-junkieGuru
Post #3 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 Wed, 10 Aug 2011 21:46:34 GMT
Just for others - this is how I did it:
I used an onselect action for the select field with refreshing the page while reading the value of the selected field and adding it into the button URL. Default qty is 1.

<?php
$orderqty = $_REQUEST['qty'];
if ($orderqty == "") $orderqty = 1;

echo '<form name="form" method="POST" action=""><select name="qty" onchange="document.form.submit();">';
for ($i = 1; $i <= 10; $i++) {
echo '<option ';
if ($i == $orderqty)
echo 'selected';
echo '>'.$i.'</option>';
}
echo '</select><a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=[myID]&cl=[myID]&ejc=2&quantity='.$orderqty.'" target="ej_ejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart"/></a></form>';
?>]]>
E-junkie Discussions; betulin
Post #2 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 Wed, 10 Aug 2011 20:06:39 GMT
<a href="https://www.e-junkie.com/ecom/gb.php?c=cart&i=XXXXXX&cl=178295&ejc=2&quantity=2" target="ej_ejc" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this);"><img src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart"/></a>

If you also want to prevent the buyer from editing that quantity in the cart, you can leave "Let buyer edit quantity" in the product's settings, so whatever quantity the button adds to cart would be the only quantity they can order.

If you need to put a Quantity selection menu in your page next to the Add to Cart button, that's rather more complicated to explain and set up, so just reply to let us know if that's what you actually need.]]>
E-junkie Discussions; E-junkieGuru
Post #1 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 http://www.e-junkie.com/bb/topic/5372/pg/0#post18552 Wed, 10 Aug 2011 03:29:24 GMT http://betulinstore.com/order.php) Right now I can only a one unit and have the qty changed in the cart.

Is there a way to feed the unit quantity into the Add to Cart function (POST/GET form)
Thanks!]]>
E-junkie Discussions; betulin