View Full Version : quanity on "buy now / product info" page?

02-11-2006, 05:14 PM
hi all,

maybe i'm missing something obvious but is there a way to add a quantity option (either drop down or type in) on the product info page?


02-18-2006, 01:37 PM
Anyone figure this out yet - i came close but get it to work correctly...

02-19-2006, 11:30 AM
The key here is that the quantity has to be passed in to the cart.

from product_inf.tpl.php replace you place in cary <td></td> with something that looks like this:

<td class="main" align="right"><? echo tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2'); ?><input type="hidden" name="cart_quantity" value=1 maxlength="6" size="4">  <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

This will add the text entry box that will pass the quantity to the cart when they select the add to cart button.

02-22-2006, 01:14 PM

Did the above and it added box but will not read quantity and only adds 1 item no matter what quantity typed in. Wouldn't something in application_top need to be changed?

02-23-2006, 08:28 AM
check application_top and make sure that $quantity is not being set to 1 by default (this is done for the "buynow" buttons). The code should look like:

case 'add_product' :
if ($quantity < 1) $quantity = 1;

02-23-2006, 10:02 AM
Ok in oscmax catalog/includes/ application_top you need to find this line around line 413

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['produc ts_id'], $attributes))+1, $attributes);

Change +1 to +$quantity
So finished code looks like this.

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['produc ts_id'], $attributes))+$quantity, $attributes);

Blayne Pierce

It is in the QT Pro Mod section Works great now