Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

checkbox in product info to add multiple products


zohab

Recommended Posts

hi all

i need checkbox like we have in product listing to add multiple products in cart

any ideas?

 

Thanks in advance.

zohab

See leecartercompany.com. Is that what you want?

 

Jim

Link to comment
Share on other sites

See leecartercompany.com. Is that what you want?

 

Jim

 

 

Thanks for reply.

 

 

actullay i had found contribution like this on oscommerce.com.It is through product listing page but i need through product info page.

Link to comment
Share on other sites

Hi

 

In my project i need to add multiple products in cart from product info page.

I need to show one product and other related product below it with checkboxes

 

user will check on checkboxes and selected products will get added into cart.

 

I had searched contribution in oscommerce.com . There is one contribution is available

which is matching above reqirement but it is adding products through product listing page

not through product info page.

 

 

I need to know how to implement this?

 

Thanks in advance and best regards

zohab

Link to comment
Share on other sites

Hi

 

In my project i need to add multiple products in cart from product info page.

I need to show one product and other related product below it with checkboxes

 

user will check on checkboxes and selected products will get added into cart.

 

I had searched contribution in oscommerce.com . There is one contribution is available

which is matching above reqirement but it is adding products through product listing page

not through product info page.

I need to know how to implement this?

 

Thanks in advance and best regards

zohab

Hi,

 

You may be able to get an idea from this, it's the code I have in product_listing.php:

 

// Changes & additions minimum - multipl *********************************e

$lc_text = tep_draw_form('buy_now' . $listing['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), 'POST') . '<table cellSpacing="0" cellPadding="0" width="100%"><tr><td align="right" width="25%">';

 

unset ($options);

//**************************************** using regex

$mimu_id = $listing['products_id'];

$mimu_query = tep_db_query("select d.products_id, d.products_name from products_description d where d.products_id = '$mimu_id'");

$mimu_info = tep_db_fetch_array($mimu_query);

if (preg_match('/min qty of (\d+)/', $mimu_info['products_name'], $match)) {

$min_mult = "min";

$min_qty = $match[1];

} elseif (preg_match('/multiples of (\d+)/', $mimu_info['products_name'], $match)) {

$min_mult = "mul";

$min_qty = $match[1];

}

//**************************************

 

And then in application_top php:

 

// performed by the 'buy now' button in product listings and review page

// $cart-add changed for min-mult: added cart_quantity at end of line. *******************************

 

case 'buy_now' :

 

// if the customer is not logged on, redirect them to the login page

 

if (!tep_session_is_registered('customer_id')) {

 

$navigation->set_snapshot();

 

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 

} else {

 

if (isset($HTTP_GET_VARS['products_id'])) {

 

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

 

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

 

} else {

 

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id']) + $HTTP_POST_VARS['cart_quantity']);

}

 

}

 

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

 

}

 

break;

 

// *******************************************************************

 

Cheers, Jim

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...