Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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 ?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...