Developer forum

Forum » Development » Merging products in cart

Merging products in cart

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am not sure how to better title this question, therefore I will explain it.
We have a situation where we are using a few orderline fields. Some of these orderline fields are getting values server-side, not through the add to cart form.

This implementation generates a separation of products in cart, even when adding the same product. And it makes sense why.

My question is if I can override the separation behavior using some notification after or before adding to cart. If the product exists, increment the orderline quantity. If not , go ahead and add it to cart.

I hope that it makes sense.

Thank you,

Adrian


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Adrian,

You can use subscribers like OrderLineAdded to reorganize the order lines after one has been added. You may also need OrderLineDecreased, OrderLineIncreased and OrderLineRemoved to handle other changes to the cart.

Hope this helps,

Imar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Imar,

Thank you. It helps a lot. You have steered me in the right direction.

Thank you,
Adrian

 

You must be logged in to post in the forum