Exception in template (Designs\StandardWebshop\eCom7/CartV2/Step/Step1-Cart.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
at StandardWebshop.CustomCode.CustomerShops.Razor.CustomerShopTemplateBase`1.Translate(String key, String text) in E:\agents\norriq.visualstudio.com\agent2\_work\885\s\Src\StandardWebshop\CustomCode\CustomerShops\Razor\CustomerShopTemplateBase.cs:line 54
at CompiledRazorTemplates.Dynamic.eafefddbeb.Execute()
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using Dynamicweb.Frontend
@using NORRIQ.Common8.Razor;
@using NLWI.Platforms.Dynamicweb9.Specs;
@using NORRIQ.Common8.Factory
@using StandardWebshop.CustomCode.CustomerShops.UserAdministration
@inherits StandardWebshop.CustomCode.CustomerShops.Razor.CustomerShopTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@if (String.IsNullOrEmpty(GetString("Ecom:Order.IsEmpty")))
{
var ProductCurrency = "<span class=\"cart-product-currency\">" + ShopConfiguration.CurrencyCode + "</span>";
var orderlines = GetLoop("OrderLines");
var orderSum = GetDouble("Ecom:Order.OrderLines.TotalPriceWithoutSymbol");// orderlines.Sum(s => s.GetDouble("Ecom:Order:olPrice.Price"));
var pointBalance = PageView.Current().User.GetPoints();
var notEnoughPoints = pointBalance < orderSum && !IsAdmin();
//var XPIData = ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("XPIData");
<form name="ordersubmit" id="ordersubmit" method="post" class="validation">
@foreach (LoopItem step in GetLoop("StepButtons"))
{
if (step.GetBoolean("Step.Current"))
{
<h1 class="title-styled">
@step.GetString("Step.Name")
</h1>
}
}
<h2 class="title-cart">
@Translate("Your order") @orderSum
</h2>
@if (notEnoughPoints)
{
<h3>
@Translate("Insufficient points", "Ikke tilstrækkeligt med points nedjuster venligst din order.")
</h3>
}
<table class="table table-checkout">
<tbody>
@foreach (LoopItem line in GetLoop("OrderLines"))
{
var media = NORRIQ.EcomMedia.Frontend.GetProductMedia(line);
var ProductLink = line.GetString("NIQ:ProductUrl");
var CartSpecs = line.GetProductSpecifications();
var Image = CartSpecs.GetAllByKey("Image").Any() ? "/Files/Images/XPI/" + CartSpecs.GetByKey("Image").Value : media.GetFirstImage().Url;
<tr class="cart-orderline">
<td class="cart-orderline-delete">
<a href="@line.GetString("Ecom:Order:OrderLine.DeleteLink")">
<i class="icon-trash" aria-hidden="true"></i>
</a>
</td>
<td class="cart-orderline-thumb">
<img src="/Admin/Public/GetImage.ashx?Width=60&Height=60&Crop=5&Compression=100&Image=@Image" class="img-responsive" alt="@line.GetString("Ecom:Order:OrderLine.ProductName")" />
</td>
<td class="cart-orderline-details">
<div class="cart-orderline-product">
<a href="@ProductLink" class="cart-orderline-link" tabindex="-1">
@line.GetString("Ecom:Order:OrderLine.ProductName")
</a>
<span class="cart-orderline-info">
<span class="cart-orderline-number">
@Translate("Product Number"): @line.GetString("Ecom:Order:OrderLine.ProductNumber")
</span>
</span>
@if (CartSpecs.GetByKey("V1Tekst").Value != "" || CartSpecs.GetByKey("V2Tekst").Value != "")
{
<span class="cart-orderline-variants">
@if (CartSpecs.GetByKey("V1Tekst").Value != "")
{
<span class="cart-orderline-label">@CartSpecs.GetByKey("V1Label").Value</span><text>: </text><span class="cart-orderline-value">@CartSpecs.GetByKey("V1Tekst").Value</span>
}
@if (CartSpecs.GetByKey("V2Tekst").Value != "")
{
<text>, </text><span class="cart-orderline-label">@CartSpecs.GetByKey("V2Label").Value</span><text>: </text><span class="cart-orderline-value">@CartSpecs.GetByKey("V2Tekst").Value</span>
}
</span>
}
else if (!String.IsNullOrEmpty(line.GetString("Ecom:Order:OrderLine.ProductVariantText")))
{
<span class="cart-orderline-variants">
<span class="cart-orderline-label">@Translate("Variant"):</span> <span class="cart-orderline-value">@line.GetString("Ecom:Order:OrderLine.ProductVariantText")</span>
</span>
}
</div>
<div class="cart-orderline-pricing">
<div class="cart-orderline-quantity">
<label for="@line.GetString("Ecom:Order:OrderLine.Quantity.Input.Name")" class="sr-only">@Translate("Qty")</label>
<input tabindex="@line.GetString("OrderLines.LoopCounter")" type="tel" class="form-control cart-orderline-input" name="@line.GetString("Ecom:Order:OrderLine.Quantity.Input.Name")" id="@line.GetString("Ecom:Order:OrderLine.Quantity.Input.Name")" value="@(line.GetString("Ecom:Order:OrderLine.Quantity"))" />
</div>
<div class="cart-orderline-unit-price">
<span class="cart-orderline-your-price">@line.GetString("Ecom:Order:OrderLine.UnitPrice.PriceWithoutVAT")</span>
@if (line.GetInteger("Ecom:Product.Price.PricePIP") > line.GetInteger("Ecom:Order:OrderLine.UnitPrice.PricePIP"))
{
<span class="cart-orderline-original-price">
@line.GetString("Ecom:Product.Price.PriceWithoutVAT")
</span>
}
</div>
<div class="cart-orderline-subtotal">
@ProductCurrency @line.GetString("Ecom:Order:OrderLine.Price.PriceWithoutVAT")
</div>
</div>
</td>
</tr>
}
</tbody>
</table>
<div class="row">
<div class="col-xs-12 col-sm-5" data-float="right">
<table class="table table-total">
<tbody>
<tr class="cart-total-line">
<td class="cart-total-label">
@Translate("Subtotal")
</td>
<td class="cart-total-price">
@ProductCurrency @GetString("Ecom:Order.PriceWithoutFees.PriceWithoutVAT")
</td>
</tr>
<tr class="cart-total-line">
<td class="cart-total-label">
@Translate("Shipping")
</td>
<td class="cart-total-price">
@ProductCurrency @GetString("Ecom:Order.ShippingFee.PriceWithoutVAT")
</td>
</tr>
<tr class="cart-total-line cart-total-line-lg">
<td class="cart-total-label">
@Translate("Total without VAT")
</td>
<td class="cart-total-price">
@ProductCurrency @GetString("Ecom:Order.Price.PriceWithoutVAT")
</td>
</tr>
<tr class="cart-total-line cart-total-line-sm">
<td class="cart-total-label">
@Translate("VAT")
</td>
<td class="cart-total-price">
@ProductCurrency @GetString("Ecom:Order.Price.VAT")
</td>
</tr>
<tr class="cart-total-line cart-total-line-sm">
<td class="cart-total-label">
@Translate("Total with VAT")
</td>
<td class="cart-total-price">
@ProductCurrency @GetString("Ecom:Order.Price.PriceWithVAT")
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12 col-sm-7">
</div>
</div>
<div class="row">
<div class="col-xs-6">
<a href="@Navigation.GetUrlByNavigationTag("home")" id="shop-more" tabindex="-1" class="btn btn-link"><i class="icon-chevron-left" aria-hidden="true"></i> @Translate("Continue shopping")</a>
</div>
<div class="col-xs-6" data-align="right">
<button type="submit" id="current-step" name="@(GetString("CartV2.CurrentStepButtonName"))" role="button" style="display: none" class="btn btn-warning btn-lg">
<i class="icon-spinner"></i> @Translate("Update")
</button>
<button type="submit" id="next-step" name="@(GetString("CartV2.NextStepButtonName"))" role="button" class="btn btn-action btn-lg" @(notEnoughPoints ? "disabled=\"disabled\"" : "")>
@Translate("Checkout")
</button>
</div>
</div>
</form>
<script append="true">
var cartLogic = new AppStart.Cart();
cartLogic.InitStep1({
$quantity: $('.cart-orderline-input'),
$nextStep: $('#next-step'),
$currentStep: $('#current-step')
});
</script>
}
else
{
<div data-align="center">
<h1 class="title-styled">
@Translate("Your cart is empty")
</h1>
<p>
@Translate("No items found in your shopping cart")
</p>
<a href="@Navigation.GetUrlByNavigationTag("ecom")" class="btn btn-primary btn-lg">
@Translate("Return to shop")
</a>
</div>
}