Error executing template "Designs/Swift/eCom/ProductCatalog/ProductViewDetail.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValue(TKey key, TValue& value)
at Dynamicweb.Caching.DictionaryCache`2.GetCacheResult(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetCurrency()
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetPriceContext()
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_9f3530e5d38f4d2caef8bc58b91c5c00.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\hctswift.cloud.dynamicweb-cms.com\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: @Model.Price.ToStringInvariant(), 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: @Model.Price.ToStringInvariant(), 61 discount: @Model.Discount.ToStringInvariant() 62 } 63 ] 64 }); 65 </script> 66 67 <script> 68 window.addEventListener('load', function (event) { 69 swift.Video.init(); 70 }); 71 </script> 72

Product number:

2060

Thermal Camera DT-986H

Mouldpro
Error executing template "/Designs/Swift/Paragraph/Swift_ProductPrice_UK_single.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValue(TKey key, TValue& value)
at Dynamicweb.Caching.DictionaryCache`2.GetCacheResult(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetCurrency()
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetPriceContext()
at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(VariantInfoViewModelSettings settings, Product product, Dictionary`2 variants, Lazy`1 details, IList`1 products, Boolean& pricesHasBeenPrepared, Boolean& variantPricesHasBeenPrepared, Object lock)
at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_1.<BulkCreateView>b__6()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at CompiledRazorTemplates.Dynamic.RazorEngine_97f3fbd9e54a4e5a86831f0a1faf172e.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\hctswift.cloud.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\Swift_ProductPrice_UK_grid.cshtml:line 105
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 4 @{ 5 ProductViewModel product = null; 6 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 7 { 8 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 9 } 10 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 11 { 12 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 13 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 14 15 if (productList?.Products is object) 16 { 17 product = productList.Products[0]; 18 } 19 } 20 21 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 22 bool anonymousUser = Pageview.User == null; 23 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsWebServiceConnectionAvailable"]); 24 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHidePrices") && isErpConnectionDown; 25 26 bool productIsDiscontinued = product is object && product.Discontinued; 27 bool doNotShowPriceIfProductIsDiscontinued = Model.Item.GetBoolean("DoNotShowPriceIfProductIsDiscontinued"); 28 var isDiscontinued = productIsDiscontinued && doNotShowPriceIfProductIsDiscontinued; 29 } 30 31 @if (product is object && !hidePrice && !isDiscontinued) { 32 bool showInformativePrice = Model.Item.GetBoolean("ShowInformativePrice"); 33 bool hideVatPrice = Model.Item.GetBoolean("HideVatPrice"); 34 string unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : string.Empty; 35 36 string priceFontSize = Model.Item.GetRawValueString("PriceSize", "fs-2"); 37 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 38 string layout = Model.Item.GetRawValueString("Layout", "horizontal"); 39 string textAlign = horizontalAlign == "center" ? "text-center" : string.Empty; 40 textAlign = horizontalAlign == "end" ? "text-end" : textAlign; 41 42 horizontalAlign = horizontalAlign == "center" && layout == "horizontal" ? "justify-content-center" : horizontalAlign; 43 horizontalAlign = horizontalAlign == "end" && layout == "horizontal" ? "justify-content-end" : horizontalAlign; 44 horizontalAlign = horizontalAlign == "center" && layout == "vertical" ? "align-items-center" : horizontalAlign; 45 horizontalAlign = horizontalAlign == "end" && layout == "vertical" ? "align-items-end" : horizontalAlign; 46 47 string flexDirection = layout == "horizontal" ? string.Empty : "flex-column"; 48 string flexGap = layout == "horizontal" ? "gap-3" : string.Empty; 49 string order = layout == "horizontal" ? string.Empty : "order-2"; 50 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? "theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 51 theme = GetViewParameter("theme") != null ? GetViewParameterString("theme") : theme; 52 53 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 54 contentPadding = contentPadding == "none" ? "p-0" : contentPadding; 55 contentPadding = contentPadding == "small" ? "p-1 px-md-2 py-md-1" : contentPadding; 56 contentPadding = contentPadding == "large" ? "p-2 px-md-3 py-md-2" : contentPadding; 57 58 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower(); 59 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 60 61 if (Dynamicweb.Frontend.PageView.Current().Area.ReverseChargeForVat || Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUser()?.ReverseChargeForVat == true){ 62 if (showPricesWithVat == "false"){ 63 showPricesWithVat = ""; 64 neverShowVat = true; 65 } 66 } 67 68 string priceMin = ""; 69 string priceMax = ""; 70 71 string liveInfoClass = ""; 72 string productInfoFeed = ""; 73 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 74 double discountPercentage = 0; 75 76 77 @* 78 79 if (product.ProductDiscounts.Count() > 0){ 80 81 foreach (var discount in product.ProductDiscounts){ 82 discountPercentage = discountPercentage + discount.Percentage; 83 } 84 85 } 86 87 *@ 88 89 90 91 ProductViewModelSettings productSetting = new ProductViewModelSettings 92 { 93 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 94 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 95 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 96 ShopId = Pageview.Area.EcomShopId 97 }; 98 99 double variantsPriceMin = 999999; 100 var variantsPriceMinFormatted = ""; 101 double variantsPriceMax = 0; 102 var variantsPriceMaxFormatted = ""; 103 bool isAnyVariants = false; 104105 if (anonymousUser && product?.VariantInfo?.VariantInfo != null){ 106107 foreach (var variant in product.VariantInfo.VariantInfo ){ 108109 var productViewModel = ViewModelFactory.CreateView(productSetting, variant.ProductID, variant.VariantID); 110111 if (variantsPriceMin > productViewModel.Price.Price){ 112 isAnyVariants = true; 113 variantsPriceMin = productViewModel.Price.Price; 114 variantsPriceMinFormatted = productViewModel.Price.PriceFormatted; 115 } 116117 if (variantsPriceMax < productViewModel.Price.Price){ 118 variantsPriceMax = productViewModel.Price.Price; 119 variantsPriceMaxFormatted = productViewModel.Price.PriceFormatted; 120 } 121122123 } 124125 } 126127128129 if (isLazyLoadingForProductInfoEnabled) 130 { 131 if (Dynamicweb.Context.Current.Items.Contains("ProductInfoFeed")) 132 { 133 productInfoFeed = Dynamicweb.Context.Current.Items["ProductInfoFeed"]?.ToString(); 134 if (!string.IsNullOrEmpty(productInfoFeed)) 135 { 136 productInfoFeed = $"data-product-info-feed=\"{productInfoFeed}\""; 137 } 138 } 139 liveInfoClass = "js-live-info"; 140 } 141142 <div class="@textAlign @liveInfoClass item_@Model.Item.SystemName.ToLower()" data-product-id="@product.Id" data-variant-id="@product.VariantId" @productInfoFeed> 143 @if (showInformativePrice && product.PriceInformative.Price != 0) 144 { 145 <div class="opacity-50"> 146 <span>@Translate("RRP") </span> 147 <span class="text-decoration-line-through text-price">@product.PriceInformative.PriceFormatted</span> 148 </div> 149 } 150 <div class="@priceFontSize m-0 d-flex flex-wrap @flexDirection @flexGap @horizontalAlign" style="row-gap: 0 !important" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> 151 <span itemprop="priceCurrency" content="@product.Price.CurrencyCode" class="d-none"></span> 152153154 @if (showPricesWithVat == "false" && !neverShowVat) 155 { 156 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 157 { 158 <span itemprop="price" content="" class="d-none"></span> 159 <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> 160 } 161 else 162 { 163 string beforePrice = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).PriceBeforeDiscount.PriceWithoutVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 164165 <span itemprop="price" content="@product.Price.PriceWithoutVat.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)" class="d-none"></span> 166 if (product.Price.Price != product.PriceBeforeDiscount.Price) 167 { 168 <span class="text-decoration-line-through opacity-75 @order">@beforePrice</span> 169 } 170 } 171 } 172 else 173 { 174 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 175 { 176 <span itemprop="price" content="" class="d-none"></span> 177 <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> 178 } 179 else 180 { 181 string beforePrice = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).PriceBeforeDiscount.PriceFormatted : product.PriceBeforeDiscount.PriceFormatted; 182183 <span itemprop="price" content="@product.Price.Price.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)" class="d-none"></span> 184185 if (product.Price.Price != product.PriceBeforeDiscount.Price) 186 { 187 <span class="text-decoration-line-through opacity-75 @order"> 188 <span class="text-price">@beforePrice</span> 189 </span> 190 } 191 } 192 } 193194 @if (showPricesWithVat == "false" && !neverShowVat) 195 { 196 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 197 { 198 <span class="text-price js-text-price"> 199 <span class="spinner-border" role="status"></span> 200 </span> 201 } 202 else 203 { 204 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithoutVatFormatted : product.Price.PriceWithoutVatFormatted; 205 var priceNotFormatted = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithoutVat : product.Price.PriceWithoutVat; 206207 if (product?.VariantInfo?.VariantInfo != null) 208 { 209 priceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithoutVatFormatted : ""; 210 priceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithoutVatFormatted : ""; 211 } 212213 if (isAnyVariants && anonymousUser){ 214 priceMin = variantsPriceMinFormatted; 215 priceMax = variantsPriceMaxFormatted; 216 } 217218 if (priceMin != priceMax) 219 { 220 //price = priceMin + " - " + priceMax; 221 price = Translate("From ") + priceMin; 222 } 223 else if (priceNotFormatted == 0){ 224 price = priceMin; 225 } 226 if (discountPercentage > 0){ 227228 double discountpriceMin = 0; 229 double discountpriceMax = 0; 230 string pricediscount = ""; 231 string currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 232233 if (product?.VariantInfo?.VariantInfo != null) 234 { 235 discountpriceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVat != null ? product.VariantInfo.PriceMin.PriceWithoutVat : 0; 236 discountpriceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVat != null ? product.VariantInfo.PriceMax.PriceWithoutVat : 0; 237238 discountpriceMin = discountpriceMin - (discountpriceMin * discountPercentage / 100); 239 discountpriceMax = discountpriceMax - (discountpriceMax * discountPercentage / 100); 240241 } 242 if (discountpriceMin != discountpriceMax) 243 { 244 pricediscount = currencySymbol + discountpriceMin.ToString("F2") + " - " + currencySymbol + discountpriceMax.ToString("F2"); 245 } 246 else if (priceNotFormatted == 0){ 247 pricediscount = currencySymbol + discountpriceMin.ToString("F2"); 248 } 249250 <span class="@theme @contentPadding"> 251 <span class="text-decoration-line-through text-price">@price</span> 252 </span> 253254 <span class="@theme @contentPadding"> 255 <span class="text-price">@pricediscount</span> 256 </span> 257 } else { 258259260 <span class="@theme @contentPadding"> 261 <span class="text-price">@price</span> 262 </span> 263264 } 265 } 266 } 267 else 268 { 269 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 270 { 271 <span class="text-price js-text-price"> 272 <span class="spinner-border" role="status"></span> 273 </span> 274 } 275 else 276 { 277 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceFormatted : product.Price.PriceFormatted; 278 var priceNotFormatted = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.Price : product.Price.Price; 279 if (product?.VariantInfo?.VariantInfo != null) 280 { 281 priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted != null ? product.VariantInfo.PriceMin.PriceFormatted : ""; 282 priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted != null ? product.VariantInfo.PriceMax.PriceFormatted : ""; 283 } 284285 if (priceMin != priceMax) 286 { 287 //price = priceMin + " - " + priceMax; 288 price = Translate("From ") + priceMin; 289 } 290 else if (priceNotFormatted == 0){ 291 price = priceMin; 292 } 293 <span class="@theme @contentPadding"> 294 <span class="text-price">@price</span> 295 </span> 296 } 297 } 298299 @* Stock state for Schema.org, start *@ 300 @{ 301 Uri url = Dynamicweb.Context.Current.Request.Url; 302 } 303304 <link itemprop="url" href="@url"> 305306 @{ 307 bool IsNeverOutOfStock = product.NeverOutOfstock; 308 } 309310 @if (IsNeverOutOfStock) 311 { 312 <span itemprop="availability" class="d-none">@Translate("Available in stock")</span> 313 } 314 else 315 { 316 if (product.StockLevel > 0) 317 { 318 <span itemprop="availability" class="d-none">InStock</span> 319 } 320 else 321 { 322 <span itemprop="availability" class="d-none">OutOfStock</span> 323 } 324 } 325 @* Stock state for Schema.org, stop *@ 326327 </div> 328329 @if (showPricesWithVat == "false" && !neverShowVat) 330 { 331 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 332 { 333 if (!hideVatPrice){ 334 <small class="opacity-85 fst-normal js-text-price-with-vat d-none" data-suffix="@Translate("Incl. VAT")"></small> 335 } 336 } 337 else 338 { 339 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithVatFormatted : product.Price.PriceWithVatFormatted; 340 var priceNotFormatted = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithVat : product.Price.PriceWithVat; 341342 if (product?.VariantInfo?.VariantInfo != null) 343 { 344 priceMin = product?.VariantInfo?.PriceMin?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithVatFormatted : ""; 345 priceMax = product?.VariantInfo?.PriceMax?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithVatFormatted : ""; 346 } 347 if (priceMin != priceMax) 348 { 349 //price = priceMin + " - " + priceMax; 350 price = Translate("From ") + priceMin; 351 } 352 else if (priceNotFormatted == 0){ 353 price = priceMin; 354 } 355 if (discountPercentage > 0){ 356357 double discountpriceMin = 0; 358 double discountpriceMax = 0; 359 string pricediscount = ""; 360 string currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 361362 if (product?.VariantInfo?.VariantInfo != null) 363 { 364 discountpriceMin = product?.VariantInfo?.PriceMin?.PriceWithVat != null ? product.VariantInfo.PriceMin.PriceWithVat : 0; 365 discountpriceMax = product?.VariantInfo?.PriceMax?.PriceWithVat != null ? product.VariantInfo.PriceMax.PriceWithVat : 0; 366367 discountpriceMin = discountpriceMin - (discountpriceMin * discountPercentage / 100); 368 discountpriceMax = discountpriceMax - (discountpriceMax * discountPercentage / 100); 369370 } 371 if (discountpriceMin != discountpriceMax) 372 { 373 pricediscount = currencySymbol + discountpriceMin.ToString("F2") + " - " + currencySymbol + discountpriceMax.ToString("F2"); 374 } 375 else if (priceNotFormatted == 0){ 376 pricediscount = currencySymbol + discountpriceMin.ToString("F2"); 377 } 378379 if (!hideVatPrice){ 380 <div><small class="text-decoration-line-through opacity-85 fst-normal">@price @Translate("Incl. VAT")</small></div> 381 <small class="opacity-85 fst-normal">@pricediscount @Translate("Incl. VAT")</small> 382 } 383384385 } else { 386 if (!hideVatPrice){ 387 <small class="opacity-85 fst-normal">@price @Translate("Incl. VAT")</small> 388 } 389 } 390 } 391 } 392 </div> 393 } 394 else if (Pageview.IsVisualEditorMode) 395 { 396 <div class="alert alert-dark m-0" role="alert"> 397 <span>@Translate("No products available")</span> 398 </div> 399 } 400
Files
Images
3D Viewer
Error executing template "Designs/Swift/Paragraph/Swift_ProductCustomIframe.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValue(TKey key, TValue& value)
at Dynamicweb.Caching.DictionaryCache`2.GetCacheResult(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys)
at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key)
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetCurrency()
at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBaseCurrencyBase`1.GetPriceContext()
at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(VariantInfoViewModelSettings settings, Product product, Dictionary`2 variants, Lazy`1 details, IList`1 products, Boolean& pricesHasBeenPrepared, Boolean& variantPricesHasBeenPrepared, Object lock)
at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_1.<BulkCreateView>b__6()
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_12bb94f6887f416e9ee6366ac1364e97.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\hctswift.cloud.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\Swift_ProductCustomIframe.cshtml:line 34
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.Frontend 4 @using System.IO 5 6 @{ 7 ProductViewModel product = null; 8 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 9 { 10 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 11 } 12 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 13 { 14 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 15 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 16 17 if (productList?.Products is object) 18 { 19 product = productList.Products[0]; 20 } 21 } 22 } 23 24 @{ 25 26 FieldValueViewModel customIframe; 27 28 product.ProductFields.TryGetValue("CustomIframe", out customIframe); 29 30 string customIframeCode = ""; 31 32 bool isProductVariant = false; 33 34 if (product.VariantInfo.VariantInfo != null){ 35 if (product.VariantInfo.VariantInfo.Count() < 2){ 36 isProductVariant = true; 37 } 38 } 39 40 if ((customIframe != null && isProductVariant) || Model.Item.GetBoolean("ShowForAllProducts") ) 41 { 42 43 customIframeCode = customIframe?.Value != null ? customIframe.Value.ToString() : ""; 44 45 if (!string.IsNullOrEmpty(customIframeCode)){ 46 <div class="custom-iframe">@customIframeCode</div> 47 } 48 49 50 } 51 } 52
Specification

This hand-held thermal imaging camera is designed to make your work easier by providing accurate, fast and reliable temperature measurement. Simple and easy to operate the camera uses point and shoot infrared technology to produce high-quality thermal images that are displayed on the TFT screen. 50Hz fast frame rate enables fast capture of temperature variation where critical temperature conditions are directly displayed with automatic hot/cold spot recognition. The camera has the ability for datalogging via the internal memory while Bluetooth connectivity allows the for easy transfer of data to the user’s smartphone or Bluetooth device. The smart design is robust, compact and lightweight with the camera being able to withstand drops from up to 2m.

Thermal imaging cameras may be used for a multitude of temperature related applications; use the camera around the mouldshop to measure part ejection temperature, check heater-band temperatures and also troubleshoot possible cooling problems or dryer temperatures simply by measuring the hose temperature; these may not give exact readings but, are a great way to quickly identify possible problems and are an invaluable aid to process verification. The camera will quickly identify the temperature of polymer melt temperature – giving an almost instantaneous reading – in comparison a melt probe can take up to 30 seconds for the reading to stabilise.

The built-in LED flashlight is convenient when working in dark and unlit inspection environments

8 hour battery life with the rechargeable battery and automatic shutdown

Easy-to-use interface, this unit is ideal for monitoring process parameters, predictive maintenance, equipment troubleshooting and verification

The compact, rugged and lightweight design allows for optimum portability and performance, even in harsh working conditions

5 Megapixel built in digital camera enables the overlaying of digital and thermal images as well as the more advanced fusion mode

100Mb internal memory (80 Pictures JPEG / 1 minute of live video MPEG-4) or up to 60 minutes video using the 8GB micro SD Card, Video output via USB or HDMI

8 hour battery life with the rechargeable battery and automatic shutdown

Supplied with adaptor, battery, App software, USB cable and convenient carry case 

Thermal imaging cameras may be used for a multitude of temperature related applications; use the camera around the mouldshop to measure part ejection temperature, check heater-band temperatures and also troubleshoot possible cooling problems or dryer temperatures simply by measuring the hose temperature; these may not give exact readings but, are a great way to quickly identify possible problems and are an invaluable aid to process verification. The camera will quickly identify the temperature of polymer melt temperature – giving an almost instantaneous reading – in comparison a melt probe can take up to 30 seconds for the reading to stabilise.

 

The built-in LED flashlight is convenient when working in dark and unlit inspection environments

 

8 hour battery life with the rechargeable battery and automatic shutdown

 

Easy-to-use interface, this unit is ideal for monitoring process parameters, predictive maintenance, equipment troubleshooting and verification

 

The compact, rugged and lightweight design allows for optimum portability and performance, even in harsh working conditions

 

5 Megapixel built in digital camera enables the overlaying of digital and thermal images as well as the more advanced fusion mode

 

100Mb internal memory (80 Pictures JPEG / 1 minute of live video MPEG-4) or up to 60 minutes video using the 8GB micro SD Card, Video output via USB or HDMI

 

8 hour battery life with the rechargeable battery and automatic shutdown

 

Supplied with adaptor, battery, App software, USB cable and convenient carry case