Error executing template "Designs/identity_v2/eCom7/CartV2/Step/espresso-cart.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_0045b0c673f24ad3a1de0d4a39ca604f.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk-e5\Files\Templates\Designs\identity_v2\eCom7\CartV2\Step\espresso-cart.cshtml:line 47
   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 RazorTemplateBase< RazorTemplateModel< Template > > 2 @using System 3 @using System.Collections.Generic 4 @using System.Linq 5 @using System.Web.Mvc 6 @using Co3.Espresso.Base.Extensions 7 @using Co3.Espresso.Website.Models.FrontEnd 8 @using Co3.Espresso.Website.Services 9 @using Co3.ID.Dw.Helpers 10 @using Co3.ID.Dw.Models.Frontend.Users 11 @using Dynamicweb.Ecommerce.Common 12 @using Dynamicweb.Ecommerce.Orders 13 @using Dynamicweb.Ecommerce.Orders.SalesDiscounts 14 @using Dynamicweb.Environment.Web 15 @using Dynamicweb.Frontend 16 @using Dynamicweb.Rendering 17 @using Dynamicweb.Security.UserManagement 18 @using Co3.Espresso.Website.Models.FrontEnd.Settings 19 @using Order = Dynamicweb.Ecommerce.Orders.Order 20 @using OrderLine = Dynamicweb.Ecommerce.Orders.OrderLine 21 @using ProductService = Co3.Espresso.Website.Services.ProductService 22 @using Dynamicweb.Ecommerce.Common; 23 @using Co3.ID.Dw.Models.Frontend.Ecommerce 24 @using Co3.ID.Dw.Services 25 @using Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Extensions 26 @using RenderingService = Co3.Espresso.Website.Services.RenderingService 27 28 29 @{ 30 string globalAreaName = PageView.Current().Area.UrlName; 31 bool globalPrefix = PageView.Current().Area.UrlIgnoreForChildren; 32 if (globalPrefix == true) 33 { 34 globalAreaName = string.Empty; 35 } 36 37 Order order = null; 38 39 // TODO: We are having an issue with that DW is not recalculating the basket, fast or good enough... 40 if (Dynamicweb.Context.Current.Request.HttpMethod == "POST") 41 { 42 order = Context.Cart; 43 Dynamicweb.Ecommerce.Services.Orders.ForcePriceRecalculation(order); 44 } 45 bool isCustomerShop = (PageView.Current().Area.Item["IsCustomerShop"] != null && (bool)PageView.Current().Area.Item["IsCustomerShop"] == true); 46 string primaryProductDesignerPageId = PageView.Current().Area.Item["PrimaryProductDesignerPage"] != null ? PageView.Current().Area.Item["PrimaryProductDesignerPage"].ToString() : string.Empty; 47 bool showPrices = !isCustomerShop || (isCustomerShop && UserContext.Current.CustomerShop.Settings.ShowPrices == true); 48 49 string checkoutLink = $"{globalAreaName}/shop/cart/checkout"; 50 bool isProductDesignerOrder = false; 51 if (Context.Cart != null) 52 { 53 order = Context.Cart; 54 isProductDesignerOrder = order.ProductOrderLines.Any(ol => ol.GetOrderLineFieldValue("QuoteProductDesignerData") != null && 55 !string.IsNullOrEmpty(ol.GetOrderLineFieldValue("QuoteProductDesignerData").Value?.ToString())); 56 57 if(isProductDesignerOrder) 58 { 59 checkoutLink = $"{globalAreaName}/shop/designcart/checkout"; 60 } 61 62 } 63 64 65 ScriptService.Instance.AddScript("ecom.cart"); 66 67 if (Context.Cart != null) 68 { 69 order = Context.Cart; 70 } 71 72 int orderlineCount = 1; 73 74 string relewiseShowRecommendations = PageView.Current().Area.Item["ShowRecommendations"]?.ToString(); 75 76 } 77 78 <div class="row"> 79 <div class="col-12 col-xl-10 mx-xl-auto"> 80 81 <div class="e-cart js-e-cart" data-context="@(order != null ? order.OrderContextId : string.Empty)"> 82 <div class="no-gutters row"> 83 <div class="col-12 col-md-5 col-lg-5 mb-2 mb-md-0 order-last pl-md-3"> 84 85 <div class="e-cart-aside js-e-cart-aside js-e-loading-wait "> 86 <div class="d-flex justify-content-between align-items-center mb-2"><h4 class="m-0 d-flex align-items-center">&nbsp;</h4></div> 87 <div class="small py-2 py-lg-3 px-2 bg-light"> 88 89 <div class="js-e-order-summary @(!SiteContext.ShowPrices() ? "d-none" : string.Empty)"> 90 @if (isCustomerShop) 91 { 92 <div> 93 <script id="js-e-handlebars-tmpl-order-summary" type="text/x-handlebars-template"> 94 <div class="row pt-0 mb-1 d-none d-lg-flex"> 95 <div class="col-4"> 96 <p class="mb-0 text-black">@Translate( "eCom Checkout - Subtotal - Text", "Subtotal" )</p> 97 </div> 98 <div class="col-8"> 99 <p class="mb-0 text-right text-black">{{{cart.priceWithoutDiscountsFeesAndTaxes}}}</p> 100 </div> 101 </div> 102 <div class="row mb-1 d-none d-lg-flex"> 103 <div class="col-6"> 104 <p class="mb-0 text-black">@Translate( "eCom Checkout - Shipping - Text", "Shipping" )<br><span class="text-muted">({{cart.shippingmethod.name}})</span></p> 105 </div> 106 <div class="col-6"> 107 <p class="mb-0 text-right text-black">{{{cart.shippingmethod.price}}}</p> 108 </div> 109 </div> 110 {{#if cart.discountPrice}} 111 <div class="row mb-1 d-none d-lg-flex"> 112 <div class="col-6"> 113 <p class="mb-0 text-black">@Translate( "eCom Checkout - Discount - Text", "Rabat" )</p> 114 </div> 115 <div class="col-6"> 116 <p class="mb-0 text-right text-black">{{{cart.discountPrice}}}</p> 117 </div> 118 </div> 119 {{/if}} 120 121 {{#if cart.voucherMessages}} 122 <div class="row mb-1 d-none d-lg-flex"> 123 <div class="col-12 text-danger"> 124 {{#each cart.voucherMessages as |error|}} 125 <i class="material-icons">info</i> {{{error}}} 126 {{/each}} 127 </div> 128 </div> 129 {{/if}} 130 131 <hr class="border-black d-none d-lg-block"> 132 <div class="row mb-1"> 133 <div class="col-4"> 134 <p class="h3 mb-0"> @Translate( "eCom Checkout - Total - Text", "Total" ) </p> 135 </div> 136 <div class="col-8"> 137 <p class="h3 mb-0 text-right">{{{cart.price}}}</p> 138 </div> 139 </div> 140 <div class="row mb-1"> 141 <div class="col-5"> 142 <p class="mb-0 small font-weight-semibold"> @Translate( "eCom Checkout - Vat - Text", "Vat" ) </p> 143 </div> 144 <div class="col-7"> 145 <p class="mb-0 text-right text-black">{{{cart.priceVAT}}}</p> 146 </div> 147 </div> 148 </script> 149 </div> 150 } 151 else 152 { 153 <div> 154 @using Co3.Espresso.Website.Models.FrontEnd.Settings 155 @using Co3.Espresso.Website.Services 156 <script id="js-e-handlebars-tmpl-order-summary" type="text/x-handlebars-template"> 157 <div class="row pt-0 mb-1 d-none d-lg-flex"> 158 <div class="col-5"> 159 <p class="mb-0 text-black">@Translate( "eCom Checkout - Subtotal - Text", "Subtotal" )</p> 160 </div> 161 <div class="col-7"> 162 <p class="mb-0 text-right text-black">{{{cart.priceWithoutDiscountsFeesAndTaxes}}}</p> 163 </div> 164 </div> 165 <div class="row mb-1 d-none d-lg-flex"> 166 <div class="col-5"> 167 <p class="mb-0 text-black">@Translate( "eCom Checkout - Shipping - Text", "Shipping" ) {{#unless cart.isExtranet}}<br><span class="text-muted">({{cart.shippingmethod.name}})</span>{{else}}<i class="material-icons text-dark position-absolute" style="margin-left:3px;" data-toggle="tooltip" data-placement="top" title="@Translate( "eCom Checkout - Shipping - Info Text", "Levering info" )">help</i>{{/unless}}</p> 168 </div> 169 <div class="col-7"> 170 <p class="mb-0 text-right text-black"> 171 {{#if cart.isExtranet}} 172 {{#if cart.feeShippingLimit.shippingLimitReached}} 173 @(Co3.Espresso.Website.Services.PriceService.Instance.GetPrice(new PriceSettings(){Value = 0}).Format()) 174 {{else}} 175 {{#if cart.shippingmethod.isDropShipment}} 176 {{cart.shippingmethod.dropShipmentFallbackShippingText}} 177 {{else}} 178 {{cart.shippingmethod.name}} 179 {{/if}} 180 {{/if}} 181 {{else}} 182 {{{cart.shippingmethod.price}}} 183 {{/if}} 184 </p> 185 </div> 186 </div> 187 {{#if cart.isExtranet}} 188 <div class="row mb-1 d-none d-lg-flex"> 189 <div class="col-5"> 190 <p class="mb-0 text-black"> 191 @Translate( "eCom Checkout - Fee - Text", "Håndteringsgebyr" ) <i class="material-icons text-dark position-absolute" style="margin-left:3px;" data-toggle="tooltip" data-placement="top" title="@Translate( "eCom Checkout - Fee - Info Text", "Håndteringsgebyr info" )">help</i> 192 </p> 193 </div> 194 <div class="col-7"> 195 <p class="mb-0 text-right text-black"> 196 {{#if cart.feeShippingLimit.feeLimitReached}} 197 @(Co3.Espresso.Website.Services.PriceService.Instance.GetPrice(new PriceSettings(){Value = 0}).Format()) 198 {{else}} 199 {{{cart.feeShippingLimit.fee}}} 200 {{/if}} 201 </p> 202 </div> 203 </div> 204 {{/if}} 205 {{#if cart.discountPrice}} 206 {{#compare cart.discountPriceClean '!==' cart.feeShippingLimit.feeClean}} 207 <!-- 208 <div class="row mb-1 d-none d-lg-flex"> 209 <div class="col-5"> 210 <p class="mb-0 text-black">@Translate( "eCom Checkout - Discount - Text", "Rabat" )</p> 211 </div> 212 <div class="col-7"> 213 <p class="mb-0 text-right text-black">{{{cart.discountPrice}}}</P> 214 </div> 215 </div> 216 --> 217 {{/compare}} 218 {{/if}} 219 220 {{#if cart.voucherMessages}} 221 <div class="row mb-1 d-none d-lg-flex"> 222 <div class="col-12 text-danger"> 223 {{#each cart.voucherMessages as |error|}} 224 <i class="material-icons">info</i> {{{error}}} 225 {{/each}} 226 </div> 227 </div> 228 {{/if}} 229 {{#if cart.feeShippingLimit.show}} 230 <div class="row"> 231 <div class="col-12"> 232 <div id="free-shipping-bar" class="free-shipping-bar--container"> 233 <div class="free-shipping-bar"> 234 <div class="free-shipping-bar--progress"> 235 <div class="free-shipping-bar--label position-top align-left"></div> 236 237 238 <!-- FEE --> 239 {{#if cart.feeShippingLimit.hasFeeLimit}} 240 <div class="free-shipping-bar--label position-top {{#compare cart.feeShippingLimit.feeLimitCalculated '<' 12}}align-left{{/compare}}" style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;">{{{cart.feeShippingLimit.feeLabelTop}}}</div> 241 <div class="free-shipping-bar--label position-bottom {{#compare cart.feeShippingLimit.feeLimitCalculated '<' 12}}align-left{{/compare}}" style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;">{{#if cart.feeShippingLimit.feeLimitReached }}<i class="material-icons mr-1 color-green">check</i>{{/if}}{{ cart.feeShippingLimit.feeLabelBottom }}</div> 242 <div class="free-shipping-bar--pipe" style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;"></div> 243 <div class="free-shipping-bar--arrow " style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;"></div> 244 {{/if}} 245 246 {{#if cart.feeShippingLimit.hasShipping}} 247 <div class="free-shipping-bar--label position-top {{#compare cart.feeShippingLimit.shippingLimitCalculated '>' 80}}align-right{{/compare}}" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;">{{{cart.feeShippingLimit.shippingLabelTop}}}</div> 248 <div class="free-shipping-bar--label position-bottom {{#compare cart.feeShippingLimit.shippingLimitCalculated '>' 80}}align-right{{/compare}}" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;">{{#if cart.feeShippingLimit.shippingLimitReached }}<i class="material-icons mr-1 color-green">check</i>{{/if}}{{ cart.feeShippingLimit.shippingLabelBottom }}</div> 249 250 {{/if}} 251 252 <div class="free-shipping-bar--line" style="width: {{ cart.feeShippingLimit.currentValueCalculated }}%;"></div> 253 <div class="free-shipping-bar--mask js-free-shipping-bar--mask"></div> 254 <div class="free-shipping-bar--current" style="left: {{ cart.feeShippingLimit.currentValueCalculated }}%;"></div> 255 256 {{#if cart.feeShippingLimit.hasShipping}} 257 {{#compare cart.feeShippingLimit.shippingLimitCalculated '<' 100}} 258 <div class="free-shipping-bar--pipe" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;"></div> 259 <div class="free-shipping-bar--arrow" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;"></div> 260 {{/compare}} 261 {{/if}} 262 263 <div class="free-shipping-bar--label position-top align-right" style="left: 100%;">+</div> 264 </div> 265 </div> 266 </div> 267 </div> 268 {{#if cart.feeShippingLimit.hasShipping}} 269 <div class="col-12"> 270 {{#if cart.feeShippingLimit.shippingLimitReached}} 271 <p class="small mt-2 mb-0"> 272 @Translate("Free Fee And Shipping Bar - Shipping Bottom Text - Reached", "Du har opnået fri levering") 273 </p> 274 {{else}} 275 <p class="small mt-2 mb-0"> 276 @Translate("Free Fee And Shipping Bar - Shipping Bottom Text - 1", "Køb for") <strong>{{{cart.feeShippingLimit.shippingLimitMissing}}}</strong> @Translate("Free Fee And Shipping Bar - Shipping Bottom Text - 2", "mere og opnå fri levering")</p> 277 {{/if}} 278 </div> 279 {{/if}} 280 </div> 281 {{/if}} 282 283 <hr class="border-black d-none d-lg-block"> 284 <div class="row mb-1"> 285 <div class="col-4"> 286 <p class="h3 mb-0"> @Translate( "eCom Checkout - Total - Text", "Total" ) </p> 287 </div> 288 <div class="col-8"> 289 <p class="h3 mb-0 text-right">{{{cart.price}}}</p> 290 </div> 291 </div> 292 <div class="row mb-1"> 293 <div class="col-5"> 294 <p class="mb-0 small font-weight-semibold"> @Translate( "eCom Checkout - Vat - Text", "Vat" ) </p> 295 </div> 296 <div class="col-7"> 297 <p class="mb-0 text-right text-black">{{{cart.priceVAT}}}</p> 298 </div> 299 </div> 300 </script> 301 </div> 302 } 303 304 </div> 305 306 @inherits RazorTemplateBase< RazorTemplateModel< Template > > 307 @using System 308 @using System.Collections.Generic 309 @using System.Linq 310 @using Co3.Espresso.Website.Services 311 @using Co3.ID.Dw.Helpers 312 @using Dynamicweb.Ecommerce.Orders 313 @using Dynamicweb.Ecommerce.Orders.SalesDiscounts 314 @using Dynamicweb.Frontend 315 @using Dynamicweb.Rendering 316 @using Dynamicweb.Security.UserManagement 317 318 @inherits RazorTemplateBase< RazorTemplateModel< Template > > 319 @using System 320 @using System.Collections.Generic 321 @using System.Linq 322 @using Co3.Espresso.Website.Services 323 @using Co3.ID.Dw.Helpers 324 @using dwOrderService = Dynamicweb.Ecommerce.Orders 325 @using Dynamicweb.Ecommerce.Orders.SalesDiscounts 326 @using Dynamicweb.Frontend 327 @using Dynamicweb.Rendering 328 @using Dynamicweb.Security.UserManagement 329 330 @functions 331 { 332 List<string> GetVoucherMessages() 333 { 334 List<string> returnValue = new List<string>(); 335 336 string voucherCode = GetString("Ecom:Order.Customer.VoucherCode"); 337 338 if (!string.IsNullOrWhiteSpace(voucherCode)) 339 { 340 dwOrderService.Order orderById = dwOrderService.Order.GetOrderById(GetString("Ecom:Order.ID")); 341 342 IEnumerable<string> codes = new List<string>(); 343 bool vouchersAppliedAsDiscounts = false; 344 345 if (orderById.VoucherUseType.HasFlag(dwOrderService.VoucherUseCategoryType.Discount)) 346 { 347 codes = voucherCode.Split(new string[] {",", ";", " "}, StringSplitOptions.RemoveEmptyEntries); 348 vouchersAppliedAsDiscounts = true; 349 } 350 else 351 { 352 codes = new string[] {voucherCode.Trim()}; 353 } 354 355 if (vouchersAppliedAsDiscounts && codes.Count() == 1) 356 { 357 } 358 else 359 { 360 foreach (string code in codes) 361 { 362 Voucher vouch = Voucher.GetVoucherByCode(code); 363 if (vouch == null) 364 { 365 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("not found")); 366 continue; 367 } 368 if (vouch.DateUsed.HasValue) 369 { 370 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("already used")); 371 continue; 372 } 373 374 VoucherList voucherList = VoucherList.GetListById(vouch.ListId); 375 if (!voucherList.ListActive) 376 { 377 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("is not active")); 378 continue; 379 } 380 381 } 382 } 383 } 384 return returnValue; 385 } 386 } 387 388 389 @{ 390 ShopType shopContext = SiteContext.CurrentSiteContext(); 391 bool isImpersonating = PageView.Current().User != null && PageView.Current().User.CurrentSecondaryUser != null; 392 List<string> voucherMessages = GetVoucherMessages(); 393 } 394 395 396 397 @if ((shopContext == ShopType.B2C || (shopContext == ShopType.B2B && isImpersonating)) && string.IsNullOrEmpty(GetString("Ecom:Order.Completed"))) 398 { 399 <form class="e-cart-voucher-form js-e-cart-voucher-form small" method="post"> 400 <label class="form-control-label mr-1 d-none d-md-block" for="EcomOrderVoucherCode"> 401 @Translate("eCom Cart - Voucher - Label", "Voucher code") 402 </label> 403 <div class="align-items-center row no-gutters"> 404 <label class="form-control-label mr-1 d-block d-sm-none" for="EcomOrderVoucherCode"> 405 @Translate("eCom Cart - Voucher - Label", "Voucher code") 406 </label> 407 <div class="col flex-grow-1"> 408 <input class="form-control js-e-checkout-company" id="EcomOrderVoucherCode" name="EcomOrderVoucherCode" type="text" value="@GetString("Ecom:Order.Customer.VoucherCode")" placeholder="@Translate("eCom Cart - Voucher - Placeholder", "Voucher code")"> 409 </div> 410 <div class="col flex-grow-0 pl-1"> 411 <button class="btn btn-secondary btn-sm js-e-cart-update-btn" type="submit">@Translate("eCom Cart - Voucher apply - Button", "Apply")</button> 412 </div> 413 </div> 414 415 416 @foreach (string voucherMessage in voucherMessages) 417 { 418 <p class="small mt-1 text-danger"><i class="material-icons">error</i> @voucherMessage</p> 419 } 420 </form> 421 } 422 423 <div class="mb-0 mt-2 row"> 424 <div class="col-12"> 425 <a class="arrow-right btn btn-block btn-lg btn-success px-0 py-1 js-e-checkout-btn" href="@checkoutLink">@Translate("eCom Checkout - Checkout - Button", "Checkout")</a> 426 </div> 427 </div> 428 429 <div class="e-loading-overlay js-e-loading-overlay"> 430 @RenderingService.Instance.PartialView("_partials/loading-spinner.cshtml") 431 </div> 432 </div> 433 434 @if (relewiseShowRecommendations == "True") 435 { 436 @RenderingService.Instance.PartialView("ecom7/cartv2/step/partials/relewise-cart-recommendations.cshtml") 437 } 438 439 </div> 440 441 442 443 </div> 444 <div class="col-12 col-md-7 col-lg-7"> 445 446 <div class="e-cart-main js-e-cart-main js-e-loading-wait"> 447 <div class="small"> 448 <div class="d-flex justify-content-between align-items-center mb-2"> 449 <h4 class="m-0 d-flex align-items-center"> 450 @ImageService.Instance.GetSvgMarkup("/Files/Images/icons/outline/41-shopping/shopping-cart-4.svg")&nbsp;&nbsp; 451 <span class="js-e-cart-quantity"></span>&nbsp;@Translate("eCom Cart - Heading", "Items in your basket") 452 </h4> 453 <span class="small"> 454 <a href="#" class="btn btn-sm btn-primary js-identity-clear-cart">@Translate("DownloadManager - Cart - RemoveAll", "Remove all")</a> 455 </span> 456 </div> 457 458 <div class="alert alert-danger js-identity-cart-stock-alert d-none"> 459 <p class="m-0 text-center">@Translate("eCom - Cart - Stock Alert", "Der er produkter i din kurv, som vi desværre ikke har på lager")</p> 460 </div> 461 462 463 <form action="" class="e-cart-form js-e-cart-form" method="post"> 464 <input class="js-e-cart-form-cartcmd" name="CartCmd" type="hidden" value="updateorderlines"> 465 <input class="js-e-cart-form-redirect" name="Redirect" type="hidden" value="false"> 466 @if (order != null) 467 { 468 if (order.OrderContextId == Co3.ID.Data.App.Constants.DW_ECOMMERCE_ORDER_ORDERCONTEXTS_PRODUCTDESIGNER_ORDERCONTEXTID) 469 { 470 <div class="js-e-cart-orderlines py-2 py-lg-3 px-2 bg-light"> 471 @using Co3.ID.Dw.Helpers 472 @using Dynamicweb.Frontend 473 474 <script id="js-e-handlebars-tmpl-cart-orderlines" type="text/x-handlebars-template"> 475 {{#unless cart.orderlines}} 476 <p class="my-2">@Translate( "eCom Checkout - Empty Cart - Text", "Your cart is empty, but it doesn’t have to be." )</p> 477 {{/unless}} 478 {{#each cart.designProductorderLines as |orderLineGroup|}} 479 480 {{#unless orderLineGroup.0.customerShopRelatedProductId}} 481 <div class="e-orderline js-e-orderline pt-2 pb-1 {{#if orderLineGroup.0.overStock}}has-over-stock{{/if}}" id="{{orderLineGroup.0.id}}" data-is-designer="true" data-size-ids="{{#each orderLineGroup as |sizeOrderLine|}}{{sizeOrderLine.id}}{{#unless @@last}},{{/unless}}{{/each}}" data-product-id="{{orderLineGroup.0.product.id}}" data-product-name="{{orderLineGroup.0.product.name}}" data-product-number="{{orderLineGroup.0.product.number}}" data-variant-id="{{orderLineGroup.0.product.variantId}}"> 482 <div class="row"> 483 484 <div class="col-3 col-lg-2"> 485 <p class="e-orderline-product-image"> 486 <a href="{{orderLineGroup.0.product.link}}" tabindex="-1"> 487 <span class="d-flex flex-wrap justify-content-start" style="gap:5px;"> 488 {{#each orderLineGroup.0.productDesignerData.views}} 489 {{#if @@first}} 490 <span style="flex: 1 1 100%;"> 491 <img class="img-fluid" src="{{image}}"> 492 </span> 493 {{else}} 494 <span style="flex: 1 1 calc(33% - 5px);max-width: calc(33% - 5px);"> 495 <img class="img-fluid" src="{{image}}"> 496 </span> 497 {{/if}} 498 {{/each}} 499 </span> 500 </a> 501 </p> 502 </div> 503 504 <div class="col-9 col-lg-10"> 505 <div class="no-gutters row align-items-top"> 506 <div class="col-12"> 507 <p class="e-product-brand d-block mb-0 font-weight-bold text-black small">{{orderLineGroup.0.product.brandNameText}}</p> 508 </div> 509 510 <div class="col-8 col-md-8"> 511 <p class="e-product-name mt-0 mb-1 "> 512 <a href="{{orderLineGroup.0.product.link}}" tabindex="-1"> 513 {{orderLineGroup.0.product.number}} {{orderLineGroup.0.product.name}} 514 </a> 515 <div class="badge badge-primary p-0 overflow-hidden"> 516 <span class="p-1 pr-0">Design: <strong>{{orderLineGroup.0.productDesignerData.title}}</strong></span> 517 <a href="@(SearchEngineFriendlyURLs.GetFriendlyUrl($"Default.aspx?ID={primaryProductDesignerPageId}"))?OrderLineId={{orderLineGroup.0.id}}" class="badge badge-primary p-1 border-left rounded-0"> 518 <i class="material-icons">edit</i> 519 </a> 520 </div> 521 {{#hasRelatedProductOrderline @@root.cart.orderlines product.id}} 522 <span class="badge badge-dark ml-1">@Translate( "eCom Checkout - Orderline has related product - Text", "Transfer" )</span> 523 {{#each @@root.cart.orderlines as |relatedProductOrderLine|}} 524 {{#if relatedProductOrderLine.customerShopRelatedProductId}} 525 {{#compare relatedProductOrderLine.customerShopRelatedProductId '===' ../orderLineGroup.0.product.id}} 526 <input class="js-identity-orderline-related-id" type="hidden" value="{{relatedProductOrderLine.id}}" data-product-id="{{../orderLineGroup.0.product.id}}" /> 527 {{/compare}} 528 {{/if}} 529 {{/each}} 530 531 {{/hasRelatedProductOrderline}} 532 </p> 533 {{#if orderLineGroup.0.overStock}} 534 <p class="mt-0 mb-1 text-danger small"> 535 @Translate("eCom - Orderline - Stock Alert - Text 1", "Bestilling må ikke overstige lagerbeholdningen") ({{orderLineGroup.0.product.stockQuantity}})<br /> 536 @Translate("eCom - Orderline - Stock Alert - Text 2", "Ændre venligst antallet for at gennemføre din bestilling") 537 </p> 538 {{/if}} 539 540 <p class="e-product-variant d-block mb-0"> 541 @Translate( "eCom Checkout - Orderline color variant - Text", "Farve" ): {{orderLineGroup.0.product.colorVariantText}} 542 </p> 543 <div class="e-product-variant d-block mb-1"> 544 @Translate( "eCom Checkout - Orderline size variant - Text", "Størrelse" ): 545 {{#each orderLineGroup as |sizeOrderLine|}} 546 <div class="d-flex-inline flex-column small badge border"> 547 <input type="hidden" class="js-identity-orderline-designer-id" value="{{sizeOrderLine.id}}"> 548 <span class="font-weight-bold">{{sizeOrderLine.product.sizeVariantText}}</span> 549 <span>{{sizeOrderLine.quantity}}</span> 550 </div> 551 {{/each}} 552 553 <a href="#" class="badge badge-primary js-identity-productlist-get-variant-matrix-modal"><i class="material-icons">add</i> sizes</a> 554 </div> 555 556 </div> 557 558 <div class="col-4 col-md-4"> 559 @if (SiteContext.ShowPrices()) 560 { 561 <p class="e-orderline-product-price mb-0 text-right"> 562 {{{orderLineGroup.0.unitPrice}}} 563 </p> 564 } 565 566 567 568 569 </div> 570 {{#if orderLineGroup.0.showOrderLineComment}} 571 572 <div class="col-12"> 573 <div class="form-group"> 574 <input type="text" class="form-control js-e-orderline-comment-input" name="{{orderLineGroup.0.comment.inputFieldName}}" value="{{orderLineGroup.0.comment.value}}" placeholder="@(Translate("eCom Checkout - Orderline comment - Text", "Her indtastes dit navn, Rekv. nr. eller ligende"))" maxlength="255"> 575 </div> 576 </div> 577 578 579 {{/if}} 580 581 582 <div class="col-12 col-md-12 order-md-2"> 583 <p class="mb-1 small text-left"> 584 <a class="btn btn-sm btn-tertiary js-e-orderline-delete-btn" href="{{orderLineGroup.0.product.link}}" tabindex="-1"> 585 <i class="material-icons">close</i> 586 <small>@Translate( "eCom Checkout - Delete orderline - Button", "Remove" )</small> 587 </a> 588 </p> 589 </div> 590 </div> 591 </div> 592 </div> 593 </div> 594 {{/unless}} 595 596 {{/each}} 597 598 599 600 </script> 601 602 </div> 603 } 604 else 605 { 606 <div class="js-e-cart-orderlines py-2 py-lg-3 px-2 bg-light"> 607 @using Co3.ID.Dw.Helpers 608 609 <script id="js-e-handlebars-tmpl-cart-orderlines" type="text/x-handlebars-template"> 610 {{#unless cart.orderlines}} 611 <p class="my-2">@Translate( "eCom Checkout - Empty Cart - Text", "Your cart is empty, but it doesn’t have to be." )</p> 612 {{/unless}} 613 {{#each cart.orderlines}} 614 615 {{#unless customerShopRelatedProductId}} 616 <div class="e-orderline js-e-orderline pt-2 pb-1 {{#if overStock}}has-over-stock{{/if}}" id="{{id}}" data-product-id="{{product.id}}" data-product-name="{{product.name}}" data-product-number="{{product.number}}" data-product-price="{{unitPriceClean}}" data-product-quantity="{{quantity}}" data-product-variant-id="{{product.variantId}}" data-color-variant-text="{{product.colorVariantText}}" data-brand-code="{{product.brandCode}}" data-brand-name="{{product.brandName}}"> 617 <div class="row"> 618 619 <div class="col-3 col-lg-2"> 620 <p class="e-orderline-product-image"> 621 <a href="{{product.link}}" tabindex="-1"> 622 {{#if hasProductDesignerData}} 623 <span class="d-flex flex-wrap justify-content-start" style="gap:5px;"> 624 {{#each productDesignerData.views}} 625 {{#if @@first}} 626 <span style="flex: 1 1 100%;"> 627 <img class="img-fluid" src="{{image}}"> 628 </span> 629 {{else}} 630 <span style="flex: 1 1 calc(33% - 5px);max-width: calc(33% - 5px);"> 631 <img class="img-fluid" src="{{image}}"> 632 </span> 633 {{/if}} 634 {{/each}} 635 </span> 636 {{else}} 637 <img alt="" class="img-fluid" src="{{{product.imagePrimary.small}}}"> 638 {{/if}} 639 </a> 640 </p> 641 </div> 642 643 <div class="col-9 col-lg-10"> 644 <div class="no-gutters row align-items-top"> 645 646 <div class="col-12"> 647 <p class="e-product-brand d-block mb-0 font-weight-bold text-black small">{{product.brandNameText}}</p> 648 </div> 649 650 <div class="col-8 col-md-8"> 651 <p class="e-product-name mt-0 mb-1 "> 652 <a href="{{product.link}}" tabindex="-1"> 653 {{product.number}} {{product.name}} 654 </a> 655 {{#if hasProductDesignerData}} 656 <div class="badge badge-primary p-0 overflow-hidden"> 657 <span class="p-1 pr-0">Design: <strong>{{productDesignerData.title}}</strong></span> 658 <a href="#" class="badge badge-primary p-1 border-left rounded-0"><i class="material-icons">add</i> sizes</a> 659 </div> 660 {{/if}} 661 {{#hasRelatedProductOrderline @@root.cart.orderlines product.id}} 662 <span class="badge badge-dark ml-1">@Translate( "eCom Checkout - Orderline has related product - Text", "Transfer" )</span> 663 {{#each @@root.cart.orderlines as |relatedProductOrderLine|}} 664 {{#if relatedProductOrderLine.customerShopRelatedProductId}} 665 {{#compare relatedProductOrderLine.customerShopRelatedProductId '===' ../product.id}} 666 <input class="js-identity-orderline-related-id" type="hidden" value="{{relatedProductOrderLine.id}}" data-product-id="{{../product.id}}" /> 667 {{/compare}} 668 {{/if}} 669 {{/each}} 670 671 {{/hasRelatedProductOrderline}} 672 </p> 673 {{#if overStock}} 674 <p class="mt-0 mb-1 text-danger small"> 675 @Translate("eCom - Orderline - Stock Alert - Text 1", "Bestilling må ikke overstige lagerbeholdningen") ({{product.stockQuantity}})<br /> 676 @Translate("eCom - Orderline - Stock Alert - Text 2", "Ændre venligst antallet for at gennemføre din bestilling") 677 </p> 678 {{/if}} 679 680 <p class="e-product-variant d-block mb-0"> 681 @Translate( "eCom Checkout - Orderline color variant - Text", "Farve" ): {{product.colorVariantText}} 682 </p> 683 <p class="e-product-variant d-block mb-1"> 684 @Translate( "eCom Checkout - Orderline size variant - Text", "Størrelse" ): {{product.sizeVariantText}} 685 </p> 686 687 </div> 688 689 <div class="col-4 col-md-4"> 690 @if (SiteContext.ShowPrices()) 691 { 692 <p class="e-orderline-product-price mb-0 text-right"> 693 {{{unitPrice}}} 694 </p> 695 } 696 697 698 <div class="no-gutters row d-flex justify-content-end"> 699 <div class="col-6 col-md-4 mt-2 d-flex justify-content-end"> 700 <input class="form-control js-e-orderline-quantity-input e-orderline-quantity-input text-center" data-rule-digits="true" data-rule-min="0" max="{{product.stockQuantity}}" name="QuantityOrderLine{{id}}" type="text" value="{{quantity}}"> 701 <button class="btn btn-sm btn-tertiary js-e-orderline-update-btn d-none" tabindex="-1">@Translate( "eCom Checkout - Update orderline - Button", "Update" )</button> 702 </div> 703 </div> 704 705 </div> 706 {{#if showOrderLineComment}} 707 708 <div class="col-12"> 709 <div class="form-group"> 710 <input type="text" class="form-control js-e-orderline-comment-input" name="{{comment.inputFieldName}}" value="{{comment.value}}" placeholder="@(Translate("eCom Checkout - Orderline comment - Text", "Her indtastes dit navn, Rekv. nr. eller ligende"))" maxlength="255"> 711 </div> 712 </div> 713 714 715 {{/if}} 716 717 718 <div class="col-12 col-md-12 order-md-2"> 719 <p class="mb-1 small text-left"> 720 <a class="btn btn-sm btn-tertiary js-e-orderline-delete-btn" href="{{product.link}}" tabindex="-1"> 721 <i class="material-icons">close</i> 722 <small>@Translate( "eCom Checkout - Delete orderline - Button", "Remove" )</small> 723 </a> 724 </p> 725 </div> 726 </div> 727 </div> 728 </div> 729 </div> 730 {{/unless}} 731 732 {{/each}} 733 734 735 {{#each cart.discountOrderlines}} 736 {{#if isDiscount}} 737 738 {{#compare product.number '===' 'FEE'}} 739 740 {{#if priceClean}} 741 <div class="col-12"> 742 <div class="alert alert-success m-0 d-flex justify-space-between"> 743 <strong>{{product.name}}</strong> 744 <strong class="small"> 745 {{{price}}} 746 </strong> 747 </div> 748 </div> 749 {{/if}} 750 751 {{else}} 752 {{#compare shopContext '===' 'B2C'}} 753 {{#compare name '!==' 'Dibs'}} 754 <div class="col-xs-12"> 755 <div class="alert alert-success m-0 d-flex justify-space-between"> 756 <strong>{{discount.description}}</strong> 757 <strong class="small"> 758 {{{price}}} 759 </strong> 760 </div> 761 </div> 762 {{else}} 763 {{/compare}} 764 {{/compare}} 765 766 {{#compare shopContext '===' 'B2B'}} 767 {{#if @@root.cart.showPrices}} 768 <div class="col-12 mb-1"> 769 <div class="alert alert-success m-0 d-flex justify-content-between"> 770 <strong>{{name}}</strong> 771 <strong class="small"> 772 {{{price}}} 773 </strong> 774 </div> 775 </div> 776 {{/if}} 777 {{/compare}} 778 779 {{/compare}} 780 781 782 {{/if}} 783 {{/each}} 784 </script> 785 786 </div> 787 } 788 789 } 790 </form> 791 792 <div class="e-loading-overlay js-e-loading-overlay"> 793 @RenderingService.Instance.PartialView("_partials/loading-spinner.cshtml") 794 </div> 795 </div> 796 797 @*<div class="row"> 798 <div class="col-6"> 799 </div> 800 <div class="col-6 text-right"> 801 <a class="arrow-right btn btn-success" href="@checkoutLink">@Translate( "eCom Checkout - Checkout - Button", "Checkout" )</a> 802 </div> 803 </div>*@ 804 805 </div> 806 807 </div> 808 809 810 811 </div> 812 </div> 813 </div> 814 </div> 815 816 817 818 <script> 819 /* NEW GA4 */ 820 dataLayer.push({ ecommerce: null } ); 821 dataLayer.push({ 822 event : "view_cart", 823 ecommerce: { 824 items: [ 825 @foreach (OrderLine orderLine in order.OrderLines) 826 { 827 IdentityProduct orderlineEspressoProduct = null; 828 bool isDiscount = orderLine.IsDiscount(); 829 830 if (isDiscount == false) 831 { 832 orderlineEspressoProduct = (IdentityProduct) ProductService.Instance.GetEspressoProduct( 833 new ProductSettings() 834 { 835 Id = orderLine.ProductId, 836 VariantId = orderLine.ProductVariantId, 837 PrimaryVariantId = orderLine.ProductVariantId, 838 EmbeddedInModelList = true 839 } 840 ); 841 842 if (orderlineCount > 1) 843 { 844 @Raw(",") 845 } 846 847 <text> 848 { 849 item_id: "@orderlineEspressoProduct.Number", 850 item_name: "@orderlineEspressoProduct.Name", 851 price: @orderlineEspressoProduct.Price.Value.ToJavaScript().Replace(",", ""), 852 quantity: @orderLine.Quantity 853 } 854 </text> 855 856 orderlineCount++; 857 } 858 } 859 ] 860 } 861 }); 862 </script>
keyboard_arrow_up