Yari Posted January 17, 2006 Posted January 17, 2006 Hi I have used the contrib easy way add Qty box in your product_info.php and in the file product_info I have changed the code on line 213 to <td class="main" align="right"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=10') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td> And in the file application_top.php I have changed the code to $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ $HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']); It says the code should be $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ (int)$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']); But I need the ability to add quantity like 1.2 or 1,2 so I removed (int) in the code. It works if the customer adds 1.2 to the basket but if the customer adds 1,2 it will add only 1 in the basket. How can I do so it replaces the , with . if customer adds 1,2 so it will add 1.2 to the basket ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.