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_b31402c6b7754a0e864948904138f1b8.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk-e5\Files\Templates\Designs\identity_v2\eCom7\CartV2\Step\espresso-cart.cshtml:line 46
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 bool showPrices = !isCustomerShop || (isCustomerShop && UserContext.Current.CustomerShop.Settings.ShowPrices == true);
47
48 string checkoutLink = $"{globalAreaName}/shop/cart/checkout";
49 if (Context.Cart != null)
50 {
51 order = Context.Cart;
52 }
53
54
55 ScriptService.Instance.AddScript("ecom.cart");
56
57 if (Context.Cart != null)
58 {
59 order = Context.Cart;
60 }
61
62 int orderlineCount = 1;
63
64 string relewiseShowRecommendations = PageView.Current().Area.Item["ShowRecommendations"]?.ToString();
65
66 }
67 <div class="row">
68 <div class="col-12 col-xl-10 mx-xl-auto">
69
70 <div class="e-cart js-e-cart" data-context="@(order != null ? order.OrderContextId : string.Empty)">
71 <div class="no-gutters row">
72 <div class="col-12 col-md-5 col-lg-5 mb-2 mb-md-0 order-last pl-md-3">
73
74 <div class="e-cart-aside js-e-cart-aside js-e-loading-wait ">
75 <div class="d-flex justify-content-between align-items-center mb-2"><h4 class="m-0 d-flex align-items-center"> </h4></div>
76 <div class="small py-2 py-lg-3 px-2 bg-light">
77
78 <div class="js-e-order-summary @(!SiteContext.ShowPrices() ? "d-none" : string.Empty)">
79 @if (isCustomerShop)
80 {
81 <div>
82 <script id="js-e-handlebars-tmpl-order-summary" type="text/x-handlebars-template">
83 <div class="row pt-0 mb-1 d-none d-lg-flex">
84 <div class="col-4">
85 <p class="mb-0 text-black">@Translate( "eCom Checkout - Subtotal - Text", "Subtotal" )</p>
86 </div>
87 <div class="col-8">
88 <p class="mb-0 text-right text-black">{{{cart.priceWithoutDiscountsFeesAndTaxes}}}</p>
89 </div>
90 </div>
91 <div class="row mb-1 d-none d-lg-flex">
92 <div class="col-6">
93 <p class="mb-0 text-black">@Translate( "eCom Checkout - Shipping - Text", "Shipping" )<br><span class="text-muted">({{cart.shippingmethod.name}})</span></p>
94 </div>
95 <div class="col-6">
96 <p class="mb-0 text-right text-black">{{{cart.shippingmethod.price}}}</p>
97 </div>
98 </div>
99 {{#if cart.discountPrice}}
100 <div class="row mb-1 d-none d-lg-flex">
101 <div class="col-6">
102 <p class="mb-0 text-black">@Translate( "eCom Checkout - Discount - Text", "Rabat" )</p>
103 </div>
104 <div class="col-6">
105 <p class="mb-0 text-right text-black">{{{cart.discountPrice}}}</p>
106 </div>
107 </div>
108 {{/if}}
109
110 {{#if cart.voucherMessages}}
111 <div class="row mb-1 d-none d-lg-flex">
112 <div class="col-12 text-danger">
113 {{#each cart.voucherMessages as |error|}}
114 <i class="material-icons">info</i> {{{error}}}
115 {{/each}}
116 </div>
117 </div>
118 {{/if}}
119
120 <hr class="border-black d-none d-lg-block">
121 <div class="row mb-1">
122 <div class="col-4">
123 <p class="h3 mb-0"> @Translate( "eCom Checkout - Total - Text", "Total" ) </p>
124 </div>
125 <div class="col-8">
126 <p class="h3 mb-0 text-right">{{{cart.price}}}</p>
127 </div>
128 </div>
129 <div class="row mb-1">
130 <div class="col-5">
131 <p class="mb-0 small font-weight-semibold"> @Translate( "eCom Checkout - Vat - Text", "Vat" ) </p>
132 </div>
133 <div class="col-7">
134 <p class="mb-0 text-right text-black">{{{cart.priceVAT}}}</p>
135 </div>
136 </div>
137 </script>
138 </div>
139
140 }
141 else
142 {
143 <div>
144 @using Co3.Espresso.Website.Models.FrontEnd.Settings
145 @using Co3.Espresso.Website.Services
146 <script id="js-e-handlebars-tmpl-order-summary" type="text/x-handlebars-template">
147 <div class="row pt-0 mb-1 d-none d-lg-flex">
148 <div class="col-5">
149 <p class="mb-0 text-black">@Translate( "eCom Checkout - Subtotal - Text", "Subtotal" )</p>
150 </div>
151 <div class="col-7">
152 <p class="mb-0 text-right text-black">{{{cart.priceWithoutDiscountsFeesAndTaxes}}}</p>
153 </div>
154 </div>
155 <div class="row mb-1 d-none d-lg-flex">
156 <div class="col-5">
157 <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>
158 </div>
159 <div class="col-7">
160 <p class="mb-0 text-right text-black">
161 {{#if cart.isExtranet}}
162 {{#if cart.feeShippingLimit.shippingLimitReached}}
163 @(Co3.Espresso.Website.Services.PriceService.Instance.GetPrice(new PriceSettings(){Value = 0}).Format())
164 {{else}}
165 {{#if cart.shippingmethod.isDropShipment}}
166 {{cart.shippingmethod.dropShipmentFallbackShippingText}}
167 {{else}}
168 {{cart.shippingmethod.name}}
169 {{/if}}
170 {{/if}}
171 {{else}}
172 {{{cart.shippingmethod.price}}}
173 {{/if}}
174 </p>
175 </div>
176 </div>
177 {{#if cart.isExtranet}}
178 <div class="row mb-1 d-none d-lg-flex">
179 <div class="col-5">
180 <p class="mb-0 text-black">
181 @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>
182 </p>
183 </div>
184 <div class="col-7">
185 <p class="mb-0 text-right text-black">
186 {{#if cart.feeShippingLimit.feeLimitReached}}
187 @(Co3.Espresso.Website.Services.PriceService.Instance.GetPrice(new PriceSettings(){Value = 0}).Format())
188 {{else}}
189 {{{cart.feeShippingLimit.fee}}}
190 {{/if}}
191 </p>
192 </div>
193 </div>
194 {{/if}}
195 {{#if cart.discountPrice}}
196 {{#compare cart.discountPriceClean '!==' cart.feeShippingLimit.feeClean}}
197 <!--
198 <div class="row mb-1 d-none d-lg-flex">
199 <div class="col-5">
200 <p class="mb-0 text-black">@Translate( "eCom Checkout - Discount - Text", "Rabat" )</p>
201 </div>
202 <div class="col-7">
203 <p class="mb-0 text-right text-black">{{{cart.discountPrice}}}</P>
204 </div>
205 </div>
206 -->
207 {{/compare}}
208 {{/if}}
209
210 {{#if cart.voucherMessages}}
211 <div class="row mb-1 d-none d-lg-flex">
212 <div class="col-12 text-danger">
213 {{#each cart.voucherMessages as |error|}}
214 <i class="material-icons">info</i> {{{error}}}
215 {{/each}}
216 </div>
217 </div>
218 {{/if}}
219 {{#if cart.feeShippingLimit.show}}
220 <div class="row">
221 <div class="col-12">
222 <div id="free-shipping-bar" class="free-shipping-bar--container">
223 <div class="free-shipping-bar">
224 <div class="free-shipping-bar--progress">
225 <div class="free-shipping-bar--label position-top align-left"></div>
226
227
228 <!-- FEE -->
229 {{#if cart.feeShippingLimit.hasFeeLimit}}
230 <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>
231 <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>
232 <div class="free-shipping-bar--pipe" style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;"></div>
233 <div class="free-shipping-bar--arrow " style="left: {{ cart.feeShippingLimit.feeLimitCalculated }}%;"></div>
234 {{/if}}
235
236 {{#if cart.feeShippingLimit.hasShipping}}
237 <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>
238 <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>
239
240 {{/if}}
241
242 <div class="free-shipping-bar--line" style="width: {{ cart.feeShippingLimit.currentValueCalculated }}%;"></div>
243 <div class="free-shipping-bar--mask js-free-shipping-bar--mask"></div>
244 <div class="free-shipping-bar--current" style="left: {{ cart.feeShippingLimit.currentValueCalculated }}%;"></div>
245
246 {{#if cart.feeShippingLimit.hasShipping}}
247 {{#compare cart.feeShippingLimit.shippingLimitCalculated '<' 100}}
248 <div class="free-shipping-bar--pipe" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;"></div>
249 <div class="free-shipping-bar--arrow" style="left: {{ cart.feeShippingLimit.shippingLimitCalculated }}%;"></div>
250 {{/compare}}
251 {{/if}}
252
253 <div class="free-shipping-bar--label position-top align-right" style="left: 100%;">+</div>
254 </div>
255 </div>
256 </div>
257 </div>
258 {{#if cart.feeShippingLimit.hasShipping}}
259 <div class="col-12">
260 {{#if cart.feeShippingLimit.shippingLimitReached}}
261 <p class="small mt-2 mb-0">
262 @Translate("Free Fee And Shipping Bar - Shipping Bottom Text - Reached", "Du har opnået fri levering")
263 </p>
264 {{else}}
265 <p class="small mt-2 mb-0">
266 @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>
267 {{/if}}
268 </div>
269 {{/if}}
270 </div>
271 {{/if}}
272
273 <hr class="border-black d-none d-lg-block">
274 <div class="row mb-1">
275 <div class="col-4">
276 <p class="h3 mb-0"> @Translate( "eCom Checkout - Total - Text", "Total" ) </p>
277 </div>
278 <div class="col-8">
279 <p class="h3 mb-0 text-right">{{{cart.price}}}</p>
280 </div>
281 </div>
282 <div class="row mb-1">
283 <div class="col-5">
284 <p class="mb-0 small font-weight-semibold"> @Translate( "eCom Checkout - Vat - Text", "Vat" ) </p>
285 </div>
286 <div class="col-7">
287 <p class="mb-0 text-right text-black">{{{cart.priceVAT}}}</p>
288 </div>
289 </div>
290 </script>
291 </div>
292
293 }
294
295 </div>
296
297 @inherits RazorTemplateBase< RazorTemplateModel< Template > >
298 @using System
299 @using System.Collections.Generic
300 @using System.Linq
301 @using Co3.Espresso.Website.Services
302 @using Co3.ID.Dw.Helpers
303 @using Dynamicweb.Ecommerce.Orders
304 @using Dynamicweb.Ecommerce.Orders.SalesDiscounts
305 @using Dynamicweb.Frontend
306 @using Dynamicweb.Rendering
307 @using Dynamicweb.Security.UserManagement
308
309 @inherits RazorTemplateBase< RazorTemplateModel< Template > >
310 @using System
311 @using System.Collections.Generic
312 @using System.Linq
313 @using Co3.Espresso.Website.Services
314 @using Co3.ID.Dw.Helpers
315 @using dwOrderService = Dynamicweb.Ecommerce.Orders
316 @using Dynamicweb.Ecommerce.Orders.SalesDiscounts
317 @using Dynamicweb.Frontend
318 @using Dynamicweb.Rendering
319 @using Dynamicweb.Security.UserManagement
320
321 @functions
322 {
323 List<string> GetVoucherMessages()
324 {
325 List<string> returnValue = new List<string>();
326
327 string voucherCode = GetString("Ecom:Order.Customer.VoucherCode");
328
329 if (!string.IsNullOrWhiteSpace(voucherCode))
330 {
331 dwOrderService.Order orderById = dwOrderService.Order.GetOrderById(GetString("Ecom:Order.ID"));
332
333 IEnumerable<string> codes = new List<string>();
334 bool vouchersAppliedAsDiscounts = false;
335
336 if (orderById.VoucherUseType.HasFlag(dwOrderService.VoucherUseCategoryType.Discount))
337 {
338 codes = voucherCode.Split(new string[] {",", ";", " "}, StringSplitOptions.RemoveEmptyEntries);
339 vouchersAppliedAsDiscounts = true;
340 }
341 else
342 {
343 codes = new string[] {voucherCode.Trim()};
344 }
345
346 if (vouchersAppliedAsDiscounts && codes.Count() == 1)
347 {
348 }
349 else
350 {
351 foreach (string code in codes)
352 {
353 Voucher vouch = Voucher.GetVoucherByCode(code);
354 if (vouch == null)
355 {
356 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("not found"));
357 continue;
358 }
359 if (vouch.DateUsed.HasValue)
360 {
361 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("already used"));
362 continue;
363 }
364
365 VoucherList voucherList = VoucherList.GetListById(vouch.ListId);
366 if (!voucherList.ListActive)
367 {
368 returnValue.Add(Translate("Voucher") + " <span class=font-weight-bold>" + code + "</span> " + Translate("is not active"));
369 continue;
370 }
371
372 }
373 }
374 }
375 return returnValue;
376 }
377 }
378
379
380 @{
381 ShopType shopContext = SiteContext.CurrentSiteContext();
382 bool isImpersonating = PageView.Current().User != null && PageView.Current().User.CurrentSecondaryUser != null;
383 List<string> voucherMessages = GetVoucherMessages();
384 }
385
386
387
388 @if ((shopContext == ShopType.B2C || (shopContext == ShopType.B2B && isImpersonating)) && string.IsNullOrEmpty(GetString("Ecom:Order.Completed")))
389 {
390 <form class="e-cart-voucher-form js-e-cart-voucher-form small" method="post">
391 <label class="form-control-label mr-1 d-none d-md-block" for="EcomOrderVoucherCode">
392 @Translate("eCom Cart - Voucher - Label", "Voucher code")
393 </label>
394 <div class="align-items-center row no-gutters">
395 <label class="form-control-label mr-1 d-block d-sm-none" for="EcomOrderVoucherCode">
396 @Translate("eCom Cart - Voucher - Label", "Voucher code")
397 </label>
398 <div class="col flex-grow-1">
399 <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")">
400 </div>
401 <div class="col flex-grow-0 pl-1">
402 <button class="btn btn-secondary btn-sm js-e-cart-update-btn" type="submit">@Translate("eCom Cart - Voucher apply - Button", "Apply")</button>
403 </div>
404 </div>
405
406
407 @foreach (string voucherMessage in voucherMessages)
408 {
409 <p class="small mt-1 text-danger"><i class="material-icons">error</i> @voucherMessage</p>
410 }
411 </form>
412 }
413
414
415 <div class="mb-0 mt-2 row">
416 <div class="col-12">
417 <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>
418 </div>
419 </div>
420
421
422
423 <div class="e-loading-overlay js-e-loading-overlay">
424 @RenderingService.Instance.PartialView("_partials/loading-spinner.cshtml")
425 </div>
426 </div>
427
428 @if (relewiseShowRecommendations == "True")
429 {
430 @RenderingService.Instance.PartialView("ecom7/cartv2/step/partials/relewise-cart-recommendations.cshtml")
431 }
432
433 </div>
434
435
436
437 </div>
438 <div class="col-12 col-md-7 col-lg-7">
439
440 <div class="e-cart-main js-e-cart-main js-e-loading-wait">
441 <div class="small">
442 <div class="d-flex justify-content-between align-items-center mb-2">
443 <h4 class="m-0 d-flex align-items-center">
444 @ImageService.Instance.GetSvgMarkup("/Files/Images/icons/outline/41-shopping/shopping-cart-4.svg")
445 <span class="js-e-cart-quantity"></span> @Translate("eCom Cart - Heading", "Items in your basket")
446 </h4>
447 <span class="small">
448 <a href="#" class="btn btn-sm btn-primary js-identity-clear-cart">@Translate("DownloadManager - Cart - RemoveAll", "Remove all")</a>
449 </span>
450 </div>
451
452 <div class="alert alert-danger js-identity-cart-stock-alert d-none">
453 <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>
454 </div>
455
456
457 <form action="" class="e-cart-form js-e-cart-form" method="post">
458 <input class="js-e-cart-form-cartcmd" name="CartCmd" type="hidden" value="updateorderlines">
459 <input class="js-e-cart-form-redirect" name="Redirect" type="hidden" value="false">
460 @if (order != null)
461 {
462 <div class="js-e-cart-orderlines py-2 py-lg-3 px-2 bg-light">
463 @using Co3.ID.Dw.Helpers
464
465 <script id="js-e-handlebars-tmpl-cart-orderlines" type="text/x-handlebars-template">
466 {{#unless cart.orderlines}}
467 <p class="my-2">@Translate( "eCom Checkout - Empty Cart - Text", "Your cart is empty, but it doesn’t have to be." )</p>
468 {{/unless}}
469 {{#each cart.orderlines}}
470
471 {{#unless customerShopRelatedProductId}}
472 <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}}">
473 <div class="row">
474
475 <div class="col-3 col-lg-2">
476 <p class="e-orderline-product-image">
477 <a href="{{product.link}}" tabindex="-1">
478 {{#if hasProductDesignerData}}
479 <span class="d-flex flex-wrap justify-content-start" style="gap:5px;">
480 {{#each productDesignerData.views}}
481 {{#if @@first}}
482 <span style="flex: 1 1 100%;">
483 <img class="img-fluid" src="{{image}}">
484 </span>
485 {{else}}
486 <span style="flex: 1 1 calc(33% - 5px);max-width: calc(33% - 5px);">
487 <img class="img-fluid" src="{{image}}">
488 </span>
489 {{/if}}
490 {{/each}}
491 </span>
492 {{else}}
493 <img alt="" class="img-fluid" src="{{{product.imagePrimary.small}}}">
494 {{/if}}
495 </a>
496 </p>
497 </div>
498
499 <div class="col-9 col-lg-10">
500 <div class="no-gutters row align-items-top">
501
502 <div class="col-12">
503 <p class="e-product-brand d-block mb-0 font-weight-bold text-black small">{{product.brandNameText}}</p>
504 </div>
505
506 <div class="col-8 col-md-8">
507 <p class="e-product-name mt-0 mb-1 ">
508 <a href="{{product.link}}" tabindex="-1">
509 {{product.number}} {{product.name}}
510 </a>
511 {{#if hasProductDesignerData}}
512 <div class="badge badge-primary p-0 overflow-hidden">
513 <span class="p-1 pr-0">Design: <strong>{{productDesignerData.title}}</strong></span>
514 <a href="#" class="badge badge-primary p-1 border-left rounded-0"><i class="material-icons">add</i> sizes</a>
515 </div>
516 {{/if}}
517 {{#hasRelatedProductOrderline @@root.cart.orderlines product.id}}
518 <span class="badge badge-dark ml-1">@Translate( "eCom Checkout - Orderline has related product - Text", "Transfer" )</span>
519 {{#each @@root.cart.orderlines as |relatedProductOrderLine|}}
520 {{#if relatedProductOrderLine.customerShopRelatedProductId}}
521 {{#compare relatedProductOrderLine.customerShopRelatedProductId '===' ../product.id}}
522 <input class="js-identity-orderline-related-id" type="hidden" value="{{relatedProductOrderLine.id}}" data-product-id="{{../product.id}}" />
523 {{/compare}}
524 {{/if}}
525 {{/each}}
526
527 {{/hasRelatedProductOrderline}}
528 </p>
529 {{#if overStock}}
530 <p class="mt-0 mb-1 text-danger small">
531 @Translate("eCom - Orderline - Stock Alert - Text 1", "Bestilling må ikke overstige lagerbeholdningen") ({{product.stockQuantity}})<br />
532 @Translate("eCom - Orderline - Stock Alert - Text 2", "Ændre venligst antallet for at gennemføre din bestilling")
533 </p>
534 {{/if}}
535
536 <p class="e-product-variant d-block mb-0">
537 @Translate( "eCom Checkout - Orderline color variant - Text", "Farve" ): {{product.colorVariantText}}
538 </p>
539 <p class="e-product-variant d-block mb-1">
540 @Translate( "eCom Checkout - Orderline size variant - Text", "Størrelse" ): {{product.sizeVariantText}}
541 </p>
542
543 </div>
544
545 <div class="col-4 col-md-4">
546 @if (SiteContext.ShowPrices())
547 {
548 <p class="e-orderline-product-price mb-0 text-right">
549 {{{unitPrice}}}
550 </p>
551 }
552
553
554 <div class="no-gutters row d-flex justify-content-end">
555 <div class="col-6 col-md-4 mt-2 d-flex justify-content-end">
556 <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}}">
557 <button class="btn btn-sm btn-tertiary js-e-orderline-update-btn d-none" tabindex="-1">@Translate( "eCom Checkout - Update orderline - Button", "Update" )</button>
558 </div>
559 </div>
560
561 </div>
562 {{#if showOrderLineComment}}
563
564 <div class="col-12">
565 <div class="form-group">
566 <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">
567 </div>
568 </div>
569
570
571 {{/if}}
572
573
574 <div class="col-12 col-md-12 order-md-2">
575 <p class="mb-1 small text-left">
576 <a class="btn btn-sm btn-tertiary js-e-orderline-delete-btn" href="{{product.link}}" tabindex="-1">
577 <i class="material-icons">close</i>
578 <small>@Translate( "eCom Checkout - Delete orderline - Button", "Remove" )</small>
579 </a>
580 </p>
581 </div>
582 </div>
583 </div>
584 </div>
585 </div>
586 {{/unless}}
587
588 {{/each}}
589
590
591 {{#each cart.discountOrderlines}}
592 {{#if isDiscount}}
593
594 {{#compare product.number '===' 'FEE'}}
595
596 {{#if priceClean}}
597 <div class="col-12">
598 <div class="alert alert-success m-0 d-flex justify-space-between">
599 <strong>{{product.name}}</strong>
600 <strong class="small">
601 {{{price}}}
602 </strong>
603 </div>
604 </div>
605 {{/if}}
606
607 {{else}}
608 {{#compare shopContext '===' 'B2C'}}
609 {{#compare name '!==' 'Dibs'}}
610 <div class="col-xs-12">
611 <div class="alert alert-success m-0 d-flex justify-space-between">
612 <strong>{{discount.description}}</strong>
613 <strong class="small">
614 {{{price}}}
615 </strong>
616 </div>
617 </div>
618 {{else}}
619 {{/compare}}
620 {{/compare}}
621
622 {{#compare shopContext '===' 'B2B'}}
623 {{#if @@root.cart.showPrices}}
624 <div class="col-12 mb-1">
625 <div class="alert alert-success m-0 d-flex justify-content-between">
626 <strong>{{name}}</strong>
627 <strong class="small">
628 {{{price}}}
629 </strong>
630 </div>
631 </div>
632 {{/if}}
633 {{/compare}}
634
635 {{/compare}}
636
637
638 {{/if}}
639 {{/each}}
640 </script>
641
642 </div>
643
644 }
645 </form>
646
647 <div class="e-loading-overlay js-e-loading-overlay">
648 @RenderingService.Instance.PartialView("_partials/loading-spinner.cshtml")
649 </div>
650 </div>
651
652 @*<div class="row">
653 <div class="col-6">
654 </div>
655 <div class="col-6 text-right">
656 <a class="arrow-right btn btn-success" href="@checkoutLink">@Translate( "eCom Checkout - Checkout - Button", "Checkout" )</a>
657 </div>
658 </div>*@
659
660 </div>
661
662 </div>
663
664
665
666 </div>
667 </div>
668 </div>
669 </div>
670
671
672
673 <script>
674 /* NEW GA4 */
675 dataLayer.push({ ecommerce: null } );
676 dataLayer.push({
677 event : "view_cart",
678 ecommerce: {
679 items: [
680 @foreach (OrderLine orderLine in order.OrderLines)
681 {
682 IdentityProduct orderlineEspressoProduct = null;
683 bool isDiscount = orderLine.IsDiscount();
684
685 if (isDiscount == false)
686 {
687 orderlineEspressoProduct = (IdentityProduct) ProductService.Instance.GetEspressoProduct(
688 new ProductSettings()
689 {
690 Id = orderLine.ProductId,
691 VariantId = orderLine.ProductVariantId,
692 PrimaryVariantId = orderLine.ProductVariantId,
693 EmbeddedInModelList = true
694 }
695 );
696
697 if (orderlineCount > 1)
698 {
699 @Raw(",")
700 }
701
702 <text>
703 {
704 item_id: "@orderlineEspressoProduct.Number",
705 item_name: "@orderlineEspressoProduct.Name",
706 price: @orderlineEspressoProduct.Price.Value.ToJavaScript().Replace(",", ""),
707 quantity: @orderLine.Quantity
708 }
709 </text>
710
711 orderlineCount++;
712 }
713 }
714 ]
715 }
716 });
717 </script>