Error executing template "Designs/Swift/eCom7/CartV2/Step/SR_InvoicesManagementCenterPayment.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_bd027fdc50634542a1ac7f695f6378a8.Execute() in F:\Domains\Sites\dev-swiftrizzo.mydwsite3.com\Files\Templates\Designs\Swift\eCom7\CartV2\Step\SR_InvoicesManagementCenterPayment.cshtml:line 138
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb 3 @using System.IO 4 @using Dynamicweb.Core 5 @using Dynamicweb.Ecommerce.Orders 6 @functions 7 { 8 private void SetDefaultMethods() 9 { 10 LoopItem shippingMethod = GetLoop("Shippingmethods").FirstOrDefault(); 11 if (shippingMethod == null || shippingMethod.GetString("Ecom:Cart.Shippingmethod.ID") == GetString("Ecom:Order.ShippingMethodID")) 12 { 13 return; 14 } 15 16 Order cart = Dynamicweb.Ecommerce.Services.Orders.GetById(GetString("Ecom:Order.ID")); 17 cart.ShippingMethodId = shippingMethod.GetString("Ecom:Cart.Shippingmethod.ID"); 18 cart.ShippingMethod = shippingMethod.GetString("Ecom:Cart.Shippingmethod.Name"); 19 20 // Set default payment based on shopping cart app if user did not selected one 21 if (Context.Current.Request["EcomCartPaymethodID"] == null) 22 { 23 LoopItem paymentMethod = GetLoop("Paymethods").FirstOrDefault(); 24 25 if (paymentMethod != null || paymentMethod.GetString("Ecom:Cart.Paymethod.ID") != GetString("Ecom:Order.ShippingMethodID")) 26 { 27 cart.PaymentMethodId = paymentMethod.GetString("Ecom:Cart.Paymethod.ID"); 28 cart.PaymentMethod = paymentMethod.GetString("Ecom:Cart.Paymethod.Name"); 29 } 30 } 31 32 Dynamicweb.Ecommerce.Services.Orders.Save(cart); 33 string redirect = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID); 34 Context.Current.Response.Redirect(redirect); 35 } 36 37 private void RedirectToCheckout(bool needsPayment) 38 { 39 if (!needsPayment) return; 40 41 List<LoopItem> payMethods = GetLoop("Paymethods"); 42 bool isSinglePayment = payMethods.Count == 1; 43 44 if (!isSinglePayment) return; 45 46 bool hasSavedCards = GetLoop("SavedCards").Any(); 47 48 if (hasSavedCards) return; 49 50 Order cart = Dynamicweb.Ecommerce.Services.Orders.GetById(GetString("Ecom:Order.ID")); 51 int nextStepIndex = cart.CartV2StepIndex + 1; 52 cart.PaymentMethodId = payMethods.FirstOrDefault().GetString("Ecom:Cart.Paymethod.ID"); 53 cart.PaymentMethod = payMethods.FirstOrDefault().GetString("Ecom:Cart.Paymethod.Name"); 54 Dynamicweb.Ecommerce.Services.Orders.Save(cart); 55 string redirect = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.Page.ID) + "?CartV2.GotoStep" + nextStepIndex + "=true"; 56 Context.Current.Response.Redirect(redirect); 57 } 58 } 59 @{ 60 SetDefaultMethods(); 61 bool needsPayment = GetDouble("Ecom:Order.OrderLines.TotalPriceWithoutSymbol") > 0; 62 RedirectToCheckout(needsPayment); 63 } 64 <div class="grid gap-0"> 65 <div class="cart g-col-12 g-col-lg-8 py-3 py-lg-5 pe-lg-5 order-last order-lg-first"> 66 <form name="ordersubmit" id="ordersubmit" method="post" autocomplete="off"> 67 68 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 69 @using Dynamicweb 70 @using System.IO 71 72 @{ 73 string logoLink = Pageview.CurrentParagraph?.Item["LogoLink"] != null ? Pageview.CurrentParagraph.Item["LogoLink"].ToString() : string.Empty; 74 75 string logoImage = Pageview.CurrentParagraph?.Item["Logo"] != null ? Pageview.CurrentParagraph.Item["Logo"].ToString() : string.Empty; 76 string title = Pageview.CurrentParagraph?.Item["Title"] != null ? Pageview.CurrentParagraph.Item["Title"].ToString() : Pageview.Area.Name; 77 78 string maxWidth = Pageview.CurrentParagraph?.Item["MaxWidth"] != null ? "max-width: " + Pageview.CurrentParagraph.Item["MaxWidth"].ToString() + "px" : string.Empty; 79 maxWidth = maxWidth == "max-width: 0px" ? string.Empty : maxWidth; 80 } 81 82 <div class="mb-4 text-center"> 83 @if (!string.IsNullOrWhiteSpace(logoLink)) 84 { 85 @:<a href="@logoLink" class="text-decoration-none" title="@Translate("Leave checkout")"> 86 } 87 88 @if (logoImage != "") 89 { 90 if (Path.GetExtension(logoImage).ToLower() == ".svg") 91 { 92 <div class="icon-auto" style="@maxWidth"> 93 @ReadFile(logoImage) 94 </div> 95 } 96 else 97 { 98 string imageWidth = Pageview.CurrentParagraph.Item["MaxWidth"] != null ? Pageview.CurrentParagraph.Item["MaxWidth"].ToString() : "400"; 99 string imagePath = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&image=" + logoImage; 100 101 <picture class="mx-auto d-block"> 102 <img src="@logoImage" alt="@title" style="@maxWidth"> 103 </picture> 104 } 105 } 106 else 107 { 108 <div class="fs-3 p-0">@title</div> 109 } 110 111 @if (!string.IsNullOrWhiteSpace(logoLink)) 112 { 113 @:</a> 114 } 115 </div> 116 117 118 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 119 @using Dynamicweb.Ecommerce.Orders 120 121 @if (GetLoop("ValidationErrors").Count() != 0) 122 { 123 <div class="alert alert-warning" role="alert"> 124 <ul class="m-0 list-unstyled"> 125 @foreach (LoopItem item in GetLoop("ValidationErrors")) 126 { 127 <li>@item.GetValue("Ecom:Cart.ValidationError.ErrorMessage")</li> 128 } 129 </ul> 130 </div> 131 } 132 133 134 @* Logic to remove the voucher code error, when going to next step in checkout *@ 135 @{ 136 string voucherCodeForErrorCheck = GetString("Ecom:Order.Customer.VoucherCode"); 137 Order orderForErrorCheck = new OrderService().GetById(GetString("Ecom:Order.ID")); 138 voucherCodeForErrorCheck = orderForErrorCheck.VoucherUseType == VoucherUseCategoryType.None ? string.Empty : voucherCodeForErrorCheck; 139 } 140 141 <input type="hidden" name="EcomOrderVoucherCode" value="@voucherCodeForErrorCheck"> 142 143 144 <div class="mt-4"> 145 @if (needsPayment) 146 { 147 <h3 class="fs-6 fw-normal mb-0">@Translate("Select payment")</h3> 148 <p class="fs-8 mb-3">@Translate("All transactions are encrypted")</p> 149 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 150 151 @{ 152 string paymentErrorMessage = GetString("Ecom:Cart.ValidationError.EcomCartPaymethodId.ErrorMessage"); 153 bool methodSelected = false; 154 <div class="list-group" id="PaymentMethodsGroup"> 155 @foreach (LoopItem method in GetLoop("Paymethods")) 156 { 157 if (method.GetBoolean("Ecom:Cart.Paymethod.IsSelected")) 158 { 159 methodSelected = true; 160 } 161 <label class="list-group-item list-group-item-action"> 162 <dl class="grid gap-1 gap-sm-3 mb-0"> 163 <dt class="g-col-8 g-col-sm-4 fw-normal"> 164 <div class="form-check"> 165 @{ 166 string paymentMethodId = GetString("Ecom:Order.PaymentMethodID"); 167 string paymentMethodIdSaved = method.GetString("Ecom:Cart.Paymethod.ID"); 168 } 169 <input class="form-check-input" type="radio" name="EcomCartPaymethodID" id="EcomCartPaymentmethodID_@method.GetString("Ecom:Cart.Paymethod.ID")" @if (String.Equals(paymentMethodId, paymentMethodIdSaved)) { <text> checked="checked" </text> } value="@method.GetString("Ecom:Cart.Paymethod.ID")" onchange="submitForm()"> 170 <span class="form-check-label">@method.GetString("Ecom:Cart.Paymethod.Name")</span> 171 </div> 172 </dt> 173 <dd class="g-col-12 g-col-sm-7 order-2 order-sm-1 mb-0"> 174 @{ 175 string imagePath = Dynamicweb.Context.Current.Server.MapPath(method.GetString("Ecom:Cart.Paymethod.Icon.Clean")); 176 177 if (File.Exists(imagePath)) 178 { 179 <span class="m-0 d-block" style="height: 1.5rem; width: 100%; background: url('@method.GetString("Ecom:Cart.Paymethod.Icon.Clean")') no-repeat left center; background-size: contain;"></span> 180 } 181 else 182 { 183 <span class="fs-8 lh-1">@method.GetString("Ecom:Cart.Paymethod.Description")</span> 184 } 185 } 186 187 </dd> 188 <dd class="g-col-4 g-col-sm-1 order-1 order-sm-2 mb-0 text-end"> 189 @if (!method.GetBoolean("Ecom:Cart.Paymethod.Price.IsZero")) 190 { 191 <span class="text-price">@method.GetString("Ecom:Cart.Paymethod.Price")</span> 192 } 193 </dd> 194 </dl> 195 </label> 196 } 197 @{ 198 if (!methodSelected) 199 { 200 //Enable the possibility to use validation if no default shipping method is selected 201 <input class="form-check-input d-none" type="radio" name="EcomCartPaymethodID" value="" checked="checked" /> 202 } 203 } 204 @paymentErrorMessage 205 </div> 206 207 LoopItem selectedPaymentMethodWithSavedCardSupport = GetLoop("Paymethods").FirstOrDefault(p => p.GetBoolean("Ecom:Cart.Paymethod.IsSelected") && p.GetBoolean("Ecom:Cart.Paymethod.SupportSavedCard") && Pageview.User != null); 208 if (selectedPaymentMethodWithSavedCardSupport != null) 209 { 210 bool cardIsSaved = !string.IsNullOrEmpty(GetString("Ecom:Order.SavedCardName")); 211 string cardIsSavedValue = cardIsSaved ? "true" : string.Empty; 212 string savedCardName = ""; 213 214 <div class="list-group" id="SavedCardsGroup"> 215 <h4 class="fs-6 fw-normal mb-0 mt-4">@Translate("Saved Cards")</h4> 216 <p class="fs-8 mb-3">@Translate("Pay with a saved card")</p> 217 218 @foreach (LoopItem card in GetLoop("SavedCards")) 219 { 220 savedCardName = !card.GetBoolean("Ecom:SavedCard.IsSelected") ? card.GetString("Ecom:SavedCard.Name") : savedCardName; 221 222 <label class="list-group-item list-group-item-action"> 223 <div class="form-check fw-normal"> 224 <input class="form-check-input" type="radio" name="EcomCartSavedCardID" id="EcomSavedCardID_@card.GetString("Ecom:SavedCard.ID")" value="@card.GetString("Ecom:SavedCard.ID")" checked="@card.GetBoolean("Ecom:SavedCard.IsSelected")" data-card-name="@card.GetString("Ecom:SavedCard.Name")" onchange="selectSavedCard(this)"> 225 <span class="form-check-label">@card.GetString("Ecom:SavedCard.Name")</span> 226 </div> 227 </label> 228 } 229 230 <label class="list-group-item list-group-item-action"> 231 <dl class="grid gap-0 gap-sm-3 align-items-center mb-0"> 232 <dt class="g-col-4 fw-normal"> 233 <div class="form-check"> 234 <input class="form-check-input" type="radio" name="EcomCartSavedCardID" id="SaveNewCard" value="" checked="@cardIsSavedValue" onchange="selectNewCard(this)"> 235 <span class="form-check-label fst-italic">@Translate("Save a new card")</span> 236 </div> 237 </dt> 238 <dd class="g-col-6 mb-0"> 239 <input type="checkbox" class="d-none" name="EcomOrderSavedCardCreate" id="EcomOrderSavedCardCreate" value="true" checked="@cardIsSavedValue"> 240 <input type="text" class="form-control" id="NewSavedCardName" value="@GetString("Ecom:Order.SavedCardName")" onchange="document.getElementById('MySavedCardName').value=this.value" placeholder="@Translate("New saved card name")"> 241 </dd> 242 </dl> 243 </label> 244 245 <input type="hidden" name="EcomOrderSavedCardName" id="MySavedCardName" value="@savedCardName" /> 246 </div> 247 } 248 } 249 250 <script> 251 function selectSavedCard(element) { 252 let cardName = element.getAttribute('data-card-name'); 253 254 resetRadioButton(element); 255 updateSavedCardName(cardName); 256 updateNewCardValue(false); 257 } 258 259 function selectNewCard(element) { 260 resetRadioButton(element); 261 updateSavedCardName(""); 262 updateNewCardValue(true); 263 } 264 265 function resetRadioButton(element) { 266 let radioList = document.querySelector("input[name='EcomCartSavedCardID']"); 267 for (let i = 0; i < radioList.length; i++) { 268 if (radioList[i].checked && radioList[i].id !== element.id) radioList[i].checked = false; 269 } 270 } 271 272 function updateSavedCardName(value) { 273 let savedCardNameField = document.querySelector("#MySavedCardName"); 274 if (savedCardNameField) { 275 savedCardNameField.value = value; 276 } 277 } 278 279 function updateNewCardValue(value) { 280 let newCardField = document.querySelector("#EcomOrderSavedCardCreate"); 281 if (newCardField) { 282 newCardField.checked = value; 283 } 284 } 285 </script> 286 </text> 287 } 288 else 289 { 290 string dummyPaymentId = Converter.ToString(Pageview.CurrentParagraph.Item["DummyPayment"]); 291 <div class="alert alert-success" role="alert"> 292 @Translate("Your order total is $ 0.00. Click 'Pay Now' button to confirm your payment.") 293 </div> 294 295 <input type="hidden" name="EcomCartPaymethodID" value="@dummyPaymentId"/> 296 } 297 </div> 298 299 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 300 301 @{ 302 string iconPathInvoiceManagementCenterStepsNavigation = "/Files/Templates/Designs/Swift/Assets/icons/"; 303 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Pageview.GlobalTags.GetTagByName("Global:LiveIntegration.IsWebServiceConnectionAvailable")?.Value ?? "true"); 304 string erpDownCartBehavior = Pageview.CurrentParagraph.Item["ErpDownCartBehavior"]?.ToString() ?? "none"; 305 306 <div class="mt-4 d-flex flex-column flex-md-row justify-content-end gap-3 mt-lg-4"> 307 <a href="@Pageview.CurrentParagraph.Item["InvoicesManagementCenterPageLink"]" class="btn btn-link link-secondary text-decoration-none order-last order-md-first"> 308 <div class="d-flex align-items-center justify-content-center position-relative"> 309 <span class="icon-2 me-1 position-absolute position-md-static start-0"> 310 @ReadFile(iconPathInvoiceManagementCenterStepsNavigation + "chevron-left.svg") 311 </span> 312 <span>@Translate("Back")</span> 313 </div> 314 </a> 315 316 @if (!(isErpConnectionDown && erpDownCartBehavior == "disable")) 317 { 318 <button type="submit" name="@GetString("CartV2.NextStepButtonName")" id="@GetString("CartV2.NextStepButtonName")" class="btn btn-primary order-first order-md-last"> 319 <div class="d-flex align-items-center justify-content-center position-relative"> 320 <span>@Translate("Pay now")</span> 321 <span class="icon-2 ms-1 position-absolute position-md-static end-0"> 322 @ReadFile(iconPathInvoiceManagementCenterStepsNavigation + "chevron-right.svg") 323 </span> 324 </div> 325 </button> 326 } 327 else 328 { 329 <button class="btn btn-primary pe-none disabled">@Translate("Payment is temporarily disabled")</button> 330 } 331 332 <script> 333 if ( window.history.replaceState ) { 334 window.history.replaceState( null, null, window.location.href ); 335 } 336 </script> 337 </div> 338 } 339 340 341 <input type="hidden" id="CurrentStep" /> 342 </form> 343 </div> 344 345 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 346 347 @if(GetString("Ecom:OrderContext.ID").Equals(Dna.PaymentLedgers.Constants.OrderContext)) 348 { 349 <text>@using Dynamicweb.Ecommerce.Orders 350 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 351 352 @functions 353 { 354 private class TypeTotal 355 { 356 public string Type { get; set; } 357 public string Currency { get; set; } 358 public double Amount { get; set; } 359 } 360 361 private static List<TypeTotal> SumTotals(IEnumerable<LoopItem> orderlines) 362 { 363 return orderlines.GroupBy(ol => ol.GetString("Ecom:Order:OrderLine.ProductName").ToLower(), 364 (k, total) => new TypeTotal() 365 { 366 Type = k, 367 Currency = total.FirstOrDefault().GetString("Ecom:Order:OrderLine.Price.Currency.Symbol"), 368 Amount = total.Sum(x => x.GetDouble("Ecom:Order:OrderLine.Price.Price.Value")) 369 }).ToList(); 370 } 371 372 private static string GetTotalValue(IEnumerable<TypeTotal> total, string type) 373 { 374 TypeTotal typeTotal = total.FirstOrDefault(t => t.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase)); 375 376 return typeTotal == null ? "" : $"{typeTotal.Currency} {typeTotal.Amount:0.00}"; 377 } 378 } 379 380 @{ 381 List<LoopItem> discounts = GetLoop("OrderLines").Where(o => o.GetBoolean("Ecom:Order:OrderLine.IsDiscount") && o.GetInteger("Ecom:Order:OrderLine.Type") == 1).ToList(); 382 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower(); 383 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 384 385 List<TypeTotal> totals = SumTotals(GetLoop("OrderLines").Where(o => o.GetInteger("Ecom:Order:OrderLine.Type") != (int)OrderLineType.Tax).ToList()); 386 387 string summarySidebarClass = string.IsNullOrEmpty(GetString("Ecom:Order.Completed")) ? "g-col-12 g-col-lg-4 position-relative py-2 py-lg-5 ps-lg-5 border-start px-3 px-lg-0 mx-n3 mx-lg-0" : ""; 388 } 389 390 <div class="summary-sidebar @summarySidebarClass" id="summarySidebar"> 391 <div class="position-relative"> 392 393 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 394 395 @{ 396 string iconPath = "/Files/Icons/"; 397 } 398 399 <button class="toggle-order-summary btn text-reset w-100 d-block d-lg-none px-0" type="button" data-bs-toggle="collapse" data-bs-target="#orderSummary" aria-expanded="false" aria-controls="orderSummary" id="OrderSummaryToggleButton"> 400 <span class="d-flex align-items-center justify-content-between"> 401 <span class="d-flex align-items-center gap-2"> 402 <span class="fs-7 lh-1"> 403 <span class="toggle-order-summary-text" id="OrderSummaryToggleButtonLabel">@Translate("Show order summary")</span> 404 </span> 405 <span class="icon-2" id="OrderSummaryToggleButtonIcon" style="transition: all 0.25s ease-in-out;"> 406 @ReadFile(iconPath + "chevron-down.svg") 407 </span> 408 </span> 409 <span class="fw-bold"> 410 <span class="text-price">@GetString("Ecom:Order.Price")</span> 411 </span> 412 </span> 413 </button> 414 415 <script> 416 const orderSummaryToggleButton = document.getElementById("OrderSummaryToggleButton"); 417 const orderSummaryToggleButtonLabel = document.getElementById("OrderSummaryToggleButtonLabel"); 418 const orderSummaryToggleButtonIcon = document.getElementById("OrderSummaryToggleButtonIcon"); 419 const orderSummaryToggleText = '@Translate("Show order summary")'; 420 421 orderSummaryToggleButton.addEventListener('click', function handleClick() { 422 if (orderSummaryToggleButtonLabel.textContent.toLowerCase().includes(orderSummaryToggleText.toLowerCase())) { 423 orderSummaryToggleButtonLabel.textContent = '@Translate("Hide order summary")'; 424 orderSummaryToggleButtonIcon.classList.add("rotate-180"); 425 } else { 426 orderSummaryToggleButtonLabel.textContent = orderSummaryToggleText; 427 orderSummaryToggleButtonIcon.classList.remove("rotate-180"); 428 } 429 }); 430 </script> 431 432 433 434 <div class="d-lg-block h-lg-auto visible-lg-visible pb-2 pb-md-0 collapse" id="orderSummary"> 435 <div class="d-flex flex-column gap-3 position-relative mb-2" id="orderSummaryList" style="overflow-x: hidden; overflow-y: hidden;"> 436 @foreach (LoopItem orderline in GetLoop("OrderLines")) { 437 string name = orderline.GetString("Ecom:Order:OrderLine.ProductName"); 438 string priceTotalWithDiscounts = orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted"); 439 string discountTotal = orderline.GetString("Ecom:Order:OrderLine.TotalDiscount.PriceFormatted"); 440 bool isProduct = orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct"); 441 442 if (isProduct) 443 { 444 <article class="grid grid-12"> 445 <div class="g-col-12"> 446 <div class="grid grid-12"> 447 <div class="g-col-6 grid grid-6 gap-0"> 448 <div class="g-col-6"> 449 @* Title *@ 450 <h3 class="h6 fs-7 mb-0">@name: @orderline.GetString("Ecom:Order:OrderLine.ProductNumber")</h3> 451 </div> 452 </div> 453 <div class="g-col-6 text-end"> 454 @* Total *@ 455 <span class="h6 mb-0 d-block fs-7"> 456 <span class="text-price">@priceTotalWithDiscounts</span> 457 </span> 458 @if (orderline.GetDouble("Ecom:Order:OrderLine.TotalDiscount.Price.Value") != 0) 459 { 460 <span class="m-0 d-block fs-8"> 461 <span class="text-price">@discountTotal</span> 462 </span> 463 } 464 </div> 465 </div> 466 </div> 467 </article> 468 } 469 } 470 <div class="btn btn-primary position-absolute bottom-0 mb-3 btn-sm d-none" style="width: auto; left: 50%; transform: translateX(-50%);" id="scrollToViewMoreButton">@Translate("Scroll to view more")</div> 471 </div> 472 473 <div id="orderSummaryFooter"> 474 @if (discounts.Any() || GetDouble("Ecom:Order.PaymentFee.Price.Value") != 0 || GetDouble("Ecom:Order.Taxes.Total.Price.Value") != 0) { 475 <div class="fs-8 pt-2 border-top"> 476 @* Discounts (only order discounts) *@ 477 @foreach (LoopItem orderline in discounts) 478 { 479 <div class="d-flex justify-content-between mb-2"><span>@orderline.GetString("Ecom:Order:OrderLine.ProductName")</span><span>@orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted")</span></div> 480 } 481 482 @* Payment *@ 483 @if (GetDouble("Ecom:Order.PaymentFee.Price.Value") != 0) 484 { 485 <div class="d-flex justify-content-between mb-2"> 486 <span>@Translate("Payment")</span> 487 <span class="text-price">@GetString("Ecom:Order.PaymentFee.PriceFormatted")</span> 488 </div> 489 } 490 491 @* Sales tax *@ 492 @if (!(showPricesWithVat == "false" && !neverShowVat)) 493 { 494 if (GetDouble("Ecom:Order.Taxes.Total.Price.Value") != 0) 495 { 496 <div class="d-flex justify-content-between mb-2"> 497 <span>@Translate("Sales tax")</span> 498 <span>@GetString("Ecom:Order.Taxes.Total.PriceFormatted")</span> 499 </div> 500 } 501 } 502 </div> 503 } 504 505 <div class="fs-8 pt-2 border-top"> 506 @if(!string.IsNullOrEmpty(GetTotalValue(totals, "Invoice"))) { 507 <div class="d-flex justify-content-between mb-2"> 508 <span>@Translate("Total of Invoices")</span> 509 <span class="text-price">@GetTotalValue(totals, "Invoice")</span> 510 </div> 511 } 512 513 @if(!string.IsNullOrEmpty(GetTotalValue(totals, "Proforma"))) { 514 <div class="d-flex justify-content-between mb-2"> 515 <span>@Translate("Total of Proforma")</span> 516 <span class="text-price">@GetTotalValue(totals, "Proforma")</span> 517 </div> 518 } 519 520 @if(!string.IsNullOrEmpty(GetTotalValue(totals, "Credit"))) { 521 <div class="d-flex justify-content-between mb-2"> 522 <span>@Translate("Total of Credit Memos")</span> 523 <span class="text-price">@GetTotalValue(totals, "Credit")</span> 524 </div> 525 } 526 527 @if(!string.IsNullOrEmpty(GetTotalValue(totals, "Discount"))) { 528 <div class="d-flex justify-content-between mb-2"> 529 <span>@Translate("Discounts")</span> 530 <span class="text-price">@GetTotalValue(totals, "Discount")</span> 531 </div> 532 } 533 534 @if(!string.IsNullOrEmpty(GetTotalValue(totals, "Discount"))) { 535 <div class="d-flex justify-content-between mb-2"> 536 <span>@Translate("Discounts")</span> 537 <span class="text-price">@GetTotalValue(totals, "Discount")</span> 538 </div> 539 } 540 </div> 541 542 <div class="fs-8 pt-3 border-top"> 543 <div class="d-flex justify-content-between mb-2 fs-6 fw-bold"><span>@Translate("Total")</span><span class="text-price fs-5">@GetString("Ecom:Order.Price.PriceFormatted")</span></div> 544 </div> 545 </div> 546 </div> 547 </div> 548 </div> 549 </text> 550 } 551 else 552 { 553 <div class="g-col-12 g-col-lg-4 py-2 p-3 p-lg-4 p-xl-5" id="summarySidebar"> 554 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 555 556 @{ 557 string iconPath = "/Files/Icons/"; 558 } 559 560 <button class="toggle-order-summary btn text-reset w-100 d-block d-lg-none px-0" type="button" data-bs-toggle="collapse" data-bs-target="#orderSummary" aria-expanded="false" aria-controls="orderSummary" id="OrderSummaryToggleButton"> 561 <span class="d-flex align-items-center justify-content-between"> 562 <span class="d-flex align-items-center gap-2"> 563 <span class="fs-7 lh-1"> 564 <span class="toggle-order-summary-text" id="OrderSummaryToggleButtonLabel">@Translate("Show order summary")</span> 565 </span> 566 <span class="icon-2" id="OrderSummaryToggleButtonIcon" style="transition: all 0.25s ease-in-out;"> 567 @ReadFile(iconPath + "chevron-down.svg") 568 </span> 569 </span> 570 <span class="fw-bold"> 571 <span class="text-price">@GetString("Ecom:Order.Price")</span> 572 </span> 573 </span> 574 </button> 575 576 <script> 577 const orderSummaryToggleButton = document.getElementById("OrderSummaryToggleButton"); 578 const orderSummaryToggleButtonLabel = document.getElementById("OrderSummaryToggleButtonLabel"); 579 const orderSummaryToggleButtonIcon = document.getElementById("OrderSummaryToggleButtonIcon"); 580 const orderSummaryToggleText = '@Translate("Show order summary")'; 581 582 orderSummaryToggleButton.addEventListener('click', function handleClick() { 583 if (orderSummaryToggleButtonLabel.textContent.toLowerCase().includes(orderSummaryToggleText.toLowerCase())) { 584 orderSummaryToggleButtonLabel.textContent = '@Translate("Hide order summary")'; 585 orderSummaryToggleButtonIcon.classList.add("rotate-180"); 586 } else { 587 orderSummaryToggleButtonLabel.textContent = orderSummaryToggleText; 588 orderSummaryToggleButtonIcon.classList.remove("rotate-180"); 589 } 590 }); 591 </script> 592 593 594 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 595 596 <div class="d-lg-block h-lg-auto collapse pt-2 pt-lg-0" id="orderSummary"> 597 <div class="d-flex flex-column gap-2 gap-lg-3 pb-2 pb-lg-3"> 598 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 599 @using Dynamicweb.Ecommerce.ProductCatalog 600 601 @functions { 602 private static string GetPrimaryImage(LoopItem orderline, string shopId) 603 { 604 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 605 bool isProduct = orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct") || (orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount") && isProductIdOrNumber); 606 string productId = orderline.GetString("Ecom:Order:OrderLine.ProductID"); 607 string variantId = orderline.GetString("Ecom:Order:OrderLine.ProductVariantID"); 608 609 if (!isProduct || string.IsNullOrEmpty(productId)) return ""; 610 611 ProductViewModelSettings productSetting = new ProductViewModelSettings 612 { 613 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 614 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 615 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 616 ShopId = shopId 617 }; 618 ProductViewModel product = ViewModelFactory.CreateView(productSetting, productId, variantId); 619 return product.DefaultImage.Value; 620 } 621 } 622 623 @{ 624 var orderlines = GetLoop("OrderLines"); 625 } 626 627 @for (int i = orderlines.Count - 1; i >= 0; i--) 628 { 629 var orderline = orderlines[i]; 630 string name = orderline.GetString("Ecom:Order:OrderLine.ProductName"); 631 string orderlineImage = GetPrimaryImage(orderline, GetString("Ecom:Order.ShopID")); 632 string image = $"/Admin/Public/GetImage.ashx?width=180&height=180&crop=5&fillcanvas=true&Background=ffffff&image={Dynamicweb.Context.Current.Server.UrlEncode(orderlineImage)}&format=webp"; 633 image = !orderlineImage.StartsWith("/Files/", StringComparison.OrdinalIgnoreCase) ? orderlineImage : image; 634 string removeFromBasketLink = orderline.GetString("Ecom:Order:OrderLine.DeleteLink"); 635 string priceTotalWithDiscounts = orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted"); 636 string priceBefore = orderline.GetString("Ecom:Product.InformativePrice.PriceFormatted"); 637 string unitPrice = orderline.GetString("Ecom:Order:OrderLine.UnitPrice.PriceFormatted"); 638 string discountPrice = orderline.GetString("Ecom:Order:OrderLine.UnitPriceWithProductDiscount.PriceFormatted"); 639 string discountTotal = orderline.GetString("Ecom:Order:OrderLine.TotalDiscount.PriceFormatted"); 640 string variantText = orderline.GetString("Ecom:Order:OrderLine.ProductVariantText"); 641 var orderlineId = orderline.GetValue("Ecom:Order:OrderLine.Id"); 642 var quantity = orderline.GetDouble("Ecom:Order:OrderLine.Quantity"); 643 var unitName = orderline.GetString("Ecom:Order:OrderLine.UnitName"); 644 string primaryGroupId = orderline.GetString("Ecom:Order:OrderLine.PrimaryOrDefaultGroupId"); 645 string productId = orderline.GetString("Ecom:Order:OrderLine.ProductID"); 646 string variantId = orderline.GetString("Ecom:Order:OrderLine.ProductVariantID"); 647 648 string link = "Default.aspx?ID=" + GetPageIdByNavigationTag("Shop"); 649 link += $"&GroupID={primaryGroupId}"; 650 link += $"&ProductID={productId}"; 651 link += !string.IsNullOrEmpty(variantId) ? $"&VariantID={variantId}" : ""; 652 653 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 654 bool isProduct = orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct") || (orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount") && isProductIdOrNumber); 655 656 if (isProduct) 657 { 658 <article class="grid grid-12"> 659 660 <div class="g-col-2"> 661 <a href="@link" class="ratio ratio-1x1 d-block " title="@name"> 662 <img src="@image" style="object-fit: contain;" alt="@name"> 663 </a> 664 </div> 665 666 <div class="g-col-10"> 667 668 <div class="d-flex flex-column gap-1"> 669 @* Title *@ 670 <h3 class="h6 fs-7 m-0"> 671 <a href="@link" class="text-decoration-none" title="@name">@name</a> 672 </h3> 673 674 @* Variants *@ 675 @if (!string.IsNullOrEmpty(variantText)) 676 { 677 <p class="fs-8 m-0">@variantText</p> 678 } 679 680 @if (orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount")) 681 { 682 @* Free product notice *@ 683 <p class="fs-8 m-0">@Translate("Free product")</p> 684 } 685 else 686 { 687 @* Unit price *@ 688 <p class="fs-8 m-0"> 689 @if (!string.IsNullOrEmpty(unitName)) 690 { 691 <span>@unitName: </span> 692 } 693 @if (discountPrice == unitPrice) 694 { 695 <span class="text-price">@unitPrice</span> 696 } 697 else 698 { 699 <span class="text-price">@discountPrice</span> 700 <span class="text-decoration-line-through"> 701 <span class="text-price">@unitPrice</span> 702 </span> 703 } 704 </p> 705 } 706 <div class="d-flex flex-row justify-content-between"> 707 @* Quantity *@ 708 <span class="fs-8 d-block">@Translate("Qty"): @quantity</span> 709 710 <div class="text-end flex-fill"> 711 @* Total *@ 712 <span class="h6 d-block fs-7 m-0"> 713 <span class="text-price">@priceTotalWithDiscounts</span> 714 </span> 715 @if (orderline.GetDouble("Ecom:Order:OrderLine.TotalDiscount.Price.Value") != 0.0) 716 { 717 <span class="d-block fs-8"> 718 <span class="text-price">@discountTotal</span> 719 </span> 720 } 721 </div> 722 </div> 723 </div> 724 </div> 725 </article> 726 } 727 } 728 729 </div> 730 731 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 732 733 @{ 734 double totalPriceWithoutOrderDiscountsFeesAndTaxesValue = GetDouble("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.Price.Value") + GetDouble("Ecom:Order.TotalProductDiscount.Price.Value"); 735 var orderCurrency = Dynamicweb.Ecommerce.Services.Currencies.GetCurrency(GetString("Ecom:Order.Currency.Code")); 736 string totalPriceWithoutOrderDiscountsFeesAndTaxes = Dynamicweb.Ecommerce.Services.Currencies.Format(orderCurrency, totalPriceWithoutOrderDiscountsFeesAndTaxesValue); 737 738 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower(); 739 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 740 741 bool disableVouchers = Pageview.CurrentParagraph?.Item["DisableVouchers"] != null ? (Boolean)Pageview.CurrentParagraph.Item["DisableVouchers"] : false; 742 disableVouchers = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("CompletedOrderId")) ? true : disableVouchers; 743 744 <div class="d-flex flex-column gap-2 gap-lg-3 pb-3 bottom-0 sticky-receipt theme" id="orderSummaryFooter"> 745 746 @if (!disableVouchers && Pageview.CurrentParagraph?.Item.SystemName != "Swift_QuoteCheckoutApp") 747 { 748 <text> 749 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 750 @using Dynamicweb.Ecommerce.Orders 751 752 @{ 753 string voucherCode = GetString("Ecom:Order.Customer.VoucherCode"); 754 string voucherCodeError = GetString("Ecom:Cart.ValidationError.EcomOrderVoucherCode.ErrorMessage"); 755 string validState = string.Empty; 756 757 IEnumerable<string> voucherCodes = new List<string>(); 758 Order order = new OrderService().GetById(GetString("Ecom:Order.ID")); 759 760 if (!string.IsNullOrWhiteSpace(voucherCode)) 761 { 762 if (order.VoucherUseType.HasFlag(VoucherUseCategoryType.Discount)) 763 { 764 voucherCodes = voucherCode.Split(new string[] { ",", ";", " " }, StringSplitOptions.RemoveEmptyEntries); 765 } 766 else 767 { 768 voucherCodes = new string[] { voucherCode.Trim() }; 769 } 770 } 771 772 var voucherErrors = new List<string>(); 773 foreach (string code in voucherCodes) 774 { 775 Dynamicweb.Ecommerce.Orders.Vouchers.Voucher vouch = Dynamicweb.Ecommerce.Services.Vouchers.GetVoucherByCode(code); 776 if (vouch == null) 777 { 778 validState = "is-invalid"; 779 voucherErrors.Add(Translate("Voucher") + " <span class='fw-bold'>" + code + "</span> " + Translate("not found")); 780 continue; 781 } 782 if (vouch.DateUsed.HasValue) 783 { 784 validState = "is-invalid"; 785 voucherErrors.Add(Translate("Voucher") + " <span class='fw-bold'>" + code + "</span> " + Translate("already used")); 786 continue; 787 } 788 } 789 790 var voucherErrorMessage = string.Join(",", voucherErrors); 791 792 <div class="py-3 border-top" id="orderVoucherForm"> 793 <form method="post" id="VoucherForm"> 794 <div class="input-group input-primary-button-group has-validation"> 795 <input type="text" class="form-control @(validState)" name="EcomOrderVoucherCodeField" placeholder="@Translate("Add voucher here")" id="EcomOrderVoucherCodeField" value="" aria-label="@Translate("Voucher input")" oninput="document.querySelector('#EcomOrderVoucherCode').value = this.value;" onkeyup="document.querySelector('#EcomOrderVoucherCode').value = this.value;"> 796 <button class="btn btn-sm btn-primary d-inline-flex align-items-center justify-content-center" type="submit" id="EcomOrderVoucherApply" style="min-width: 100px;"> 797 <span>@Translate("Apply")</span> 798 </button> 799 800 <div class="invalid-feedback"> 801 @voucherErrorMessage 802 </div> 803 </div> 804 <input type="hidden" name="EcomOrderVoucherCode" id="EcomOrderVoucherCode" value="@voucherCode"> 805 <label for="EcomOrderVoucherCodeField" class="visually-hidden">@Translate("Add voucher here")</label> 806 </form> 807 808 @if (!string.IsNullOrWhiteSpace(voucherCode)) 809 { 810 <div class="d-flex flex-wrap gap-2 pt-3"> 811 812 @foreach (string code in voucherCodes) 813 { 814 <form method="post"> 815 @{ 816 Dynamicweb.Ecommerce.Orders.Vouchers.Voucher vouch = Dynamicweb.Ecommerce.Services.Vouchers.GetVoucherByCode(code); 817 string voucherValue = string.Empty; 818 if (vouch != null && !vouch.DateUsed.HasValue) { 819 voucherValue = voucherCode.Replace(code+",", "").Replace(","+code, "").Replace(code, ""); 820 } 821 <input type="hidden" name="EcomOrderVoucherCode" value="@voucherValue"> 822 } 823 <span class="badge fw-normal d-inline-flex align-items-center justify-content-center opacity-50 opacity-100-hover" style="background-color:var(--swift-foreground-color);color:var(--swift-background-color);"> 824 <span class="icon-2"> 825 @ReadFile("/Files/Templates/Designs/Swift/Assets/icons/tag.svg") 826 </span> 827 <span class="mx-2">@code</span> 828 <button type="submit" class="text-reset bg-transparent border-0 p-0" aria-label="@Translate("Remove voucher")" id="RemoveVoucherButton"> 829 <span class="icon-2"> 830 @ReadFile("/Files/Templates/Designs/Swift/Assets/icons/x.svg") 831 </span> 832 </button> 833 </span> 834 </form> 835 } 836 </div> 837 } 838 @voucherCodeError 839 </div> 840 } 841 842 </text> 843 } 844 845 <div class="fs-8 border-top pt-2 pt-lg-3"> 846 @* Subtotal *@ 847 <div class="d-flex justify-content-between fw-bold"> 848 <span>@Translate("Subtotal")</span> 849 <span class="text-end"> 850 <span class="d-block"> 851 @if (GetDouble("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.Price.Value") != totalPriceWithoutOrderDiscountsFeesAndTaxesValue) 852 { 853 <span class="text-price fw-normal text-decoration-line-through">@GetString("Ecom:Order.TotalPriceWithoutDiscountsFeesAndTaxes.PriceFormatted")</span> 854 } 855 <span class="text-price">@totalPriceWithoutOrderDiscountsFeesAndTaxes</span> 856 </span> 857 858 @if (!neverShowVat && showPricesWithVat == "false") 859 { 860 <span class="fs-8 fw-normal d-block">@Translate("Excl. VAT")</span> 861 } 862 else if (!neverShowVat) 863 { 864 <span class="fs-8 fw-normal d-block">@Translate("Incl. VAT")</span> 865 } 866 </span> 867 </div> 868 869 @* Discounts (only order discounts) *@ 870 @foreach (LoopItem orderline in GetLoop("OrderLines")) 871 { 872 bool isDiscount = orderline.GetBoolean("Ecom:Order:OrderLine.IsDiscount"); 873 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 874 bool isOrderAmountDiscount = orderline.GetInteger("Ecom:Order:OrderLine.Type") == 1 && !isProductIdOrNumber; 875 if (isDiscount && isOrderAmountDiscount) 876 { 877 <div class="d-flex justify-content-between"><span>@orderline.GetString("Ecom:Order:OrderLine.ProductName")</span><span class="text-price">@orderline.GetString("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceFormatted")</span></div> 878 } 879 } 880 881 @* Delivery *@ 882 @if (!string.IsNullOrEmpty(GetString("Ecom:Order.ShippingMethodID"))) 883 { 884 if (GetDouble("Ecom:Order.ShippingFee.Price.Value") != 0.0) 885 { 886 <div class="d-flex justify-content-between"> 887 <span>@Translate("Delivery")</span> 888 <span>@GetString("Ecom:Order.ShippingFee.PriceFormatted")</span> 889 </div> 890 } 891 } 892 else 893 { 894 <div class="d-flex justify-content-between"> 895 <span>@Translate("Delivery")</span> 896 <span>@Translate("Calculated in next step")</span> 897 </div> 898 } 899 900 @* Payment *@ 901 @if (!string.IsNullOrEmpty(GetString("Ecom:Order.PaymentMethodID"))) 902 { 903 if (GetDouble("Ecom:Order.PaymentFee.Price.Value") != 0) 904 { 905 <div class="d-flex justify-content-between"> 906 <span>@Translate("Payment")</span> 907 <span class="text-price">@GetString("Ecom:Order.PaymentFee.PriceFormatted")</span> 908 </div> 909 } 910 } 911 else 912 { 913 <div class="d-flex justify-content-between"> 914 <span>@Translate("Payment")</span> 915 <span>@Translate("Calculated in next step")</span> 916 </div> 917 } 918 919 @* Taxes *@ 920 @if (GetDouble("Ecom:Order.Taxes.Total.Price.Value") != 0) 921 { 922 <div class="d-flex justify-content-between mb-2"> 923 <span>@Translate("Sales tax")</span> 924 <span>@GetString("Ecom:Order.Taxes.Total.PriceFormatted")</span> 925 </div> 926 } 927 </div> 928 <div class="fs-8 border-top pt-2 pt-lg-3"> 929 <div class="d-flex justify-content-between fs-6 fw-bold"> 930 <span>@Translate("Total")</span> 931 @if (!neverShowVat && showPricesWithVat == "false") 932 { 933 <span class="text-price text-end"> 934 <span class="fs-5 d-block">@GetString("Ecom:Order.Price.PriceFormatted")</span> 935 <span class="fs-8 fw-normal d-block">@Translate("Excl. VAT")</span> 936 </span> 937 } 938 else if (!neverShowVat && showPricesWithVat == "true") 939 { 940 <span class="text-price text-end"> 941 <span class="fs-5 d-block">@GetString("Ecom:Order.Price.PriceFormatted")</span> 942 <span class="fs-8 fw-normal d-block">@Translate("Incl. VAT")</span> 943 </span> 944 } 945 else 946 { 947 <span class="text-price fs-5">@GetString("Ecom:Order.Price.PriceFormatted")</span> 948 } 949 </div> 950 951 @if (!neverShowVat) 952 { 953 <div class="d-flex justify-content-between"><span>@Translate("VAT")</span><span class="text-price">@GetString("Ecom:Order.Price.VATFormatted")</span></div> 954 if (showPricesWithVat == "false") 955 { 956 <div class="d-flex justify-content-between"><span>@Translate("Total incl. VAT")</span><span class="text-price">@GetString("Ecom:Order.OrderLines.Total.PriceWithVAT")</span></div> 957 } 958 } 959 960 @if (GetDouble("Ecom:Order.TotalDiscount.Price.Value") != 0) 961 { 962 <div class="d-flex justify-content-between"><span>@Translate("Discount")</span><span class="text-price">@GetString("Ecom:Order.TotalDiscount.PriceFormatted")</span></div> 963 } 964 </div> 965 </div> 966 } 967 968 </div> 969 970 </div> 971 } 972 973 974 </div> 975 976 <script> 977 function submitForm() { 978 document.querySelector("#CurrentStep").name = "@GetString("CartV2.CurrentStepButtonName")"; 979 swift.PageUpdater.Update(document.querySelector("#ordersubmit")); 980 } 981 </script> 982
By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing