Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add multiple products in product_info.php


MarcusD

Recommended Posts

Posted

hi,

 

how can i realize that?

 

i think about a editable textfield, where the customers can place their wished volume, instead of update the cart entrys.

 

anyone got an idea

 

thanks

marcus

Posted

Hi,

 

Open your product_info.php page and before the 'in cart' button add this code

 

Quantity <input type="text" name="quantity" value="1" maxlength="4" size="3">

 

so it looks something like

 

            <td align="right" class="main">Quantity <input type="text" name="quantity" value="1" maxlength="4" size="3"> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

Back up b4 you try!

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Posted

... it doesn't works...

 

if i enter a value, there will be added just one to cart...

 

i'm using ms1

 

cu'n thnx

marcus

Posted

Hi,

 

You also have to change the application_top.php file, find the following lines;

 

      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

                               $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['id']);

                             }

                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

                             break;

 

and change to

 

      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

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

                             }

                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

                             break;

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...