public class TemplateExtender : Dynamicweb.eCommerce.Orders.OrderLineTemplateExtender { public override void ExtendTemplate(Dynamicweb.Templatev2.Template parmTemplate, Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState parmRenderingState) { if (parmRenderingState == Dynamicweb.eCommerce.Frontend.TemplateExtenderRenderingState.After) { UserSession _userSession = UserSession.Instance(); CITOrderLineFields.OrderLineFields _orderLineFields = new CITOrderLineFields.OrderLineFields(OrderLine.ID); _orderLineFields.Render(parmTemplate); if (parmTemplate.TagExists("CIT:Orderline.LineAmounts.DiscountPercent")) { string strProductType = CITBase.ConvFromDB.String(OrderLine.Product.ProductFieldValues.GetProductFieldValue("CITType").Value); if (strProductType != "GEN") { CITOrderAmount.OrderAmount _orderAmount = CITOrderAmount.OrderAmount.Instance(Order, _userSession.DataAreaId); LineAmounts _lineAmounts = null; if (!_orderAmount.orderlineAmountsCollection.TryGetValue(OrderLine.ID, out _lineAmounts)) { _lineAmounts = new LineAmounts(OrderLine.ProductNumber, _orderLineFields.ConfigId, CITToolsLindab.Tools.EcomProducts.GetOrderTotalQuantity(OrderLine.ProductID, _orderLineFields.ConfigId, Order.ID, _userSession.DataAreaId), OrderLine.Quantity); _lineAmounts.Fetch(); } CITExtenderLindab.Render.LineAmounts(parmTemplate, _lineAmounts); } } } } }