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