Click or drag to resize

EcommerceCartLineNotAddedArgs Class

Provides information about the added product.
Inheritance Hierarchy
SystemObject
  Dynamicweb.Extensibility.NotificationsNotificationArgs
    Dynamicweb.Ecommerce.NotificationsEcommerceCartLineNotAddedArgs

Namespace:  Dynamicweb.Ecommerce.Notifications
Assembly:  Dynamicweb.Ecommerce (in Dynamicweb.Ecommerce.dll) Version: 1.10.0
Syntax
public class NotAddedArgs : NotificationArgs

The EcommerceCartLineNotAddedArgs type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCart
Gets the cart.
Public propertyProduct
Gets the added product.
Public propertyReason
Reason why the product was not added to the cart
Top
Remarks
Examples
C#
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);
        }
    }
}
See Also