Dynamicweb 8 Documentation
OrderLine Class
Members  Example 

Represents information about an order line.
Object Model
OrderLine ClassOrderLineCollection ClassOrderLine ClassOrder ClassOrderLineFieldValue ClassOrderLineFieldValueCollection ClassOrderLineFieldValue ClassPriceInfo ClassProduct ClassPriceInfo Class
Syntax
Example
class Renderer 
{
 
   public void RenderOrderLine( OrderLine orderLine, Rendering.Template template )
   {

      Template.SetTag("Ecom:Order:OrderLine.Quantity", OrderLine.Quantity);
      Template.SetTag("Ecom:Order:OrderLine.BOM", OrderLine.BOM.ToString);
      Template.SetTag("Ecom:Order:OrderLine.Date", OrderLine.Date);
      Template.SetTag("Ecom:Order:OrderLine.ID", OrderLine.ID);
      Template.SetTag("Ecom:Order:OrderLine.Modified", OrderLine.Modified);
      Template.SetTag("Ecom:Order:OrderLine.OrderID", OrderLine.OrderID);
      Template.SetTag("Ecom:Order:OrderLine.ParentLineID", OrderLine.ParentLineID);
      Template.SetTag("Ecom:Order:OrderLine.ProductID", OrderLine.ProductID);
      Template.SetTag("Ecom:Order:OrderLine.ProductName", OrderLine.ProductName);
      Template.SetTag("Ecom:Order:OrderLine.UnitName", VariantOption.Create(OrderLine.UnitID).Name);
      Template.SetTag("Ecom:Order:OrderLine.UnitID", OrderLine.UnitID);
      Template.SetTag("Ecom:Order:OrderLine.PageID", OrderLine.PageID);
      
      Template.SetTag("Ecom:Order:OrderLine.ProductLink.Fixed", "Default.aspx?ID=" + PageID + "&ProductID=" + OrderLine.ProductID + "&VariantID=" + OrderLine.ProductVariantID);
      Template.SetTag("Ecom:Order:OrderLine.ProductLink", OrderLine.Reference);
      Template.SetTag("Ecom:Order:OrderLine.IsProduct", Base.IIf(OrderLine.Type == Base.ChkString(Base.ChkInteger(OrderLine.OrderLineType.Fixed)) || OrderLine.Type == Base.ChkString(Base.ChkInteger(OrderLine.OrderLineType.Product)), "true", ""));

      Currency c = null;
      if (OrderLine.Price.Currency != null)
      {
          c = OrderLine.Price.Currency;
      }
      else
      {
          c = Context.Currency;
      }

      if (OrderLine.ProductName != null)
      {
      	   Template.SetTag("Ecom:Order:OrderLine.ProductName.Short", OrderLine.ProductName);
      }

      Prices.PriceInfo olPrice = OrderLine.Price;
      Prices.PriceInfo olUPrice = OrderLine.UnitPrice;

      Template.SetTag("Ecom:Order:OrderLine.ProductNumber", OrderLine.ProductNumber);
      Template.SetTag("Ecom:Order:OrderLine.ProductVariantID", OrderLine.ProductVariantID);
      Template.SetTag("Ecom:Order:OrderLine.ProductVariantText", OrderLine.ProductVariantText);
      Template.SetTag("Ecom:Order:OrderLine.Type", OrderLine.Type);
      Template.SetTag("Ecom:Order:OrderLine.UnitPriceWithoutSymbol", c.Format(olUPrice.Price, false));

      RenderOrderLines(OrderLine.BOMOrderLines, Template, "BOMItems") Template.SetTag("Ecom:Order:OrderLine.DecrementLink", "Default.aspx?CartCmd=DecOrderLine&key=" + OrderLine.ID + "");
      Template.SetTag("Ecom:Order:OrderLine.DeleteLink", "Default.aspx?CartCmd=DelOrderLine&key=" + OrderLine.ID + "");

      //Quantity input box 
      Template.SetTag("Ecom:Order:OrderLine.Quantity.Input.Name", string.Format("QuantityOrderLine{0}", OrderLine.ID));
      Template.SetTag("Ecom:Order:OrderLine.Quantity.Input.Box", string.Format("<input type=\"text\" size=\"4\" style=\"text-align:right;\" id=\"QuantityOrderLine{0}\" name=\"QuantityOrderLine{0}\" value=\"{1}\"@gt;", OrderLine.ID, OrderLine.Quantity));

      if (OrderLine.Product != null)
      {
         RenderProduct(OrderLine.Product, true, Template);
      }

      //OrderLineFields
      Rendering.Template orderLineFieldLoop = Template.GetLoop("Order.OrderLineFields");
      foreach (OrderLineFieldValue orderLineFieldValue in OrderLine.OrderLineFieldValues)
      {
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.Name", orderLineFieldValue.OrderLineFieldName)
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.SystemName", orderLineFieldValue.OrderLineFieldSystemName)
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.Value", Base.NewLineToBR(Base.ChkString(orderLineFieldValue.Value)))
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.Value.Clean", Base.ChkString(orderLineFieldValue.Value))
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.ValidationErrorMessage", orderLineFieldValue.ValidationErrorMessage)
         orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.InputTextField.Name", orderLineFieldValue.GetCartInputFieldName(OrderLine.ID))
     	 orderLineFieldLoop.SetTag("Ecom:Order:OrderLine.OrderLineField.InputTextField", string.Format("<input type=\"text\" name=\"{0}\" value=\"{1}\" size=\"{2}\" />", orderLineFieldValue.GetCartInputFieldName(OrderLine.ID), Base.HtmlEncode(orderLineFieldValue.Value), orderLineFieldValue.OrderLineFieldLength));
    	 orderLineFieldLoop.CommitLoop();
      }
   }
}
Inheritance Hierarchy

System.Object
   Dynamicweb.eCommerce.Orders.OrderLine

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

OrderLine Members
Dynamicweb.eCommerce.Orders Namespace

Send Feedback