Jump to content

Adding multiple products to cart.


Recommended Posts

Hello,

 

I'm currently developing a store and I have some kind of lists with multiple products on them. The customer is supposed to choose from one of these lists to buy all the products in it. Sounds simple. When the customer chooses the list I get the products in it from the database, and add them one by one calling:

ajaxCart.add(list[i]['id_product'], null, false, this, list[i]['quantity']); 

inside a for loop that runs through the list (I made a custom table to create the relation between the products and the lists).

 

This method works most of the time but eventually I get one of this errors:

  • Only one of the products get added to the cart.
  • All products are added to the cart, but a different cart is created for every product in BO. That's not a big problem but it may get hard to work with a lot of carts in the same order (a list can contain as much as 20 products and a customer should be able to order more than one list in the same order).
  • The third problem I have found is that all the products get added to the list but I get the following error on the screen:

post-954825-0-55945000-1427395609_thumb.jpg

http://imgur.com/Di84kc2

Edited by DidierF (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...