Developer forum

Forum » Ecommerce - Standard features » Update user data for cart when adding a product

Update user data for cart when adding a product

Matthijs Hofstede
Reply

Hi,

 

I came across this situation. I hope somebody can help.

 

A visitor logs in and ads a product to their cart. (The visitor is not being forwarded to the cart or checkout page at this moment). If this cart is abondend at this precize moment the user data is not stored in Dynamicweb (if you check the back end the name e.g. are empty). When the visitor visits the cart (domain.com/cart.aspx) page the data is stored.

 

I would like to know if there is a way to update the cart with the user data at the moment the first product is added to a cart? Hopefully some javascript function? We don't want to forward the user to the cart.

 

FYI: My customer is using the shop mainly as an internal order system. That's why it is inportant to indentify abondoned carts.

Thanks allready!

 

Matthijs Hofstede

Innovadis


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Matthijs,

I think you should be able to handle subscribers like LineAdded / LineDecreased, then get data from the current user and use that to fill the associated properties on the cart / order.

Cheers,

Imar

 
Marco Johannesen
Reply
 
Marco Johannesen
Reply

 What i was trying to say...

 

You could also send an GET ajax request to the cart, which should do the trick?

Or have an empty cart "placeholder" on the listing/product page.

 

Maybe Imar's soloution is better though ;-)

 
Matthijs Hofstede
Reply

 

You must be logged in to post in the forum