Table of Contents

Class Ecommerce.Cart.Line

Namespace
Dynamicweb.Ecommerce.Notifications
Assembly
Dynamicweb.Ecommerce.dll

Provides notification names for Ecommerce cart.

public class Ecommerce.Cart.Line
Inheritance
Ecommerce.Cart.Line
Inherited Members

Examples

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 is null || args is not Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs addedArgs)
            return;

        //Add code here
    }
}

Remarks

The passed NotificationArgs is Ecommerce.Cart.Line.AddedArgs

Fields

Added

Occurs when the user added product to the cart.

public const string Added = "DWN_ECOM_CART_LINE_ADDED"

Field Value

string

Examples

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 is null || args is not Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs addedArgs)
            return;

        //Add code here
    }
}

Decreased

Occurs when product was added to the cart and its amount decreased

public const string Decreased = "DWN_ECOM_CART_LINE_DECREASED"

Field Value

string

Examples

namespace Dynamicweb.Ecommerce.Examples.Notifications;

[Dynamicweb.Extensibility.Notifications.Subscribe(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 is null || args is not Ecommerce.Notifications.Ecommerce.Cart.Line.DecreasedArgs decreasedArgs)
            return;

        //Add code here
    }
}

Increased

Occurs when product was added to the cart and the amount of products in the cart increased

public const string Increased = "DWN_ECOM_CART_LINE_INCREASED"

Field Value

string

Examples

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 is null || args is not Ecommerce.Notifications.Ecommerce.Cart.Line.IncreasedArgs increasedArgs)
            return;

        //Add code here
    }
}

NotAdded

Occurs when the user tries to ad a product to the cart but it cannot because it is not in stock etc.

public const string NotAdded = "DWN_ECOM_CART_LINE_NOT_ADDED"

Field Value

string

Removed

Occurs when the user removed product from the cart

public const string Removed = "DWN_ECOM_CART_LINE_REMOVED"

Field Value

string

Examples

namespace Dynamicweb.Ecommerce.Examples.Notifications;

[Dynamicweb.Extensibility.Notifications.Subscribe(Ecommerce.Notifications.Ecommerce.Cart.Line.Removed)]
public class EcomCartLineRemovedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
    public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
    {
        if (args is null || args is not Ecommerce.Notifications.Ecommerce.Cart.Line.RemovedArgs removedArgs)
            return;

        //Add code here
    }
}
To top