Zen Cart Logo
Forums / General Questions / Add multiple products with a link to shopping cart

Add multiple products with a link to shopping cart

Locked

Views: 1,611

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
22 Jan 2008, 12:35 AM
#1
reden avatar

reden

New Zenner

Join Date:
Dec 2007
Posts:
23
Plugin Contributions:
0

Add multiple products with a link to shopping cart

Is there a way to add multiple products to the Shopping Cart with just one link?

For example, if I had a link or a banner that said something like, "Bundle these three products today" and it will add them to the cart without going one by one? Thanks.

29 Jan 2008, 4:32 PM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Add multiple products with a link to shopping cart

A function like this does exist if you are posting data back using the POST method, but not for passing the products in the URL, however, anything is possible, but some things take a little work....

With this problem, you would need to add some custom code to the includes/extra_cart_actions/ folder. In here, I would add a file which checks for a GET action of "add_multi_get_products".

You will then need to go through and iterate through the product ids, and quantities, and use something like:

          $_SESSION['cart']->add_cart($products_id, $_SESSION['cart']->get_quantity($_GET['products_id'])+$qty);

You will need to include a little error trapping, for circumstances such as the customer is trying to order more than allowed etc.

Absolute