Exception in template (Designs/Plus/_parsed/Dw_AddToBasketOverlay.parsed.cshtml): System.NullReferenceException: Objektreferencen er ikke indstillet til en forekomst af et objekt.
ved CompiledRazorTemplates.Dynamic.cceafafeefdfed.Execute()
ved RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
ved RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
ved RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
ved RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
ved Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using Dynamicweb.Ecommerce.Orders @using Dynamicweb.Ecommerce.Common @using Dynamicweb.Ecommerce @using System.Web; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ string basketLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + GetString("Item.Area.CartPageId")); string hidePrices = Pageview.Area.Item["Hide_Prices"].ToString(); var prods = HttpContext.Current.Request.QueryString["products"].Split(',').ToList(); var quantities = HttpContext.Current.Request.QueryString["quantities"].Split(',').ToList(); Order cart; if (Dynamicweb.Ecommerce.Common.Context.Cart != null) { cart = Dynamicweb.Ecommerce.Common.Context.Cart; } else { cart = new Order(); Dynamicweb.Ecommerce.Common.Context.SetCart(cart); } for (int i = 0; i < prods.Count; i++) { var builderConfig = new OrderLineBuilderConfig { ProductId = prods[i], Quantity = double.Parse(quantities[i]), AddToCart = true }; cart.OrderLineBuilder(builderConfig); cart.CalculateDiscounts(); cart.Save(); } double totalAddedPrice = 0; } <!--Her skal være noget AJAX til at opdater kurv i header--> <section class="overlay-products-added"> <header class="overlay-products-added__header"> <h3 class="heading heading--fw-element">@Translate("Følgende er tilføjet til indkøbslisten", "Følgende er tilføjet til indkøbslisten")</h3> </header> <table class="products-table"> <thead> <tr class="products-table__row products-table__row--head"> <th class="products-table__cell products-table__cell--amount">@Translate("Antal", "Antal")</th> <th class="products-table__cell products-table__cell--product">@Translate("Produkter", "Produkter")</th> @if (hidePrices == "False") { <th class="products-table__cell products-table__cell--price">@Translate("Vejledende priser fra", "Vejledende priser fra")</th> } </tr> </thead> <tbody> @for (int i = 0; i < prods.Count; i++) { var prod = Dynamicweb.Ecommerce.Products.Product.GetProductById(prods[i]); totalAddedPrice += (prod.Price.PriceWithoutVAT * double.Parse(quantities[i])); <tr class="products-table__row"> <td class="products-table__cell products-table__cell--amount" data-header="Antal">@quantities[i] @Translate("stk.", "stk.")</td> <td class="products-table__cell products-table__cell--product">@prod.Name</td> @if (hidePrices == "False") { <td class="products-table__cell products-table__cell--price"> <div class="price price--products-table"> <span class="price__unit">@Translate("DKK", "DKK")</span> <span class="price__price">@prod.Price.PriceWithoutVATFormattedNoSymbol</span> </div> </td> } </tr> } @if (hidePrices == "False") { <tr class="products-table__row products-table__row--sum"> <td class="products-table__cell products-table__cell--sum" colspan="3"> <div class="price price--products-table-sum"> <div class="price__header">@Translate("I alt", "I alt")</div> <span class="price__unit">@Translate("DKK", "DKK")</span> <span class="price__price">@Math.Round(totalAddedPrice, 2)</span> </div> </td> </tr> } </tbody> </table> <div class="overlay-products-added__buttons"> <a class="button button--overlay-products-added" href="@basketLink" title="" property="url"> <span class="button__text">@Translate("Gå til indkøbslisten", "Gå til indkøbslisten")</span> </a> </div> <div id="content">@GetValue("DwContent(content)")</div> </section>