Click or drag to resize

EcommerceCartLineIncreasedArgs Class

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

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

The EcommerceCartLineIncreasedArgs type exposes the following members.

Constructors
  NameDescription
Public methodEcommerceCartLineIncreasedArgs
Initializes a new instance of the EcommerceCartLineIncreasedArgs class.
Top
Properties
  NameDescription
Public propertyAmountIncreased
Gets the amount increased.
Public propertyCart
Gets the cart.
Public propertyIncreasedLine
Gets the increased product.
Top
Remarks
The passed NotificationArgs is EcommerceCartLineIncreasedArgs
Examples
C#
using Dynamicweb;

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

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

            //Add code here

            //if (item.IncreasedLine.Quantity > 5)
            //{
            //    item.IncreasedLine.Quantity = 1;
            //    item.IncreasedLine.Save();
            //}

        }
    }
}
See Also