Click or drag to resize

OrderLineOnAfterGenerateOrderLineXml Field

Occurs after the XML for an order line is generated. This enables you to change or analyze the XML before it's sent to the ERP.

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

Field Value

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

namespace Dynamicweb.Ecommerce.LiveIntegration.Examples.Notifications
{    
    /// <summary>
    /// Class OrderLineAfterGenerateXmlSubscriber.
    /// </summary>
    /// <seealso cref="NotificationSubscriber" />
    [Subscribe(OrderLine.OnAfterGenerateOrderLineXml)]
    public class OrderLineAfterGenerateXmlSubscriber : 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 = (OrderLine.OnAfterGenerateOrderLineXmlArgs)args;

            // TODO: Add code here
            if (myArgs?.OrderLineNode != null)
            {
                Logging.Logger.Instance.Log(Logging.ErrorLevel.DebugInfo, "OrderLineAfterGenerateXmlSubscriber:[" + myArgs.OrderLineNode.OuterXml + "]");
            }
        }
    }
}
See Also