Dynamicweb.Notifications Namespace : eCommerce Class |
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Dynamicweb.Notifications; using Dynamicweb.Extensibility; namespace Dynamicweb.Examples.CSharp.Notifications.eCommerce { /// <summary> /// Subscribing on Cart.Loaded event /// </summary> [Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.eCommerce.Cart.Loaded)] public class EcomCartLoadedObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, NotificationArgs args) { if (args == null || !(args is Dynamicweb.Notifications.eCommerce.Cart.LoadedArgs)) return; var myArgs = (Dynamicweb.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)); } } }
Imports Dynamicweb Namespace Dynamicweb.Examples.Vb.Notifications.eCommerce <Global.Dynamicweb.Extensibility.Subscribe(Global.Dynamicweb.Notifications.eCommerce.Cart.Loaded)> _ Public Class EcomCartLoadedObserver Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Object()) If args Is Nothing OrElse args.Length = 0 OrElse Not (TypeOf args(0) Is Global.Dynamicweb.eCommerce.Orders.Order) Then Return End If Dim order As Global.Dynamicweb.eCommerce.Orders.Order = DirectCast(args(0), Global.Dynamicweb.eCommerce.Orders.Order) 'TODO: Add code here 'System.Web.HttpContext.Current.Response.Write(string.Format("The cart (ID:{0}) has been loaded", order.ID)) End Sub End Class End Namespace
System.Object
Dynamicweb.Notifications.eCommerce
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2