Click or drag to resize

EcommerceCartCreatedArgs Class

Provides information about the created cart.
Inheritance Hierarchy
SystemObject
  Dynamicweb.Extensibility.NotificationsNotificationArgs
    Dynamicweb.Ecommerce.NotificationsEcommerceCartCreatedArgs

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

The EcommerceCartCreatedArgs type exposes the following members.

Constructors
  NameDescription
Public methodEcommerceCartCreatedArgs
Initializes a new instance of the EcommerceCartCreatedArgs class.
Top
Properties
  NameDescription
Public propertyOrder
Gets or sets the order.
Top
Remarks
The passed NotificationArgs is Loaded
Examples
C#
using Dynamicweb.Extensibility.Notifications;

namespace Dynamicweb.Ecommerce.Examples.Notifications
{
    /// <summary>
    /// Subscribing on Cart.Loaded event
    /// </summary>
    [Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Loaded)]
    public class EcomCartLoadedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            if (args == null || !(args is Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.LoadedArgs))
                return;

            var myArgs = (Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.LoadedArgs)args;

            if (myArgs.Cart != null)
                System.Web.HttpContext.Current.Response.Write(string.Format("The cart (ID:{0}) has been loaded", myArgs.Cart.Id));
        }
    }
}
See Also