![]() | EcommerceCartCreatedArgs Class |
Namespace: Dynamicweb.Ecommerce.Notifications
The EcommerceCartCreatedArgs type exposes the following members.
Name | Description | |
---|---|---|
![]() | EcommerceCartCreatedArgs |
Initializes a new instance of the EcommerceCartCreatedArgs class.
|
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)); } } }