Dynamicweb 8 Documentation
OrderLineTemplateExtender Class
Members  Example 

OrderLine template extender. Extends the rendering of a OrderLine.
Object Model
OrderLineTemplateExtender ClassOrder ClassOrderLine ClassExtranet Class
Syntax
'Declaration
 
Public MustInherit Class OrderLineTemplateExtender 
   Inherits Dynamicweb.Extensibility.TemplateExtender
public abstract class OrderLineTemplateExtender : Dynamicweb.Extensibility.TemplateExtender 
Example
Extending the layout templateExtending the layout template
using Dynamicweb.eCommerce.Frontend;
using Dynamicweb.eCommerce.Orders;

public class SampleOrderLineTemplateExtender : OrderLineTemplateExtender
{
    public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
    {
        if (RenderingState == TemplateExtenderRenderingState.Before)
        {
            template.SetTag("Ecom:Order.OrderLine.BeforeRenderTag",
                    "BEFORE THE ORDERLINE WAS RENDERED (" + OrderLine.Quantity + " x " +
                    OrderLine.UnitPrice.PriceFormatted + ")");
        }
        else
        {
            template.SetTag("Ecom:Order.OrderLine.AfterRenderTag",
                    "AFTER THE ORDERLINE WAS RENDERED (" + OrderLine.Quantity + " x " +
                    OrderLine.UnitPrice.PriceFormatted + ")");
        }
    }
}
Imports Dynamicweb.eCommerce.Orders
Imports Dynamicweb.eCommerce.Frontend

Public Class OrderLineTemplateExtender1
    Inherits OrderLineTemplateExtender

    Public Overrides Sub ExtendTemplate(ByVal template As Rendering.Template)
        If RenderingState = TemplateExtenderRenderingState.Before Then
            'TODO: Add code here. Fires before the orderline gets rendered
            template.SetTag("Ecom:Order.OrderLine.BeforeRenderTag", "BEFORE THE ORDERLINE WAS RENDERED (" & OrderLine.Quantity & " x " & OrderLine.UnitPrice.PriceFormatted & ")")
        Else
            'TODO: Add code here. Fires after the orderline has been rendered
            template.SetTag("Ecom:Order.OrderLine.AfterRenderTag", "AFTER THE ORDERLINE WAS RENDERED (" & OrderLine.Quantity & " x " & OrderLine.UnitPrice.PriceFormatted & ")")
        End If
    End Sub

End Class
Inheritance Hierarchy

System.Object
   Dynamicweb.Extensibility.TemplateExtender
      Dynamicweb.eCommerce.Orders.OrderLineTemplateExtender

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

OrderLineTemplateExtender Members
Dynamicweb.eCommerce.Orders Namespace

Send Feedback