Developer forum

Forum » CMS - Standard features » orderline field - set value on add to cart

orderline field - set value on add to cart

Nuno Aguiar
Reply
Hi,

Is there a way to set the value of a custom orderline field when we click "Add To Cart"? (using cart v1)

Best Regards,
Nuno


Replies

 
Dmitriy Benyuk
Reply
Hi Nuno,

you can subscribe to the notification: CartLineAddedObserver - it is called when the product is added to the cart.
It's located under VisualStudio Tempates->eCom->Cart.

You can access the order/orderlines from Dynamicweb.Notifications.eCommerce.Cart.Line.AddedArgs args:

Dynamicweb.Notifications.eCommerce.Cart.Line.AddedArgs added = (Dynamicweb.Notifications.eCommerce.Cart.Line.AddedArgs)args;
added.AddedLine.Order.OrderLines

 

You must be logged in to post in the forum