Developer forum

Forum » Development » Adding product to cart

Adding product to cart


Reply

 

 
Is there a way to decide if a product is merged with existing line or added as a new line to the order?

Replies

 
Reply

I'm not sure, I know what you mean by merged, but the API offers notifications for added, increased and decreased that you can hook up to when the appropriate events occur on the basket. Please check the Dynamicweb.Notifications.eCommerce.Cart.Line class for details. Is this what you need?

 
Reply
Sorensen wrote:

I'm not sure, I know what you mean by merged, but the API offers notifications for added, increased and decreased that you can hook up to when the appropriate events occur on the basket. Please check the Dynamicweb.Notifications.eCommerce.Cart.Line class for details. Is this what you need?

I mean when a product is added to the cart, and the cart already contains this product, the quantity on the orderline is incremented with the new ordered quantity, and no new orderline is created. I want to force the cart to add an new orderline to the cart.

 

 
Reply

Oh, ok. There's no default way of handling this, so you should probably look at the notification approach.

 

You must be logged in to post in the forum