![]() | EcommerceCartLineNotAddedArgs Class |
Namespace: Dynamicweb.Ecommerce.Notifications
The EcommerceCartLineNotAddedArgs type exposes the following members.
Name | Description | |
---|---|---|
![]() | EcommerceCartLineNotAddedArgs |
Initializes a new instance of the EcommerceCartLineAddedArgs class.
|
Name | Description | |
---|---|---|
![]() | Cart |
Gets the cart.
|
![]() | Product |
Gets the added product.
|
![]() | Reason |
Reason why the product was not added to the cart
|
using Dynamicweb; namespace Dynamicweb.Ecommerce.Examples.Notifications { [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.Added)] public class EcomCartLineAddedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args) { if (args == null || !(args is Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs)) return; Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs added = (Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs)args; //Add code here //Dynamicweb.Base.WriteEventLog(string.Format("The cart line (ID:{0}) has been added", added.AddedLine.ID), // System.Diagnostics.EventLogEntryType.Information); } } }