Click or drag to resize

EcommerceCartLineDecreasedArgs Class

Provides information about the product the amount of which was decreased in the cart.
Inheritance Hierarchy
SystemObject
  Dynamicweb.Extensibility.NotificationsNotificationArgs
    Dynamicweb.Ecommerce.NotificationsEcommerceCartLineDecreasedArgs

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

The EcommerceCartLineDecreasedArgs type exposes the following members.

Constructors
  NameDescription
Public methodEcommerceCartLineDecreasedArgs
Initializes a new instance of the EcommerceCartLineDecreasedArgs class.
Top
Properties
  NameDescription
Public propertyAmountDecreased
Gets or sets the amount decreased.
Public propertyCart
Gets or sets the cart.
Public propertyDecreasedLine
Gets or sets the decreased product.
Top
Remarks
The passed NotificationArgs is EcommerceCartLineDecreasedArgs
Examples
C#
using Dynamicweb;

namespace Dynamicweb.Ecommerce.Examples.Notifications
{
    [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.Decreased)]
    public class EcomCartLineDecreasedObserver : 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.DecreasedArgs))
                return;

            Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.DecreasedArgs item = (Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.DecreasedArgs)args;

            //Add code here

            //if (item.DecreasedLine.Quantity < 2)
            //{
            //    item.DecreasedLine.Quantity = 2;
            //    item.DecreasedLine.Save();
            //}

        }
    }
}
See Also