Click or drag to resize

OrderOnBeforeGenerateOrderXml Field

Occurs before the XML for a cart or order is generated. This enables you to change or analyze the order before it's processed.

Namespace:  Dynamicweb.Ecommerce.LiveIntegration.Notifications
Assembly:  Dynamicweb.Ecommerce.LiveIntegration (in Dynamicweb.Ecommerce.LiveIntegration.dll) Version: 3.0.1
Syntax
public const string OnBeforeGenerateOrderXml = "Dynamicweb.Ecommerce.LiveIntegration.Notifications.LiveIntegration.OnBeforeGenerateOrderXml"

Field Value

Type: String
Examples
C#
using Dynamicweb.Extensibility.Notifications;
using Dynamicweb.Ecommerce.LiveIntegration.Notifications;

namespace Dynamicweb.Ecommerce.LiveIntegration.Examples.Notifications
{    
    /// <summary>
    /// Class OrderBeforeGenerateXmlSubscriber.
    /// </summary>
    /// <seealso cref="NotificationSubscriber" />
    [Subscribe(Order.OnBeforeGenerateOrderXml)]
    public class OrderBeforeGenerateXmlSubscriber : NotificationSubscriber
    {
        /// <summary>
        /// Call to invoke observer.
        /// </summary>
        /// <param name="notification">The notification.</param>
        /// <param name="args">The args.</param>
        public override void OnNotify(string notification, NotificationArgs args)
        {
            var myArgs = (Order.OnBeforeGenerateOrderXmlArgs)args;

            // TODO: Add code here
            if (myArgs?.Order != null)
            {

            }
        }
    }
}
See Also