Dynamicweb 8 Documentation
eCommerce.Cart.CreatedArgs Class
Members  Example 

Provides information about the created cart.
Object Model
eCommerce.Cart.CreatedArgs ClassOrder Class
Syntax
'Declaration
 
Public Class eCommerce.Cart.CreatedArgs 
   Inherits Dynamicweb.Extensibility.NotificationArgs
public class eCommerce.Cart.CreatedArgs : Dynamicweb.Extensibility.NotificationArgs 
Remarks
The passed NotificationArgs is eCommerce.Cart.Loaded
Example
Notification observer exampleNotification observer example
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
Inheritance Hierarchy

System.Object
   Dynamicweb.Extensibility.NotificationArgs
      Dynamicweb.Notifications.eCommerce.Cart.CreatedArgs

Requirements

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

See Also

Reference

eCommerce.Cart.CreatedArgs Members
Dynamicweb.Notifications Namespace

Send Feedback