@inherits Dynamicweb.Rendering.RazorTemplateBase> @using Dynamicweb.Ecommerce.International @{ string lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; string showPricesWithVat = Pageview?.Area?.EcomPricesWithVat != null ? Pageview.Area.EcomPricesWithVat.ToLower() : "false"; bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); string paddingTop = "padding-top: 8px;"; string paddingBottom = "padding-bottom: 8px;"; string paddingLeft = "padding-left: 16px;"; string paddingRight = "padding-right: 16px;"; string borderTop = "border-top: 1px solid;"; string borderBottom = "border-bottom: 1px solid;"; string borderLeft = "border-left: 1px solid;"; string borderRight = "border-right: 1px solid;"; string textPrice = "font-variant-numeric: tabular-nums; white-space: nowrap;"; string verticalAlignTop = "vertical-align: top;"; string textRight = "text-align: right;"; string textLeft = "text-align: left;"; string fontBold = "font-weight: bold;"; string fontNormal = "font-weight: normal;"; string tableHeadingStyle1 = "font-weight: normal; text-align: left; border-top: 1px solid; border-right: 1px solid; border-left: 1px solid; padding-top: 8px; padding-right: 16px; padding-left: 16px;"; string tableHeadingStyle2 = "font-weight: normal; text-align: left; padding-top: 8px; padding-right: 16px; padding-bottom: 8px; padding-left: 16px;"; string tableCellStyle1 = "text-align: left; border-right: 1px solid; border-bottom: 1px solid; border-left: 1px solid; padding-right: 16px; padding-top: 8px; padding-left: 16px;"; string tableCellStyle2 = "text-align: right; padding-top: 8px; padding-right: 16px; padding-bottom: 8px; padding-left: 16px;"; string tableCellStyle3 = "vertical-align: top; padding-top: 8px; padding-right: 16px; padding-bottom: 8px; padding-left: 16px;"; bool isStandardSwiftTemplates = Pageview.AreaSettings.GetString("AddressFieldsBasedOn", "swift") == "swift"; } @if (!string.IsNullOrEmpty(GetString("Ecom:Order.Delivery.Email"))) { }
@Translate("Contact")
@GetString("Ecom:Order.Delivery.Email"), @if (!string.IsNullOrEmpty(GetString("Ecom:Order.Delivery.Phone"))) { @GetString("Ecom:Order.Delivery.Phone") }
@foreach (LoopItem orderline in GetLoop("OrderLines")) { string name = orderline.GetString("Ecom:Order:OrderLine.ProductName"); string image = $"Admin/Public/GetImage.ashx?image={Dynamicweb.Context.Current.Server.UrlEncode(orderline.GetString("Ecom:Product.PrimaryImage"))}&width=45&height=45"; var uri = Dynamicweb.Context.Current.Request.Url; var hostname = uri.Scheme + Uri.SchemeDelimiter + uri.Host; string imagePath = hostname + "/" + image; string priceTotalWithDiscounts = !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted")) ? orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted") : ""; string unitPrice = !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.UnitPrice.PriceFormatted")) ? orderline.GetString("Ecom:Order:OrderLine.UnitPrice.PriceFormatted") : ""; string discountPrice = !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.UnitPriceWithProductDiscount.PriceFormatted")) ? orderline.GetString("Ecom:Order:OrderLine.UnitPriceWithProductDiscount.PriceFormatted") : ""; string discountTotal = !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.TotalDiscount.PriceFormatted")) ? orderline.GetString("Ecom:Order:OrderLine.TotalDiscount.PriceFormatted") : ""; string variantText = orderline.GetString("Ecom:Order:OrderLine.ProductVariantText"); var quantity = orderline.GetDouble("Ecom:Order:OrderLine.Quantity"); bool isProductIdOrNumber = !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.ProductID")) || !string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.ProductNumber")); //Live Cart orderlines may not return ProductId. Manually entered products may not have ProductNumber bool isProduct = orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct") || (orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount") && isProductIdOrNumber); if (isProduct) { } }
@* Image *@ @name @* Title *@

@name

@* Variants *@

@variantText

@if (orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount")) { @* Free product notice *@

@Translate("Free product")

} else { @* Unit price *@ if (discountPrice == unitPrice) { @unitPrice } else { @discountPrice @unitPrice } }

@* Quantity *@

@Translate("Quantity"): @quantity

@* Total *@ @priceTotalWithDiscounts @if (orderline.GetDouble("Ecom:Order:OrderLine.TotalDiscount.Price.Value") != 0) { @discountTotal }
@{ double totalPriceWithoutOrderDiscountsFeesAndTaxesValue = GetDouble("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.Price.Value") + GetDouble("Ecom:Order.TotalProductDiscount.Price.Value"); Currency orderCurrency = Dynamicweb.Ecommerce.Services.Currencies.GetCurrency(GetString("Ecom:Order.Currency.Code")); string totalPriceWithoutOrderDiscountsFeesAndTaxes = Dynamicweb.Ecommerce.Services.Currencies.Format(orderCurrency, totalPriceWithoutOrderDiscountsFeesAndTaxesValue); } @* Subtotal *@
@Translate("Subtotal")
@totalPriceWithoutOrderDiscountsFeesAndTaxes @if (GetDouble("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.Price.Value") != totalPriceWithoutOrderDiscountsFeesAndTaxesValue) { @GetString("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.PriceFormatted") }
@if (!neverShowVat && showPricesWithVat == "false") {
@Translate("Excl. VAT")
} @if (!neverShowVat && showPricesWithVat == "true") {
@Translate("Incl. VAT")
}