EPSON PREMIUM LUSTER PHOTO PAPER A4 250 SHEET 250G
C13S041784
Error executing template "Designs/Swift/eCom/ProductCatalog/ProductViewDetail.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at Dynamicweb.Ecommerce.Orders.Discounts.Discount.get_Extender() at Dynamicweb.Ecommerce.Orders.Discounts.DiscountProvider.GetValidDiscountsForProduct(IEnumerable`1 discounts, Product product, Language language, PriceContext priceContext, Boolean ignoreOrderConditions) at Dynamicweb.Ecommerce.Orders.Discounts.DiscountInfoCollection.LoadDiscounts() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetDiscountInfo(PriceViewModelSettings settings, Product product) at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__46() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__48() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetPrice(PriceViewModelSettings settings, IList`1 products, Boolean& pricesHasBeenPrepared, Object lock, Lazy`1 priceInfo) at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__49() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at CompiledRazorTemplates.Dynamic.RazorEngine_d18d3107944248dc81dcec0f3c60e383.Execute() in C:\inetpub\solutions\Goecker-2022-Staging\Files\Templates\Designs\Swift\eCom\ProductCatalog\ProductViewDetail.cshtml:line 53 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 ViewModelTemplate<ProductViewModel> 2 @using Dynamicweb.Rendering 3 @using Dynamicweb.Ecommerce.ProductCatalog 4 @using Dynamicweb.Core 5 6 @{ 7 string metaDescription = string.IsNullOrEmpty(Model.MetaDescription) ? Model.Name : Model.MetaDescription; 8 9 Pageview.Meta.AddTag($"<meta property=\"og:image\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{Model.DefaultImage.Value}\">"); 10 Pageview.Meta.AddTag($"<meta property=\"og:image:alt\" content=\"{Model.Name}\">"); 11 Pageview.Meta.AddTag($"<meta property=\"og:description\" content=\"{metaDescription}\">"); 12 13 Pageview.Meta.AddTag("twitter:image", Model.DefaultImage.Value); 14 Pageview.Meta.AddTag("twitter:image:alt", Model.Name); 15 Pageview.Meta.AddTag("twitter:description", metaDescription); 16 } 17 18 @{ 19 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 20 { 21 Dynamicweb.Context.Current.Items["ProductDetails"] = Model; 22 } 23 else 24 { 25 Dynamicweb.Context.Current.Items.Add("ProductDetails", Model); 26 } 27 28 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 29 if (isLazyLoadingForProductInfoEnabled) 30 { 31 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower(); 32 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 33 bool hasVariantId = !string.IsNullOrEmpty(Model.VariantId); 34 string variantIdParam = hasVariantId ? $"/{Model.VariantId}" : ""; 35 string priceFilledProperties = $"Price,PriceFormatted{(showPricesWithVat == "false" && !neverShowVat ? ",PriceWithVat,PriceWithVatFormatted" : "")}"; 36 string productInfoFeed = $@"/dwapi/ecommerce/products/{Model.Id}{variantIdParam} 37 ?UserId={Converter.ToString(Pageview.User?.ID)} 38 &LanguageId={Pageview.Area.EcomLanguageId}&CurrencyCode={Pageview.Area.EcomCurrencyId}&CountryCode={Pageview.Area.EcomCountryCode}&ShopId={Pageview.Area.EcomShopId} 39 &FilledProperties=Id,Price,PriceBeforeDiscount,StockLevel,VariantInfo,NeverOutOfstock,Prices 40 &PriceSettings.ShowPricesWithVat={Pageview.Area.EcomPricesWithVat} 41 &PriceSettings.FilledProperties={priceFilledProperties} 42 &getproductinfo=true"; 43 Dynamicweb.Context.Current.Items["ProductInfoFeed"] = productInfoFeed; 44 45 <script type="module"> 46 swift.LiveProductInfo.init(); 47 </script> 48 } 49 } 50 51 <script> 52 gtag("event", "view_item", { 53 currency: "@Model.Price.CurrencyCode", 54 value: @PriceViewModelExtensions.ToStringInvariant(Model.Price), 55 items: [ 56 { 57 item_id: "@Model.Number", 58 item_name: "@Dynamicweb.Core.Encoders.HtmlEncoder.JavaScriptStringEncode(Model.Name)", 59 currency: "@Model.Price.CurrencyCode", 60 price: @PriceViewModelExtensions.ToStringInvariant(Model.Price) 61 } 62 ] 63 }); 64 </script> 65 66 <script> 67 window.addEventListener('load', function (event) { 68 swift.Video.init(); 69 }); 70 </script> 71

Error executing template "Designs/Swift/Paragraph/Swift_ProductPrice_Custom.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at Dynamicweb.Ecommerce.Orders.Discounts.Discount.get_Extender() at Dynamicweb.Ecommerce.Orders.Discounts.DiscountProvider.GetValidDiscountsForProduct(IEnumerable`1 discounts, Product product, Language language, PriceContext priceContext, Boolean ignoreOrderConditions) at Dynamicweb.Ecommerce.Orders.Discounts.DiscountInfoCollection.LoadDiscounts() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetDiscountInfo(PriceViewModelSettings settings, Product product) at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__46() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__48() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetPrice(PriceViewModelSettings settings, IList`1 products, Boolean& pricesHasBeenPrepared, Object lock, Lazy`1 priceInfo) at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_2.<BulkCreateView>b__49() at System.Lazy`1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value() at CompiledRazorTemplates.Dynamic.RazorEngine_aa986cae7c2e42aabe41ff612cf7dc25.Execute() in C:\inetpub\solutions\Goecker-2022-Staging\Files\Templates\Designs\Swift\Paragraph\Swift_ProductPrice_Custom.cshtml:line 106 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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites 4 @using System.Linq 5 @using Dynamicweb.Core 6 @using NLWI.Core.Factory 7 @using NLWI.Platforms.Dynamicweb9.Specs.ViewModels 8 @using NLWI.Platforms.Dynamicweb9.Specs.Services 9 @using NORRIQ.CustomCode.Razor 10 @using NORRIQ.CustomCode.StockLocations 11 @using System.Text; 12 @using System.Web; 13 14 @* CUSTOMIZED STANDARD SWIFT (v1.15.0) TEMPLATE *@ 15 16 @{ 17 ProductViewModel product = new ProductViewModel(); 18 19 ProductViewModelSettings productSetting = new ProductViewModelSettings 20 { 21 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 22 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 23 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 24 ShopId = Pageview.Area.EcomShopId 25 }; 26 27 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 28 { 29 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 30 } 31 else if (Pageview.Item["DummyProduct"] != null) 32 { 33 34 string dummyProductId = ""; 35 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 36 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 37 if (productList.Products != null) 38 { 39 foreach (var p in productList.Products) { dummyProductId = p.Id; } 40 ProductViewModel dummyProduct = dummyProductId != "" ? ViewModelFactory.CreateView(productSetting, dummyProductId) : new ProductViewModel(); 41 product = dummyProduct; 42 } 43 else 44 { 45 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 46 } 47 } 48 else if (Pageview.Item["DummyProduct"] == null) 49 { 50 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 51 } 52 53 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 54 bool anonymousUser = Pageview.User == null; 55 bool isErpConnectionDown = !Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsWebServiceConnectionAvailable(); 56 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHidePrices") && isErpConnectionDown; 57 58 string priceFontSize = Model.Item.GetRawValueString("PriceSize", "fs-2"); 59 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 60 string layout = Model.Item.GetRawValueString("Layout", "horizontal"); 61 string textAlign = horizontalAlign == "center" ? "text-center" : string.Empty; 62 textAlign = horizontalAlign == "end" ? "text-end" : textAlign; 63 64 horizontalAlign = horizontalAlign == "center" && layout == "horizontal" ? "justify-content-center" : horizontalAlign; 65 horizontalAlign = horizontalAlign == "end" && layout == "horizontal" ? "justify-content-end" : horizontalAlign; 66 horizontalAlign = horizontalAlign == "center" && layout == "vertical" ? "align-items-center" : horizontalAlign; 67 horizontalAlign = horizontalAlign == "end" && layout == "vertical" ? "align-items-end" : horizontalAlign; 68 69 string flexDirection = layout == "horizontal" ? string.Empty : "flex-column"; 70 string flexGap = layout == "horizontal" ? "gap-3" : string.Empty; 71 string order = layout == "horizontal" ? string.Empty : "order-2"; 72 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? "px-2 theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 73 theme = GetViewParameter("theme") != null ? GetViewParameterString("theme") : theme; 74 75 var disablePrice = product.ProductFields.ContainsKey("Custom_DisablePrice") ? Convert.ToBoolean(product.ProductFields["Custom_DisablePrice"].Value) : false; //CUSTOM 76 } 77 78 @if (!hidePrice && product.Id != null && !disablePrice) //CUSTOM 79 { 80 string showPricesWithVat = HttpContext.Current.Session["Smartpage:ShowPricesWithVat"] != null ? Convert.ToString(HttpContext.Current.Session["Smartpage:ShowPricesWithVat"]) : Pageview.Area.EcomPricesWithVat.ToLower(); 81 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 82 83 string priceMin = ""; 84 string priceMax = ""; 85 86 string liveInfoClass = ""; 87 string productInfoFeed = ""; 88 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsLazyLoadingForProductInfoEnabled; 89 if (isLazyLoadingForProductInfoEnabled) 90 { 91 if (Dynamicweb.Context.Current.Items.Contains("ProductInfoFeed")) 92 { 93 productInfoFeed = Dynamicweb.Context.Current.Items["ProductInfoFeed"]?.ToString(); 94 if (!string.IsNullOrEmpty(productInfoFeed)) 95 { 96 productInfoFeed = $"data-product-info-feed=\"{productInfoFeed}\""; 97 } 98 } 99 liveInfoClass = "js-live-info"; 100 } 101 102 FieldValueViewModel fieldValueViewModel = null; 103 product.ProductFields.TryGetValue("SchillingShowBeforePrice", out fieldValueViewModel); 104 bool showBeforePrice = fieldValueViewModel != null ? Converter.ToBoolean(fieldValueViewModel.Value) : false; 105 106 <div class="@textAlign @liveInfoClass item_@Model.Item.SystemName.ToLower()" data-product-id="@product.Id" @productInfoFeed> 107 <div class="@priceFontSize m-0 d-flex @flexDirection @flexGap @horizontalAlign" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> 108 <span itemprop="priceCurrency" content="@product.Price.CurrencyCode" class="d-none"></span> 109 110 @if (showPricesWithVat == "false" && !neverShowVat) 111 { 112 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 113 { 114 <span itemprop="price" content="" class="d-none"></span> 115 <span class="text-decoration-line-through js-text-decoration-line-through opacity-75 me-3 text-price js-text-price d-none" data-show-if="LiveProductInfo.product.Price.Price != LiveProductInfo.product.PriceBeforeDiscount.Price"></span> 116 } 117 else 118 { 119 string beforePrice = product.PriceBeforeDiscount.PriceWithoutVatFormatted; 120 string informativePrice = product.PriceInformative.PriceWithoutVatFormatted; 121 122 <span itemprop="price" content="@product.Price.PriceWithoutVat" class="d-none"></span> 123 if (product.Price.Price != product.PriceBeforeDiscount.Price) 124 { 125 <span class="text-decoration-line-through opacity-75 @order">@beforePrice</span> 126 } 127 else if (product.PriceInformative.Price > 0) 128 { 129 <span class="text-decoration-line-through opacity-75 @order">@informativePrice</span> 130 } 131 } 132 } 133 else 134 { 135 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 136 { 137 <span itemprop="price" content="" class="d-none"></span> 138 <span class="text-decoration-line-through js-text-decoration-line-through opacity-75 me-3 text-price js-text-price d-none" data-show-if="LiveProductInfo.product.Price.Price != LiveProductInfo.product.PriceBeforeDiscount.Price"></span> 139 } 140 else 141 { 142 string beforePrice = product.PriceBeforeDiscount.PriceFormatted; 143 string informativePrice = product.PriceInformative.PriceFormatted; 144 145 <span itemprop="price" content="@product.Price.Price" class="d-none"></span> 146 147 if (product.Price.Price != product.PriceBeforeDiscount.Price) 148 { 149 <span class="text-decoration-line-through opacity-75 @order"> 150 <span class="text-price">@beforePrice</span> 151 </span> 152 } 153 else if (product.PriceInformative.Price > 0) 154 { 155 <span class="text-decoration-line-through opacity-75 @order"> 156 <span class="text-price">@informativePrice</span> 157 </span> 158 } 159 } 160 } 161 162 @if (showPricesWithVat == "false" && !neverShowVat) 163 { 164 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 165 { 166 <span class="text-price js-text-price"> 167 <div class="spinner-border" role="status"></div> 168 </span> 169 } 170 else 171 { 172 string price = product.Price.PriceWithoutVatFormatted; 173 if (product?.VariantInfo?.VariantInfo != null) 174 { 175 priceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithoutVatFormatted : ""; 176 priceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithoutVatFormatted : ""; 177 } 178 if (priceMin != priceMax) 179 { 180 price = priceMin + " - " + priceMax; 181 } 182 <span class="@theme"> 183 <span class="text-price">@price</span> 184 </span> 185 } 186 } 187 else 188 { 189 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 190 { 191 <span class="text-price js-text-price"> 192 <div class="spinner-border" role="status"></div> 193 </span> 194 } 195 else 196 { 197 string price = product.Price.PriceFormatted; 198 if (product?.VariantInfo?.VariantInfo != null) 199 { 200 priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted != null ? product.VariantInfo.PriceMin.PriceFormatted : ""; 201 priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted != null ? product.VariantInfo.PriceMax.PriceFormatted : ""; 202 } 203 if (priceMin != priceMax) 204 { 205 price = priceMin + " - " + priceMax; 206 } 207 <span class="@theme"> 208 <span class="text-price">@price</span> 209 </span> 210 } 211 } 212 213 @* Stock state for Schema.org, start *@ 214 @{ 215 Uri url = Dynamicweb.Context.Current.Request.Url; 216 } 217 218 @{ 219 // Custom: ViaBill integration 220 if (Model.Item.GetBoolean("CustomActivateViaBill") && showPricesWithVat != "false") 221 { 222 <div class="viabill-pricetag" 223 data-view="product" 224 data-price="@product.Price.Price" 225 data-currency="@Dynamicweb.Ecommerce.Common.Context.Currency.Code" 226 data-dynamic-price-trigger-delay="@Model.Item.GetInt32("CustomViaBillPriceDelay")"></div> 227 @Model.Item.GetRawValueString("CustomViaBillScript") 228 } 229 230 // Custom: Anyday integration 231 if (Model.Item.GetBoolean("CustomActivateAnyday") && !String.IsNullOrEmpty(Model.Item.GetRawValueString("CustomAnydayToken")) && showPricesWithVat != "false") 232 { 233 var locale = Dynamicweb.Frontend.PageView.Current().Area.CultureInfo.ToString(); 234 <anyday-price-widget theme="@Model.Item.GetRawValueString("CustomAnydayTheme")" 235 currency="@product.Price.CurrencyCode" 236 price="@product.Price.Price" 237 price-format-locale="@locale" 238 locale="@locale" 239 token="@Model.Item.GetRawValueString("CustomAnydayToken")" 240 fully-clickable="true" 241 debug="info"> 242 </anyday-price-widget> 243 244 @Model.Item.GetRawValueString("CustomAnydayScript") 245 } 246 } 247 248 249 <link itemprop="url" href="@url"> 250 251 @{ 252 bool IsNeverOutOfStock = product.NeverOutOfstock; 253 } 254 255 @if (IsNeverOutOfStock) 256 { 257 <span itemprop="availability" class="d-none">@Translate("Available in stock")</span> 258 } 259 else 260 { 261 if (product.StockLevel > 0) 262 { 263 <span itemprop="availability" class="d-none">InStock</span> 264 } 265 else 266 { 267 <span itemprop="availability" class="d-none">OutOfStock</span> 268 } 269 } 270 @* Stock state for Schema.org, stop *@ 271 272 </div> 273 274 @if (showPricesWithVat == "false" && !neverShowVat) 275 { 276 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 277 { 278 <small class="opacity-85 fst-normal js-text-price-with-vat d-none" data-suffix="@Translate(" Incl. VAT")"></small> 279 } 280 else 281 { 282 string price = product.Price.PriceWithVatFormatted; 283 if (product?.VariantInfo?.VariantInfo != null) 284 { 285 priceMin = product?.VariantInfo?.PriceMin?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithVatFormatted : ""; 286 priceMax = product?.VariantInfo?.PriceMax?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithVatFormatted : ""; 287 } 288 if (priceMin != priceMax) 289 { 290 price = priceMin + " - " + priceMax; 291 } 292 <small class="opacity-85 fst-normal">@price @Translate("Incl. VAT")</small> 293 } 294 } 295 </div> 296 } 297 else if (Pageview.IsVisualEditorMode) 298 { 299 <div class="alert alert-dark m-0" role="alert"> 300 <span>@Translate("No products available")</span> 301 </div> 302 } 303
Beregn pris inkl. fragt
Produktet er en del af denne kampagne
Vælg din ekspert herunder eller ring på telefon 35 82 11 00

| Producent | Epson |
| Kategori | Papir ark |
| Overflade | Luster |
| Gramvægt | 250 GSM |
| Base | Plast |
| Størrelse papir ark | A3+ |
| Antal ark | 100 |