Branding Stylesheet || ProductId : 999999999999999 VariantId :

pdp - add to cart

Product detail configuration page

Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetName.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_99a832bfa76345c8900855c3a450d00b.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetName.cshtml:line 15
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 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 9 ProductDetailWidgetName _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetName", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetName>() ?? new ProductDetailWidgetName(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 } 12 13 <div id="@paragraphID" class="pdp__ProductName @_data.CssClass"> 14 <h1 class="pdp-header__title"> 15 @if (_data.DisplayManufacturer && ProductAndVariants.Manufacturer != null) 16 { 17 <span class="pdp-header__manufacturer">@ProductAndVariants.Manufacturer.Name</span> 18 } 19 <span class="pdp-header__productname">@ProductAndVariants.ProductInfo.Name</span> 20 </h1> 21 </div> 22 23 <style> 24 25 .pdp__ProductName .pdp-header__productname { 26 color: var(--Color); 27 @_data.FontConfigurationProductName.InlineStyles 28 } 29 30 </style> 31
4,5 / 5 (88 reviews)
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetImages.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_d69a5bdfed6e430b9f273bae86fe1e96.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 21
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 Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 @using System.Text.RegularExpressions; 6 7 8 @{ 9 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 10 ProductDetailWidgetImages _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 11 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 12 13 ProductViewModel product = new ProductViewModel(); 14 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 15 { 16 product = (ProductViewModel) Dynamicweb.Context.Current.Items["ProductDetails"]; 17 } 18 19 List<FieldOptionValueViewModel> productRibbons = null; 20 21 if (product.ProductFields["ProductRibbon"] != null) 22 { 23 productRibbons = (List<FieldOptionValueViewModel>)product.ProductFields["ProductRibbon"].Value; 24 } 25 26 //ProductObj ProductObj = (ProductObj)HttpContext.Current.Session["ProductDetails"]; 27 28 //ProductDetailObj DefaultProduct = ProductObj.Default[0]; 29 30 //ProductInfoObj DefaultProductInfo = DefaultProduct.ProductInfo; 31 32 //List<ProductAssetsObj> Assets = DefaultProduct.ProductImages.ProductAssets; 33 34 bool displayRibbon = _data.DisplayRibbon; 35 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 36 37 string videoUrl = ProductAndVariants?.ProductDetail?.YoutubeProductVideo ?? ""; 38 string videoId = ""; 39 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 40 41 if (!string.IsNullOrWhiteSpace(videoUrl)) 42 { 43 // regex for direct YouTube ID (e.g. keBgXIeTmhk) 44 if (Regex.IsMatch(videoUrl, @"^[a-zA-Z0-9_-]{11}$")) 45 { 46 videoId = videoUrl; 47 } 48 // regex for https://youtu.be/{videoId} 49 else if (Regex.IsMatch(videoUrl, @"youtu\.be\/([^?&]+)")) 50 { 51 Match match = Regex.Match(videoUrl, @"youtu\.be\/([^?&]+)"); 52 videoId = match.Groups[1].Value; 53 } 54 // regex for https://www.youtube.com/watch?v={videoId} 55 else if (Regex.IsMatch(videoUrl, @"v=([^&]+)")) 56 { 57 Match match = Regex.Match(videoUrl, @"v=([^&]+)"); 58 videoId = match.Groups[1].Value; 59 } 60 } 61 } 62 63 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 64 65 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.ProductRibbon) && displayRibbon) 66 { 67 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@ProductAndVariants.ProductDetail.ProductRibbon</span></p> 68 } 69 70 <section class="product-detailpage__images pdp__images-container"> 71 <section class="productimages pdp__images"> 72 73 <section class="productimages__wrapper"> 74 75 <div class="productimages__carousel-big hidden"> 76 77 <div class="productimages__item"> 78 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Format=webp&Quality=-1&width=800&height=800" alt="@ProductAndVariants.Images.Default" height="800" width="800" /> 79 </div> 80 81 @if (!string.IsNullOrWhiteSpace(videoId)) 82 { 83 <div class="productimages__item"> 84 <div class="productimages__carousel__video-container"> 85 <lite-youtube 86 videoid="@videoId" 87 params="controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1&origin=@origin&disablekb=0"> 88 </lite-youtube> 89 </div> 90 </div> 91 } 92 93 @if (ProductAndVariants.Images.AssetImages != null) 94 { 95 foreach (Image Image in ProductAndVariants.Images.AssetImages) 96 { 97 <div class="productimages__item"> 98 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@Image.Value" /> 99 </div> 100 } 101 } 102103 </div> 104 </section> 105106 <div class="productimages__carousel-thumbnails hidden"> 107108 <div class="productimages__thumbnail" style="display: none;"> 109 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Crop=5&Format=webp&Quality=90&Compression=80&width=100&height=100" alt="@ProductAndVariants.Images.Default" height="100" width="100" /> 110 </div> 111112 @if(!string.IsNullOrWhiteSpace(videoId)) 113 { 114 <div class="productimages__thumbnail productimages__thumbnail--video pin-t mr-4" aria-hidden="true"> 115 <img class="h-full" src="https://img.youtube.com/vi/@videoId/0.jpg" alt="Video preview" height="84" width="84"> 116 <span class="video-icon"> 117 <i class="fas fa-play"></i> 118 </span> 119 </div> 120 } 121122 @if (ProductAndVariants.Images.AssetImages != null) 123 { 124 foreach (Image Thumb in ProductAndVariants.Images.AssetImages) 125 { 126 <div class="productimages__thumbnail"> 127 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=5&Format=webp&Quality=90&Compression=80&width=100&height=100" alt="Thumbnail @Thumb.Value" width="100" height="100" /> 128 </div> 129 } 130 } 131 </div> 132133 <section class="productimages__wrapper"> 134 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 135 { 136 <img src="/Admin/Public/GetImage.ashx?Image=/Files/@ProductAndVariants.Manufacturer.Logo&Crop=5&Format=webp&Quality=90&Compression=80&width=150" class="manufacturer__logo" alt="Manufacturer" width="150" height="50" /> 137 } 138 </section> 139140 </section> 141 </section> 142 </div> 143144 <style> 145 .productimages__item { 146 height: 400px; 147 } 148 </style> 149
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetPrice.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_3859e746c2a840ec8df3c58440afa766.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetPrice.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.Prices; 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 5 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 6 7 @{ 8 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 9 ProductDetailWidgetPrice _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetPrice", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetPrice>() ?? new ProductDetailWidgetPrice(); 10 11 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 12 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 13 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 14 15 ProductViewModel product = new ProductViewModel(); 16 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 17 { 18 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 19 } 20 21 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 22 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 23 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 24 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 25 WithVATBool = false; 26 } 27 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 28 WithVATBool = false; 29 } 30 31 bool hidePricesForGuests = EcommerceConfiguration.HidePricesForGuests; 32 bool hideZeroPrices = EcommerceConfiguration.HideZeroPrices; 33 bool displayPrice = hidePricesForGuests ? Pageview.User != null : true; 34 bool pricezero = product.Price.Price <= 0; 35 36 bool displayProductPrice = displayPrice; 37 if (hideZeroPrices && pricezero) 38 { 39 displayProductPrice = false; 40 } 41 42 string ProductdetailPriceSuffixWithVAT = Translate("Productdetail.Price.Suffix.WithVAT", "Incl. VAT"); 43 string ProductdetailPriceSuffixWithoutVAT = Translate("Productdetail.Price.Suffix.WithoutVAT", "Excl. VAT"); 44 string ProductdetailPriceSuffix = WithVATBool ? ProductdetailPriceSuffixWithVAT : ProductdetailPriceSuffixWithoutVAT; 45 46 var gtmValue = WithVATBool ? product.Price.PriceWithVat : product.Price.PriceWithoutVat; 47 var priceFormatted = WithVATBool ? product.Price.PriceWithVatFormatted : product.Price.PriceWithoutVatFormatted; 48 var priceBeforeDiscount = WithVATBool ? product.PriceBeforeDiscount.PriceWithVat : product.PriceBeforeDiscount.PriceWithoutVat; 49 var priceBeforeDiscountFormatted = WithVATBool ? product.PriceBeforeDiscount.PriceWithVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 50 var priceTotalDiscount = WithVATBool ? product.Discount.PriceWithVat : product.Discount.PriceWithoutVat; 51 var priceTotalDiscountFormatted = WithVATBool ? product.Discount.PriceWithVatFormatted : product.Discount.PriceWithoutVatFormatted; 52 double discountPercentage = Math.Round(((priceTotalDiscount / priceBeforeDiscount) * -100)); 53 bool hasDiscount = product.Discount.Price > 0; 54 55 string informativePrice = WithVATBool ? product.PriceInformative.PriceWithVatFormatted : product.PriceInformative.PriceWithoutVatFormatted; 56 if (EcommerceConfiguration.UseInformativePriceAsFromPrice && !string.IsNullOrWhiteSpace(informativePrice)) 57 { 58 double informativePriceValue = WithVATBool ? product.PriceInformative.PriceWithVat : product.PriceInformative.PriceWithoutVat; 59 hasDiscount = gtmValue < informativePriceValue; 60 if (hasDiscount) 61 { 62 priceBeforeDiscountFormatted = informativePrice; 63 discountPercentage = Math.Round((((gtmValue - informativePriceValue) / informativePriceValue) * 100)); 64 65 double yourProfitValue = informativePriceValue - gtmValue; 66 priceTotalDiscountFormatted = WithVATBool ? new PriceInfo { PriceWithVAT = yourProfitValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = yourProfitValue }.PriceWithoutVATFormatted; 67 } 68 } 69 70 string retailPrice = ""; 71 bool displayRetailPrice = EcommerceConfiguration.DisplayRetailPrice; 72 if(EcommerceConfiguration.DisplayRetailPriceForUsers && Pageview.User == null) { 73 displayRetailPrice = false; 74 } 75 if(displayRetailPrice) { 76 string priceFieldName = EcommerceConfiguration.RetailPriceField; 77 if(EcommerceConfiguration.RetailPriceIsDbPrice) { 78 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 79 PriceContext customerPriceContext = new PriceContext(Dynamicweb.Ecommerce.Common.Context.Currency, Dynamicweb.Ecommerce.Common.Context.Country, null, null, Dynamicweb.Ecommerce.Common.Context.ReverseChargeForVatEnabled, DateTime.Now); 80 var customerPrice = p?.GetPrice(customerPriceContext); 81 if(customerPrice.Price > 0) { 82 retailPrice = WithVATBool ? customerPrice.PriceWithVATFormatted : customerPrice.PriceWithoutVATFormatted; 83 } 84 } else if(!string.IsNullOrWhiteSpace(priceFieldName)) { 85 double customerPriceValue = 0.0; 86 if (product.ProductFields.TryGetValue(priceFieldName, out var fieldValue) && fieldValue.Value is double) { 87 customerPriceValue = (double)fieldValue.Value; 88 } 89 if(customerPriceValue > 0) { 90 retailPrice = WithVATBool ? new PriceInfo { PriceWithVAT = customerPriceValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = customerPriceValue }.PriceWithoutVATFormatted; 91 } 92 } 93 } 94 95 bool isVariant = product.VariantId != ""; 96 int variantCount = product?.VariantInfo?.VariantInfo?.Count ?? 0; 97 bool hasVariants = !isVariant ? variantCount > 0 : false; 98 } 99100 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 101 @if (displayPrice && displayProductPrice) 102 { 103 <div class="pdp-price__container"> 104 @if (hasVariants) 105 { 106 string priceMin = WithVATBool ? product?.VariantInfo?.PriceMin?.PriceWithVatFormatted : product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted; 107 string fromText = Translate("Productdetail.Price.FromLabel", "From"); 108109 if (!string.IsNullOrWhiteSpace(priceMin)) 110 { 111 <section class="pdp-price__subcontainer"> 112 <span class="pdp-price__from">@fromText</span> 113 <span class="pdp-price">@priceMin</span> 114 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 115 </section> 116 } 117 } 118 else 119 { 120 if (hasDiscount) 121 { 122 <p class="pdp-price--original">@priceBeforeDiscountFormatted</p> 123 <section class="pdp-price__subcontainer"> 124 <span class="pdp-price">@priceFormatted</span> 125 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 126 <span class="pdp-price__percentage">@discountPercentage%</span> 127 </section> 128 } 129 else 130 { 131 <section class="pdp-price__subcontainer"> 132 <span class="pdp-price">@priceFormatted</span> 133 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 134 </section> 135 } 136137 if (!string.IsNullOrWhiteSpace(retailPrice)) 138 { 139 <p class="pdp-price__retail-price"> 140 @String.Format(Translate("ProductBlockTitle.RetailPrice", "Retail price: {0}"), retailPrice) 141 </p> 142 } 143 if (hasDiscount) 144 { 145 <p class="pdp-price__yourprofit"> 146 @Translate("Productdetail.YourProfitLabel", "Your profit:") @priceTotalDiscountFormatted 147 </p> 148 } 149 } 150 </div> 151 } 152 </div> 153
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetStock.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Ecommerce.Products.ProductService.GetStockStatus(Product product, StockLocation stockLocation, String unitId)
at CompiledRazorTemplates.Dynamic.RazorEngine_7e161f1b9e6247e097a2206596accdef.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetStock.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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using Dynamicweb.Ecommerce.Stocks; 5 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 6 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 8 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 9 10 @{ 11 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 12 13 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 14 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 15 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 16 17 ProductViewModel product = new ProductViewModel(); 18 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 19 { 20 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 21 } 22 23 ProductAndVariantsObj _product = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 24 25 bool hideStockForGuests = EcommerceConfiguration.HideStockForGuests; 26 bool enableProductStock = hideStockForGuests ? Pageview.User != null : true; 27 string stockFormat = EcommerceConfiguration.StockFormat; 28 bool inStock = product.StockLevel > 0 || product.NeverOutOfstock; 29 string stockStateClass = inStock ? "pdp-stockstate--instock" : "pdp-stockstate--outofstock"; 30 31 bool isVariant = product.VariantId != ""; 32 int variantCount = product?.VariantInfo?.VariantInfo?.Count ?? 0; 33 bool hasVariants = !isVariant ? variantCount > 0 : false; 34 35 if(hasVariants) { 36 enableProductStock = false; 37 } 38 } 39 40 <div id="@paragraphID" class="pdp-paragraph"> 41 @if(enableProductStock && !string.IsNullOrWhiteSpace(stockFormat)) 42 { 43 if(stockFormat == "text") { 44 StockLocation stockLocation = Dynamicweb.Ecommerce.Services.StockService.GetStockLocation(Pageview.Area.StockLocationID); 45 var currentProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, "", Pageview.Area.EcomLanguageId); 46 string stockText = Dynamicweb.Ecommerce.Services.Products.GetStockStatus(currentProduct, stockLocation, Pageview.Area.EcomLanguageId)?.Text; 47 48 if (!string.IsNullOrWhiteSpace(stockText)) 49 { 50 <p class="pdp-stockstate @stockStateClass">@string.Format(stockText, product.StockLevel)</p> 51 } 52 } 53 else 54 { 55 string translationTag = ""; 56 if(product.NeverOutOfstock) 57 { 58 translationTag = Translate("ProductBlockStockInfo.AmountInStock", "In stock"); 59 } 60 else if(product.StockLevel == 1) 61 { 62 translationTag = Translate("ProductBlockStockInfo.AmountInStockSingle", "{0} product in stock"); 63 } 64 else if(product.StockLevel > 1) 65 { 66 translationTag = Translate("ProductBlockStockInfo.AmountInStockMultiple", "{0} products in stock"); 67 } 68 else if(!inStock) 69 { 70 translationTag = Translate("ProductBlockStockInfo.AmountOutOfStock", "Out of stock"); 71 } 72 73 <p class="pdp-stockstate @stockStateClass">@string.Format(translationTag, product.StockLevel)</p> 74 } 75 } 76 </div> 77

Uitsluitend B2B. Voor 13:00 besteld, de volgende werkdag geleverd.

Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetAddToCart.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_18ca2aa48eea4be2a6f379dc00e7f64d.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetAddToCart.cshtml:line 35
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 System.Web; 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 5 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 6 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 8 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 9 10 @{ 11 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 12 ProductDetailWidgetAddToCart _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetAddToCart", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetAddToCart>() ?? new ProductDetailWidgetAddToCart(); 13 14 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 15 16 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 17 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 18 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 19 20 var corporate_settings = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "CorporateSettingsPage"); 21 CorporateSettingsPage cs = corporate_settings?.Item?.ToCodeFirstItem<CorporateSettingsPage>(); 22 23 ProductViewModel product = new ProductViewModel(); 24 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 25 { 26 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 27 } 28 29 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 30 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 31 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 32 33 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 34 bool enableProductShoppingCart = enableShoppingCart; 35 if (!enableAddToCartForZeroPrices && product.Price.Price <= 0) 36 { 37 enableProductShoppingCart = false; 38 } 39 if (!enableAddToCartForOutOfStock && !(product.StockLevel > 0 || product.NeverOutOfstock)) 40 { 41 enableProductShoppingCart = false; 42 } 43 44 int QuotePageID = !string.IsNullOrWhiteSpace(_data.OffertePageId) ? int.Parse(_data.OffertePageId) : GetPageIdByNavigationTag("QuoteForm"); 45 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 46 47 bool isVariant = product.VariantId != ""; 48 int variantCount = product?.VariantInfo?.VariantInfo?.Count ?? 0; 49 bool hasVariants = !isVariant ? variantCount > 0 : false; 50 51 bool enablePhoneButton = _data.EnableCallButton; 52 string phonenumberFormatted = !string.IsNullOrWhiteSpace(_data.CallButtonText) ? _data.CallButtonText : cs.Phonenumber; 53 string phonenumberHref = phonenumberFormatted?.Replace("(", "").Replace(")", "").Replace(" ", "") ?? ""; 54 if(string.IsNullOrWhiteSpace(phonenumberHref)) 55 { 56 enablePhoneButton = false; 57 } 58 } 59 60 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 61 @if (!hasVariants) 62 { 63 if (enableShoppingCart && enableProductShoppingCart) 64 { 65 <div class="pdp-add-to-cart pdp-add-to-cart__container"> 66 <add-to-cart class="app-addtocart" 67 data-prodid="@product.Id" 68 data-variantid="@product.VariantId" 69 data-min-quantity="@product.PurchaseMinimumQuantity" 70 data-step="@product.PurchaseQuantityStep" 71 data-list-id="product_detail" 72 data-list-name="Product detail"> 73 </add-to-cart> 74 </div> 75 } 76 else 77 { 78 if (QuotePageID > 0 || enablePhoneButton) 79 { 80 ButtonConfiguration btnStyle = _data.ButtonConfiguration; 81 string btnStyleClass = btnStyle != null ? $"btn--{btnStyle.Id}" : ""; 82 83 <style> 84 @if (btnStyle != null) 85 { 86 @btnStyle.GetButtonStylesheet() 87 } 88 </style> 89 90 <div class="pdp-quote-button"> 91 @if(_data.ShowTitle) 92 { 93 <p><strong>@Translate("QuoteRequestTitle", "Want to know more?")</strong></p> 94 } 95 <div class="pdp-quote-button__list"> 96 97 @if (QuotePageID > 0) 98 { 99 string btnTarget = $"/Default.aspx?ID={QuotePageID}&ProdID={product.Id}"; 100 if (!string.IsNullOrWhiteSpace(product.VariantId)) 101 { 102 btnTarget = $"{btnTarget}&VarID={product.VariantId}"; 103 } 104 <a href="@btnTarget" class="btn btn-quote--contact default-btn @btnStyleClass"> 105 <span class="btn__text">@_data.ButtonText</span> 106 <i class="btn__icon @_data.ButtonIcon"></i> 107 </a> 108 } 109110 @if (enablePhoneButton) 111 { 112 <a href="tel:@phonenumberHref" class="btn btn-quote--phone default-btn"> 113 <span class="btn__text"><strong>@Translate("QuoteRequestPhone", "Call:")</strong> @phonenumberFormatted</span> 114 </a> 115 } 116 </div> 117 </div> 118 } 119 } 120 } 121 </div> 122
Liever eerst uitproberen? Bezoek onze experience centers!
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetPaymentLogos.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_6cd44965b7aa44a68387beb440390ed2.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetPaymentLogos.cshtml:line 18
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 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 var selectedPaymentLogos = Pageview.Area.Item["FooterPaymentLogos"]; 9 ProductDetailWidgetPaymentLogos _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetPaymentLogos", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetPaymentLogos>() ?? new ProductDetailWidgetPaymentLogos(); 10 11 ProductViewModel product = new ProductViewModel(); 12 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 13 { 14 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 15 } 16 } 17 18 @if (product.Price.Price > 0) 19 { 20 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 21 <section class="pdp-paymentlogos paymentlogos--small"> 22 <div class="footer-paymentoptions" data-paymentmethods="@selectedPaymentLogos"></div> 23 </section> 24 </div> 25 } 26
  • Veilig betalen met iDEAL, Bancontact of creditcard
  • Voor 13.00 uur besteld, morgen gratis bezorgd
  • Grootste in Nederland en Belgie
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetProductUsps.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_57f35f7b1bab45a08c26c31b2bfe343d.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductUsps.cshtml:line 13
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 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 ProductDetailWidgetProductUsps _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetProductUsps", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetProductUsps>() ?? new ProductDetailWidgetProductUsps(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 string uspIcon = _data.USPIcon; 11 12 var productUsps = new List<String>(); 13 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP1)) { productUsps.Add(ProductAndVariants.USP.USP1.ToString()); } 14 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP2)) { productUsps.Add(ProductAndVariants.USP.USP2); } 15 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP3)) { productUsps.Add(ProductAndVariants.USP.USP3); } 16 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP4)) { productUsps.Add(ProductAndVariants.USP.USP4); } 17 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP5)) { productUsps.Add(ProductAndVariants.USP.USP5); } 18 19 /* 20 21 ProductViewModel product = new ProductViewModel(); 22 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 23 { 24 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 25 } 26 27 var productUsps = new List<String>(); 28 29 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP1")) 30 { 31 productUsps.Add(product.ProductFields["ProductUSP1"].Value.ToString()); 32 } 33 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP2")) 34 { 35 productUsps.Add(product.ProductFields["ProductUSP2"].Value.ToString()); 36 } 37 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP3")) 38 { 39 productUsps.Add(product.ProductFields["ProductUSP3"].Value.ToString()); 40 } 41 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP4")) 42 { 43 productUsps.Add(product.ProductFields["ProductUSP4"].Value.ToString()); 44 } 45 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP5")) 46 { 47 productUsps.Add(product.ProductFields["ProductUSP5"].Value.ToString()); 48 } 49 50 */ 51 52 } 53 54 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 55 56 <ul class="pdp-usplist"> 57 @foreach (string usp in productUsps) 58 { 59 if (!string.IsNullOrWhiteSpace(usp)) 60 { 61 <li class="pdp-usplist__item"> 62 @if (!string.IsNullOrWhiteSpace(uspIcon)) 63 { 64 <i class="pdp-usplist__uspicon @uspIcon"></i> 65 } 66 <span>@usp</span> 67 </li> 68 } 69 } 70 </ul> 71 72 </div> 73
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetShortDescription.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_57c846f0fc3f43baa365dd78ffb55a73.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetShortDescription.cshtml:line 12
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 Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 4 5 @{ 6 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 7 8 ProductDetailWidgetShortDescription _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetShortDescription", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetShortDescription>() ?? new ProductDetailWidgetShortDescription(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 11 string readMoreTarget = _data.ButtonTarget; 12 string shortDescription = ProductAndVariants.ProductInfo.ShortDescription; 13 } 14 15 <div id="@paragraphID" class="pdp-paragraph pdp-paragraph-short-description ProductShortDescription"> 16 @if(!string.IsNullOrWhiteSpace(shortDescription)) 17 { 18 <p class="pdp-header__productname">@shortDescription</p> 19 if(!string.IsNullOrWhiteSpace(readMoreTarget)) 20 { 21 <a href="@readMoreTarget" class="btn default-btn" target="_self"> 22 <span class="btn__text">@Translate("Productdetail.Readmore", "Read more")</span> 23 <i class="btn__icon fa-chevron-right"></i> 24 </a> 25 } 26 } 27 </div> 28
Hulp nodig van onze specialist?

Vraag het aan één van onze specialisten.

Bezoekadres: ROM bv | Zeilmaker 9 | 3861 SM Nijkerk (NL)
Bel mij terug
  • Productinformatie
  • Specificaties
  • Accessoires
  • Andere uitvoeringen
  • Opties
  • Voordelen
  • Reviews
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetLongDescription.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_6320217541c44fc1a37335a7ea038815.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetLongDescription.cshtml:line 41
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 3 @using Dynamicweb; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Configuration.AdvancedGrid.Elements; 5 6 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 8 9 @{ 10 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 11 12 ProductDetailWidgetLongDescription _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetLongDescription", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetLongDescription>() ?? new ProductDetailWidgetLongDescription(); 13 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 14 15 bool IsNotContentManager = false; 16 bool isVisualEditor = Pageview.IsVisualEditorMode; 17 18 if (isVisualEditor) 19 { 20 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID; 21 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true); 22 } 23 24 if (ProductAndVariants != null && ProductAndVariants.ProductInfo != null && ProductAndVariants.ProductInfo.LongDescription != null) 25 { 26 27 <div id="@paragraphID" class="ProductLongDescription @_data.CssClass"> 28 <div class="ProductLongDescription__header">@Translate("ProductDetailWidget.LongDescription.Header", "Productinformatie")</div> 29 30 <p>@ProductAndVariants.ProductInfo.LongDescription</p> 31 </div> 32 33 <style> 34 @_data.FontConfigurationProductName.InlineStyles 35 </style> 36 37 } 38 else 39 { 40 41 <script>console.dir(@ProductAndVariants.Template.Json)</script> 42 43 <placeholder id="@paragraphID" class="ProductLongDescription @_data.CssClass"></placeholder> 44 45 if (_data.HideTabWhenEmpty) 46 { 47 <script> 48 49 document.addEventListener('DOMContentLoaded', function () { 50 51 var Element = document.getElementById("@paragraphID"); 52 console.dir(Element); 53 var parentElement = Element.closest('.content-tab'); 54 console.dir(parentElement); 55 var TabElement = document.querySelector('[data-tab-target=' + parentElement.id + ']'); 56 console.dir(TabElement); 57 58 @{ 59 if (isVisualEditor && IsNotContentManager) 60 { 61 <text>TabElement.style.display = 'flex';</text> 62 } 63 else 64 { 65 <text>TabElement.style.display = 'none';</text> 66 } 67 } 68 69 }); 70 71 </script> 72 } 73 74 } 75 76 } 77
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetDownloadProductsheet.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_77bf6d0b3338467c938b59f1ad158c53.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetDownloadProductsheet.cshtml:line 12
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 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 ProductDetailWidgetDownloadProductsheet _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetDownloadProductsheet", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetDownloadProductsheet>() ?? new ProductDetailWidgetDownloadProductsheet(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 } 11 12 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.DownloadProductsheet)) 13 { 14 15 <nav id="@paragraphID" class="cta-paragraph__btn-navigation @_data.CssClass"> 16 <a href="/Files/Images/@ProductAndVariants.ProductDetail.DownloadProductsheet" class="btn default-btn btn--@paragraphID" target="_blank"> 17 <i class="btn__icon fa-download cta-paragraph__btn-icon"></i> 18 <span class="btn__text cta-paragraph__btn cta-paragraph__btn-label">@_data.Label</span> 19 </a> 20 </nav> 21 22 } 23

Kom langs in één van onze winkels in Nederland én België

 Laat u adviseren door een specialist
 Probeer zelf het product uit en vergelijk ze
 Experience centers in Nederland en België

Reviews

4,5 / 5 (88 reviews)
5 / 5

Een pracht aparraat is. Werkt heerlijk.

4 / 5

5 / 5

Test review

5 / 5

Toppertje

2 / 5

Test review

1 / 5

Test 002

3 / 5

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo.

4 / 5

Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores

5 / 5

Good!!

5 / 5

Test review

3 / 5

Test 2

3 / 5

5 / 5

Fantastische monitor. De bluetooth naar telefoon functie is echt geweldig. Ik installeerde de Hqx live-app op de telefoon van de klant en konden zo samen direct zien wat er in de afvoerleiding aan de hand was. Klanten vinden het echt een meerwaarde dat ze op deze manier mee kunnen kijken.

5 / 5

Ik heb deze monitor nu een paar maanden en ben er erg tevreden over. Bluetooth naar telefoon werkt geweldig. Ik heb zelfs een keer op locatie bij een klant een video van 6 minuten geüpload naar onedrive zodat ze direct op de zaak de inspectie konden bekijken.

4 / 5

Ik heb deze monitor 2 maanden geleden gekocht en hij werkt uitstekend. Ik kan iedereen deze monitor aanbevelen. De bluetoothverbinding van deze monitor naar een smartphone werkt uitstekend. De monitor is zeer gebruiksvriendelijk. Het is ideaal om het probleem meteen met de klant te kunnen delen.

5 / 5

Ik hou van deze monitor! Nog nooit eerder heb ik zulk scherp beeld gehad als met de CS12x.

4 / 5

Ik heb de CS12x gekocht om mijn CS10 monitor te vervangen. Ik ben erg blij met al die nieuwe functies.

5 / 5

Ik zit al vele jaren in het vak en het hebben van hoogwaardige apparatuur is voor mij de sleutel tot het succesvol traceren van een probleem in een afvoerleiding. Mijn CS12x in combinatie met mijn RIDGID haspels stelt mij in staat om duidelijk te zien wat het probleem is. We zijn er tevreden over deze hoogwaardige monitor met groot scherm.

5 / 5

Geweldig systeem. Compact, lichtgewicht en gebruiksvriendelijk. Zeer tevreden met deze aankoop.

5 / 5

Dit systeem is van onschatbare waarde. Duw de gebruiksvriendelijke camerakop door de afvoerbuis en binnen enkele minuten vindt je de oorzaak van het probleem. Wat vroeger veel tijd en energie vergde, kan nu in enkele minuten worden gedaan. Het is gemakkelijk te gebruiken, betaalbaar en betrouwbaar!

5 / 5

Snel en gemakkelijk te gebruiken

5 / 5

Gebruiksvriendelijk

5 / 5

Werkt geweldig. Maakt het leven een stuk gemakkelijker. Erg makkelijk te bedienen.

5 / 5

Ik heb dit artikel gekocht ter vervanging van mijn oude apparaat en het werkt echt geweldig! Zeer nauwkeurig. Echt een aanrader!

5 / 5

Ik gebruik de Scout nu 3 maanden en het is echt het beste wat er op de markt te verkrijgen is.

5 / 5

Ik gebruik de Flexshaft K9-102 meestal voor urinoirs, wastafels en gootstenen. De Flexshaft is gemakkelijk in gebruik. Je draagt hem naar binnen bij de klant en kunt direct aan de slag. Zo simpel is het. Afvoerleidingen zijn binnen no-time weer schoon.

5 / 5

Ik gebruik de rioolcamera's van RIDGID al jaren en ze blijven indruk maken. Het beeld is geweldig en ze zijn gemakkelijk te gebruiken. De duwkabel is stevig en gaat door bochten zonder te knikken. Ik gebruik deze wekelijks samen met RIDGID locators voor camera-onderzoek voorafgaand aan bouwwerkzaamheden en dat werkt perfect.

4 / 5

Ik gebruik al tien jaar RIDGID camera's, locators en monitors. Nooit heb ik een probleem met ze gehad. Tip: maak de duwkabel schoon na elke inspectie. Dan gaan ze jaren mee!

5 / 5

Die PowerClear was echt in no time in huis. Meteen uitgeprobeerd en het ding doet wat ik wil. De gootsteen van mijn klant loopt weer geweldig door.

4 / 5

Gemakkelijk in gebruik. Echt een aanrader om kleine en middelgrote verstoppingen mee op te lossen.

5 / 5

Gebruiksvriendelijk

5 / 5

Werkt geweldig. Maakt het leven een stuk gemakkelijker. Erg makkelijk te bedienen.

5 / 5

Ik heb dit artikel gekocht ter vervanging van mijn oude apparaat en het werkt echt geweldig! Zeer nauwkeurig. Echt een aanrader!

5 / 5

Ik gebruik de Scout nu 3 maanden en het is echt het beste wat er op de markt te verkrijgen is.

4 / 5

Product werkt precies zoals ik gehoopt had, heel fijn in gebruik. Niks op aan te merken.

4 / 5

Camera werkt super goed. Echt zeer scherpe beeldkwaliteit. Echt een super goed product.

5 / 5

Snel en efficiënt

4 / 5

Betaalbaar en doet zijn werk prima. Helemaal Top !

4 / 5

Goed gereedschap is het halve werk

5 / 5

Verstopping in de afvoer van een douche hiermee volledig verholpen.

4 / 5

Makkelijk te bedienen. Werkt goed en snel.

4 / 5

Goede kwaliteit

4 / 5

Ik ben zeer tevreden over dit artikel. Wat ik vooral goed vind: goede kwaliteit en duurzaam.

5 / 5

Top aankoop!

5 / 5

Alleen maar positief. Goede kwaliteit. Echt een aanrader!

5 / 5

Goede inspectie camera, doet waar het voor bestemd is. Helder beeld, zeker een aanrader.

5 / 5

Blij met deze aankoop. Beeldkwaliteit is goed en verlichting is ook een must. Alles werkt naar behoren. Het doet wat het hoort te doen. Alles is eenvoudig te bedienen.

5 / 5

Werkt prima en snel

4 / 5

Zeer goed product, doet wat het moet doen

4 / 5

Makkelijk in gebruik. Stevig.

5 / 5

Eenvoudig in gebruik , compact , mooie lengte van de veer en doeltreffend. Het werkt perfect.

5 / 5

Product is uitstekend, voldoet aan alle verwachtingen.

5 / 5

Goed beeldkwaliteit al meer dan 40 keer gebruikt

5 / 5

Werkt goed. Goed beeld en makkelijk in gebruik.

5 / 5

Top apparaat, is zijn geld waard.

5 / 5

Super tevreden met de snelle levering! Stevig verpakt en goede handleiding erbij.

5 / 5

Perfect beeld en stevige kabel. Sterke accu en goede software.

5 / 5

Uitstekende beeldkwaliteit

5 / 5

Ik ben al 40 jaar loodgieter en had net een nieuwe K-50 gekocht, maar mijn oude K-50 doet het ook nog steeds uitstekend. Het is een zeer duurzame en betrouwbare machine.

5 / 5

Beste machine die ooit is gemaakt

5 / 5

Fantastisch product

5 / 5

De k-50 is de beste machine voor kleinere afvoerleidingen. Zeer veelzijdig en gebruiksvriendelijk.

5 / 5

De K-50 heeft mijn verwachtingen overtroffen. Voor mij is dit de beste ontstoppingsmachine op de markt!!

5 / 5

Handige oplossing als je heel graag met een tablet of mobiel wilt werken.

5 / 5

Mooie mogelijkheid om te gebruiken met de RIDGID mini SeeSnake camerahaspel.

5 / 5

Werk top samen met m'n tablet. Die gebruik ik nu als monitor in combinatie met mijn SeeSnake haspel

5 / 5

Hartstikke handig om je tablet veilig in te bevestigen.

5 / 5

Met deze kickstand gaat het invoeren van de duwkabel van mijn micro camerahaspel echt lekker als ik hem horizontaal neerzet.

4 / 5

Top product!

5 / 5

Ik ben dol op deze camera. Compact en lichtgewicht.

5 / 5

Écht blij met deze set! Ik werk er elke dag mee!

5 / 5

Ik ben al jaren klant bij RIDGIDKollmann.com. Werk nu net een week met deze nieuwe camera. Top ding!

5 / 5

Ik ben blij dat ik de zomeractie heb gekocht

4 / 5

Werkt goed. Precies wat ik nodig heb!

5 / 5

De combinatie van de seesnake compact 2 en de scout heeft mijn werk een stuk makkelijker gemaakt nogmaals dank aan ronald voor de goede service!

4 / 5

Top zomeractie twee top producten voor een goede prijs!

5 / 5

Top produkt!

4 / 5

Laatst opgehaald in Barneveld top service!

4 / 5

Onlangs heb ik deze machine gekocht en ik ben er blij mee

5 / 5

Weer goede service gehad van verkoper Edward!

5 / 5

goed product

4 / 5

Erg blij met deze haspel. Werkt goed!

5 / 5

Top camera

5 / 5

Top aankoop! Werkt goed

4 / 5

Top!

4 / 5

uitleg gehad over de trusense werkt top. lijdingen bekijken is mu een eitje

4 / 5

Test NL

1 / 5

Test

Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetSecondaryInfo.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_3391c195543549c5870aaa563d0b6606.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetSecondaryInfo.cshtml:line 31
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.Stocks; 4 @using Dynamicweb.Ecommerce.Variants; 5 @using Dynamicweb.Ecommerce.Prices; 6 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 7 @using Newtonsoft.Json; 8 9 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 10 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 11 12 @{ 13 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 14 15 ProductViewModel product = new ProductViewModel(); 16 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 17 { 18 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 19 } 20 21 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 22 23 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 24 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 25 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 26 27 bool isVariant = product.VariantId != ""; 28 int variantCount = product.VariantInfo?.VariantInfo?.Count ?? 0; 29 bool hasVariants = !isVariant ? variantCount > 0 : false; 30 31 string largeImage = product.DefaultImage.Value; 32 if (ProductAndVariants != null && ProductAndVariants.Images != null && ProductAndVariants.Images.Default != null) 33 { 34 largeImage = ProductAndVariants.Images.Default; 35 } 36 37 string productName = product.Name; 38 string productSubTitle = product.ProductFields["ProductDetailSubtitle"].Value.ToString(); 39 40 // Review 41 Dynamicweb.Content.Commenting.CommentCollection comments = Dynamicweb.Content.Commenting.Comment.GetComments("ecomProduct", product.Id, Pageview.Area.EcomLanguageId, true); 42 double? productRating = comments.GetRatingAverage(); 43 int productCommentCount = comments.GetTotalCount(); 44 45 // Stock 46 bool hideStockForGuests = EcommerceConfiguration.HideStockForGuests; 47 bool enableProductStock = hideStockForGuests ? Pageview.User != null : true; 48 string stockFormat = EcommerceConfiguration.StockFormat; 49 bool inStock = product.StockLevel > 0 || product.NeverOutOfstock; 50 string stockStateClass = inStock ? "pdp-stockstate--instock" : "pdp-stockstate--outofstock"; 51 52 // Tagline 53 string productTagline = product.ProductFields != null && product.ProductFields.ContainsKey("ProductTagline") ? product.ProductFields["ProductTagline"].Value.ToString() : ""; 54 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false; 55 string productDetailPageTagline = ""; 56 if (!isVisualEditor) 57 { 58 productDetailPageTagline = Pageview.Item["Tagline"].ToString(); 59 } 60 61 // Price 62 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 63 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 64 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 65 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 66 WithVATBool = false; 67 } 68 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 69 WithVATBool = false; 70 } 71 72 bool hidePricesForGuests = EcommerceConfiguration.HidePricesForGuests; 73 bool hideZeroPrices = EcommerceConfiguration.HideZeroPrices; 74 bool displayPrice = hidePricesForGuests ? Pageview.User != null : true; 75 bool pricezero = product.Price.Price <= 0; 76 77 bool displayProductPrice = displayPrice; 78 if (hideZeroPrices && pricezero) 79 { 80 displayProductPrice = false; 81 } 82 83 string ProductdetailPriceSuffixWithVAT = Translate("Productdetail.Price.Suffix.WithVAT", "Incl. VAT"); 84 string ProductdetailPriceSuffixWithoutVAT = Translate("Productdetail.Price.Suffix.WithoutVAT", "Excl. VAT"); 85 string ProductdetailPriceSuffix = WithVATBool ? ProductdetailPriceSuffixWithVAT : ProductdetailPriceSuffixWithoutVAT; 86 87 var gtmValue = WithVATBool ? product.Price.PriceWithVat : product.Price.PriceWithoutVat; 88 var priceFormatted = WithVATBool ? product.Price.PriceWithVatFormatted : product.Price.PriceWithoutVatFormatted; 89 var priceBeforeDiscount = WithVATBool ? product.PriceBeforeDiscount.PriceWithVat : product.PriceBeforeDiscount.PriceWithoutVat; 90 var priceBeforeDiscountFormatted = WithVATBool ? product.PriceBeforeDiscount.PriceWithVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 91 var priceTotalDiscount = WithVATBool ? product.Discount.PriceWithVat : product.Discount.PriceWithoutVat; 92 var priceTotalDiscountFormatted = WithVATBool ? product.Discount.PriceWithVatFormatted : product.Discount.PriceWithoutVatFormatted; 93 double discountPercentage = Math.Round(((priceTotalDiscount / priceBeforeDiscount) * -100)); 94 bool hasDiscount = product.Discount.Price > 0; 95 96 string informativePrice = WithVATBool ? product.PriceInformative.PriceWithVatFormatted : product.PriceInformative.PriceWithoutVatFormatted; 97 if (EcommerceConfiguration.UseInformativePriceAsFromPrice && !string.IsNullOrWhiteSpace(informativePrice)) 98 { 99 double informativePriceValue = WithVATBool ? product.PriceInformative.PriceWithVat : product.PriceInformative.PriceWithoutVat; 100 hasDiscount = gtmValue < informativePriceValue; 101 if (hasDiscount) 102 { 103 priceBeforeDiscountFormatted = informativePrice; 104 discountPercentage = Math.Round((((gtmValue - informativePriceValue) / informativePriceValue) * 100)); 105106 double yourProfitValue = informativePriceValue - gtmValue; 107 priceTotalDiscountFormatted = WithVATBool ? new PriceInfo { PriceWithVAT = yourProfitValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = yourProfitValue }.PriceWithoutVATFormatted; 108 } 109 } 110111 string retailPrice = ""; 112 bool displayRetailPrice = EcommerceConfiguration.DisplayRetailPrice; 113 if(EcommerceConfiguration.DisplayRetailPriceForUsers && Pageview.User == null) { 114 displayRetailPrice = false; 115 } 116 if(displayRetailPrice) { 117 string priceFieldName = EcommerceConfiguration.RetailPriceField; 118 if(EcommerceConfiguration.RetailPriceIsDbPrice) { 119 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 120 PriceContext customerPriceContext = new PriceContext(Dynamicweb.Ecommerce.Common.Context.Currency, Dynamicweb.Ecommerce.Common.Context.Country, null, null, Dynamicweb.Ecommerce.Common.Context.ReverseChargeForVatEnabled, DateTime.Now); 121 var customerPrice = p?.GetPrice(customerPriceContext); 122 if(customerPrice.Price > 0) { 123 retailPrice = WithVATBool ? customerPrice.PriceWithVATFormatted : customerPrice.PriceWithoutVATFormatted; 124 } 125 } else if(!string.IsNullOrWhiteSpace(priceFieldName)) { 126 double customerPriceValue = 0.0; 127 if (product.ProductFields.TryGetValue(priceFieldName, out var fieldValue) && fieldValue.Value is double) { 128 customerPriceValue = (double)fieldValue.Value; 129 } 130 if(customerPriceValue > 0) { 131 retailPrice = WithVATBool ? new PriceInfo { PriceWithVAT = customerPriceValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = customerPriceValue }.PriceWithoutVATFormatted; 132 } 133 } 134 } 135136 // Add to cart 137 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 138 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 139 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 140 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 141 bool enableProductShoppingCart = enableShoppingCart; 142 if (!enableAddToCartForZeroPrices && product.Price.Price <= 0) 143 { 144 enableProductShoppingCart = false; 145 } 146 if (!enableAddToCartForOutOfStock && !(product.StockLevel > 0 || product.NeverOutOfstock)) 147 { 148 enableProductShoppingCart = false; 149 } 150151 int QuotePageID = GetPageIdByNavigationTag("QuoteForm"); 152 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 153154 // Variant selector 155 int pageId = Model.PageID; 156 string variantSelection = product.VariantId.Replace(".", ","); 157158 List<string[]> variantCombinationsIds = new List<string[]>(); 159 List<List<string>> variantGroupsOptionIds = new List<List<string>>(); 160161 var variantCombinations = Dynamicweb.Ecommerce.Services.VariantCombinations.GetVariantCombinations(product.Id); 162 var variantGroups = Dynamicweb.Ecommerce.Services.VariantGroups.GetVariantGroupsByProductId(product.Id); 163164 foreach (var combination in variantCombinations) 165 { 166 variantCombinationsIds.Add(combination.VariantId.Split('.')); 167 } 168 string variantCombinationsIdsJson = JsonConvert.SerializeObject(variantCombinationsIds).Replace("\"", "\'"); 169170 foreach (var variantGroup in variantGroups) 171 { 172 var variantsObject = new List<string>(); 173 foreach (var variantOption in variantGroup.GetAllVariantOptions()) 174 { 175 variantsObject.Add(variantOption.Id); 176 } 177 variantGroupsOptionIds.Add(variantsObject); 178 } 179 string variantGroupsOptionIdsJson = JsonConvert.SerializeObject(variantGroupsOptionIds).Replace("\"", "\'"); 180181 var selectedPaymentLogos = Pageview.Area.Item["FooterPaymentLogos"]; 182 } 183 <div id="@paragraphID" class="pdp-paragraph"> 184 <section class="pdp-secondary-info"> 185 <div class="container pdp-secondary-info__container"> 186 <div class="pdp-secondary-info__column"> 187 @if (!string.IsNullOrWhiteSpace(largeImage)) 188 { 189 <figure class="pdp-secondary-info__image-container"> 190 <img class="pdp-secondary-info__image" src="/Admin/Public/GetImage.ashx?Image=@largeImage&Crop=7&Format=webp&Quality=90&Compression=80&Height=400" alt="@productName" loading="lazy" height="400" width="600" /> 191 </figure> 192 } 193 </div> 194 <div class="pdp-secondary-info__column"> 195 @if (!string.IsNullOrWhiteSpace(productSubTitle)) 196 { 197 <h3 class="pdp-header__subtitle"> 198 <span class="pdp-header__subtitle-product">@productSubTitle</span> 199 </h3> 200 } 201202 <h2 class="pdp-header__title"> 203 @if (product.Manufacturer != null) 204 { 205 <span class="pdp-header__manufacturer">@product.Manufacturer.Name</span> 206 } 207 <span class="pdp-header__productname"> 208 @productName 209 </span> 210 </h2> 211212 @if (productCommentCount > 0) 213 { 214 <div class="pdp-review-indicator"> 215 @renderReviewIndicator("#86C440", productRating, productCommentCount) 216 </div> 217 } 218219 @if (enableProductStock && !string.IsNullOrWhiteSpace(stockFormat)) 220 { 221 if (stockFormat == "text") 222 { 223 StockLocation stockLocation = Dynamicweb.Ecommerce.Services.StockService.GetStockLocation(Pageview.Area.StockLocationID); 224 var currentProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, "", Pageview.Area.EcomLanguageId); 225 string stockText = Dynamicweb.Ecommerce.Services.Products.GetStockStatus(currentProduct, stockLocation, Pageview.Area.EcomLanguageId)?.Text; 226227 if (!string.IsNullOrWhiteSpace(stockText)) 228 { 229 <p class="pdp-stockstate @stockStateClass">@string.Format(stockText, product.StockLevel)</p> 230 } 231 } 232 else 233 { 234 string translationTag = ""; 235 if (product.NeverOutOfstock) 236 { 237 translationTag = Translate("ProductBlockStockInfo.AmountInStock", "In stock"); 238 } 239 else if (product.StockLevel == 1) 240 { 241 translationTag = Translate("ProductBlockStockInfo.AmountInStockSingle", "{0} product in stock"); 242 } 243 else if (product.StockLevel > 1) 244 { 245 translationTag = Translate("ProductBlockStockInfo.AmountInStockMultiple", "{0} products in stock"); 246 } 247 else if (!inStock) 248 { 249 translationTag = Translate("ProductBlockStockInfo.AmountOutOfStock", "Out of stock"); 250 } 251252 <p class="pdp-stockstate @stockStateClass">@string.Format(translationTag, product.StockLevel)</p> 253 } 254 } 255256 @if (!string.IsNullOrWhiteSpace(productDetailPageTagline)) 257 { 258 <div class="pdp-tagline__container"> 259 @if (!string.IsNullOrWhiteSpace(productDetailPageTagline)) 260 { 261 <p class="pdp-tagline"> 262 @productDetailPageTagline 263 </p> 264 } 265 </div> 266 } 267 </div> 268 <div class="pdp-secondary-info__column"> 269270 @if (!string.IsNullOrWhiteSpace(product.Number)) 271 { 272 <p class="pdp-articlenumber"> 273 @Translate("Productdetail.ArticleNumber.Prefix", "Article number:") @product.Number 274 </p> 275 } 276277 @if (displayPrice && displayProductPrice) 278 { 279 <div class="pdp-price__container"> 280 @if (hasDiscount) 281 { 282 <p class="pdp-price--original">@priceBeforeDiscountFormatted</p> 283 <section class="pdp-price__subcontainer"> 284 <span class="pdp-price">@priceFormatted</span> 285 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 286 <span class="pdp-price__percentage">@discountPercentage%</span> 287 </section> 288 } 289 else 290 { 291 <section class="pdp-price__subcontainer"> 292 <span class="pdp-price">@priceFormatted</span> 293 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 294 </section> 295 } 296 @if (!string.IsNullOrWhiteSpace(retailPrice)) 297 { 298 <p class="pdp-price__retail-price"> 299 @String.Format(Translate("ProductBlockTitle.RetailPrice", "Retail price: {0}"), retailPrice) 300 </p> 301 } 302 @if (hasDiscount) 303 { 304 <p class="pdp-price__yourprofit"> 305 @Translate("Productdetail.YourProfitLabel", "Your profit:") @priceTotalDiscountFormatted 306 </p> 307 } 308 </div> 309 } 310311 @if (variantGroups.Any()) 312 { 313 <div class="product-variants__wrapper pdp-variants"> 314 <div class="js-variants" data-total-variant-groups="@variantGroups.Count" data-combinations="@variantCombinationsIdsJson" data-variants="@variantGroupsOptionIdsJson" data-current-page-variant="@variantSelection" data-variant-selections="@variantSelection" data-page-id="@pageId" data-product-id="@product.Id"> 315 @foreach (var variantGroup in variantGroups) 316 { 317 bool containsImage = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.SmallImage)); 318 bool containsColor = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.Color)); 319 string variantGroupName = variantGroup.GetName(Pageview.Area.EcomLanguageId); 320 string variantGroupId = variantGroup.Id; 321 var variantGroupOptions = variantGroup.GetAllVariantOptions(); 322323 if (containsImage || containsColor) 324 { 325 <p class="product-variants__title">@variantGroupName</p> 326327 <div class="product-variants__options-wrapper"> 328 @foreach (VariantOption variantOption in variantGroupOptions) 329 { 330 string variantOptionName = variantOption.GetName(Pageview.Area.EcomLanguageId); 331332 if (!string.IsNullOrEmpty(variantOption.SmallImage)) 333 { 334 string variantImage = "/Files/" + variantOption.SmallImage; 335 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--image"> 336 <img src="@variantImage" alt="@variantOptionName" title="@variantOptionName" /> 337 </div> 338 } 339 else if (!string.IsNullOrEmpty(variantOption.Color)) 340 { 341 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--color"> 342 <span title="@variantOptionName" style="--variant-color: @variantOption.Color;"></span> 343 </div> 344 } 345 else 346 { 347 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn">@variantOptionName</button> 348 } 349 } 350 </div> 351 } 352 else 353 { 354 <p class="product-variants__title">@variantGroupName</p> 355356 <div class="product-variants__dropdown"> 357 <div class="product-variants__dropdown-wrapper"> 358359 <button class="product-variants__toggle"> 360 <span>@Translate(string.Format("VariantDropdown.Placeholder.{0}", variantGroupName), "Select your option")</span> 361 <i class="fal fa-chevron-down"></i> 362 </button> 363364 <div class="product-variants__options-wrapper product-variants__options-wrapper--dropdown product-variants__dropdown-options-wrapper"> 365 @foreach (VariantOption variantOption in variantGroupOptions) 366 { 367 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__dropdown-btn"> 368 @variantOption.GetName(Pageview.Area.EcomLanguageId) 369 </button> 370 } 371 </div> 372 </div> 373 </div> 374 } 375 } 376 </div> 377 </div> 378 } 379380 @if(!hasVariants) 381 { 382 if (enableShoppingCart && enableProductShoppingCart) 383 { 384 <div class="pdp-add-to-cart pdp-add-to-cart__container"> 385 <add-to-cart class="app-addtocart" 386 data-prodid="@product.Id" 387 data-variantid="@product.VariantId" 388 data-min-quantity="@product.PurchaseMinimumQuantity" 389 data-step="@product.PurchaseQuantityStep" 390 data-list-id="product_detail" 391 data-list-name="Product detail"> 392 </add-to-cart> 393 </div> 394 } 395 else 396 { 397 if (QuotePageID > 0) 398 { 399 <div class="pdp-request-quote__container"> 400 <a href="/Default.aspx?ID=@QuotePageID&ProdID=@product.Id&VarID=@product.VariantId" class="btn"> 401 <span class="btn__text">@Translate("ProductDetail.QuoteButton.Text", "Request quote")</span> 402 <i class="btn__icon @buttonIconClass"></i> 403 </a> 404 </div> 405 } 406 } 407 } 408409 @* Snippet PdpPaymentLogos *@ 410 @if (displayPrice && displayProductPrice && selectedPaymentLogos != null) 411 { 412 <section class="pdp-paymentlogos paymentlogos--small"> 413 <div class="footer-paymentoptions" data-paymentmethods="@selectedPaymentLogos"></div> 414 </section> 415 } 416417 </div> 418 </div> 419 </section> 420 </div> 421422 @helper renderReviewIndicator(string progressbarColor, double? value, int commentCount = 0) 423 { 424 string ratingPercentage = ((100 / 5) * value).ToString() + "%"; 425 string reviewTranslationKey = Translate("Reviews.Amount.Multiple", "{0} reviews"); 426 if (commentCount == 1) 427 { 428 reviewTranslationKey = Translate("Reviews.Amount.Singular", "{0} review"); 429 } 430431 <section style="display: flex; flex-direction: row; position: relative; align-items: center;"> 432 <div class="reviews__indicator" style="display: flex; flex-direction: row;"> 433 <div class="reviews__indicator-progressbar" style="width: @ratingPercentage; background-color: @progressbarColor;"></div> 434 <ul class="reviews__indicator-star-list"> 435 <li class="reviews__indicator-star-list-item"></li> 436 <li class="reviews__indicator-star-list-item"></li> 437 <li class="reviews__indicator-star-list-item"></li> 438 <li class="reviews__indicator-star-list-item"></li> 439 <li class="reviews__indicator-star-list-item"></li> 440 </ul> 441 </div> 442 <span style="display: flex; position: relative; font-size: 12px; line-height: initial;"> 443 @value / 5 444 <text>(@string.Format(reviewTranslationKey, commentCount))</text> 445 </span> 446 </section> 447 } 448
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetStickyAddToCart.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_b9d80da3b2e24ae88160f6aa1c8e1c98.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetStickyAddToCart.cshtml:line 32
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 3 @using Dynamicweb.Ecommerce.Prices; 4 @using Dynamicweb.Ecommerce.ProductCatalog; 5 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 6 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 8 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 9 10 @{ 11 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 12 ProductDetailWidgetStickyAddToCart _data = Dynamicweb.Content.Services.Items.GetItem("ProductDetailWidgetStickyAddToCart", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetStickyAddToCart>() ?? new ProductDetailWidgetStickyAddToCart(); 13 14 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 15 16 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 17 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 18 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 19 20 ProductViewModel product = new ProductViewModel(); 21 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 22 { 23 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 24 } 25 26 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 27 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 28 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 29 30 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 31 bool enableProductShoppingCart = enableShoppingCart; 32 if (!enableAddToCartForZeroPrices && product.Price.Price <= 0) 33 { 34 enableProductShoppingCart = false; 35 } 36 if (!enableAddToCartForOutOfStock && !(product.StockLevel > 0 || product.NeverOutOfstock)) 37 { 38 enableProductShoppingCart = false; 39 } 40 if (product.Discontinued) 41 { 42 enableProductShoppingCart = false; 43 } 44 45 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 46 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 47 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 48 if (pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) 49 { 50 WithVATBool = false; 51 } 52 if (pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) 53 { 54 WithVATBool = false; 55 } 56 57 bool hidePricesForGuests = EcommerceConfiguration.HidePricesForGuests; 58 bool hideZeroPrices = EcommerceConfiguration.HideZeroPrices; 59 bool displayPrice = hidePricesForGuests ? Pageview.User != null : true; 60 bool pricezero = product.Price.Price <= 0; 61 62 bool displayProductPrice = displayPrice; 63 if (hideZeroPrices && pricezero) 64 { 65 displayProductPrice = false; 66 } 67 68 string ProductdetailPriceSuffixWithVAT = Translate("Productdetail.Price.Suffix.WithVAT", "Incl. VAT"); 69 string ProductdetailPriceSuffixWithoutVAT = Translate("Productdetail.Price.Suffix.WithoutVAT", "Excl. VAT"); 70 string ProductdetailPriceSuffix = WithVATBool ? ProductdetailPriceSuffixWithVAT : ProductdetailPriceSuffixWithoutVAT; 71 72 var gtmValue = WithVATBool ? product.Price.PriceWithVat : product.Price.PriceWithoutVat; 73 var priceFormatted = WithVATBool ? product.Price.PriceWithVatFormatted : product.Price.PriceWithoutVatFormatted; 74 var priceBeforeDiscount = WithVATBool ? product.PriceBeforeDiscount.PriceWithVat : product.PriceBeforeDiscount.PriceWithoutVat; 75 var priceBeforeDiscountFormatted = WithVATBool ? product.PriceBeforeDiscount.PriceWithVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 76 var priceTotalDiscount = WithVATBool ? product.Discount.PriceWithVat : product.Discount.PriceWithoutVat; 77 var priceTotalDiscountFormatted = WithVATBool ? product.Discount.PriceWithVatFormatted : product.Discount.PriceWithoutVatFormatted; 78 double discountPercentage = Math.Round(((priceTotalDiscount / priceBeforeDiscount) * -100)); 79 bool hasDiscount = product.Discount.Price > 0; 80 81 string informativePrice = WithVATBool ? product.PriceInformative.PriceWithVatFormatted : product.PriceInformative.PriceWithoutVatFormatted; 82 if (EcommerceConfiguration.UseInformativePriceAsFromPrice && !string.IsNullOrWhiteSpace(informativePrice)) 83 { 84 double informativePriceValue = WithVATBool ? product.PriceInformative.PriceWithVat : product.PriceInformative.PriceWithoutVat; 85 hasDiscount = gtmValue < informativePriceValue; 86 if (hasDiscount) 87 { 88 priceBeforeDiscountFormatted = informativePrice; 89 discountPercentage = Math.Round((((gtmValue - informativePriceValue) / informativePriceValue) * 100)); 90 91 double yourProfitValue = informativePriceValue - gtmValue; 92 priceTotalDiscountFormatted = WithVATBool ? new PriceInfo { PriceWithVAT = yourProfitValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = yourProfitValue }.PriceWithoutVATFormatted; 93 } 94 } 95 96 string retailPrice = ""; 97 bool displayRetailPrice = EcommerceConfiguration.DisplayRetailPrice; 98 if (EcommerceConfiguration.DisplayRetailPriceForUsers && Pageview.User == null) 99 { 100 displayRetailPrice = false; 101 } 102 if (displayRetailPrice) 103 { 104 string priceFieldName = EcommerceConfiguration.RetailPriceField; 105 if (EcommerceConfiguration.RetailPriceIsDbPrice) 106 { 107 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 108 PriceContext customerPriceContext = new PriceContext(Dynamicweb.Ecommerce.Common.Context.Currency, Dynamicweb.Ecommerce.Common.Context.Country, null, null, Dynamicweb.Ecommerce.Common.Context.ReverseChargeForVatEnabled, DateTime.Now); 109 var customerPrice = p?.GetPrice(customerPriceContext); 110 if (customerPrice.Price > 0) 111 { 112 retailPrice = WithVATBool ? customerPrice.PriceWithVATFormatted : customerPrice.PriceWithoutVATFormatted; 113 } 114 } 115 else if (!string.IsNullOrWhiteSpace(priceFieldName)) 116 { 117 double customerPriceValue = 0.0; 118 if (product.ProductFields.TryGetValue(priceFieldName, out var fieldValue) && fieldValue.Value is double) 119 { 120 customerPriceValue = (double)fieldValue.Value; 121 } 122 if (customerPriceValue > 0) 123 { 124 retailPrice = WithVATBool ? new PriceInfo { PriceWithVAT = customerPriceValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = customerPriceValue }.PriceWithoutVATFormatted; 125 } 126 } 127 } 128129 bool isVariant = product.VariantId != ""; 130 int variantCount = product?.VariantInfo?.VariantInfo?.Count ?? 0; 131 bool hasVariants = !isVariant ? variantCount > 0 : false; 132133 var prod = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 134 string defaultImage = Dynamicweb.Ecommerce.Services.ProductImages.GetImagePath(prod); 135136 int QuotePageID = GetPageIdByNavigationTag("QuoteForm"); 137 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 138 } 139140 <!-- BEGIN Stickymenu --> 141 <section class="w-full stickymenu__replaceable__wrapper"> 142 <div class="container"> 143 <section class="stickymenu__replaceable"> 144145 <div class="stickymenu_product-info-wrapper"> 146 @if (!string.IsNullOrWhiteSpace(defaultImage)) 147 { 148 <figure class="stickymenu__product-image"> 149 <img src="/Admin/Public/GetImage.ashx?Image=@defaultImage&Crop=5&Format=webp&Quality=90&Compression=80&Height=60&Width=60" alt="@product.Name" width="60" height="60"> 150 </figure> 151 } 152 <div class="stickymenu_product-info"> 153 <p class="stickymenu__product-name"> 154 @if (!string.IsNullOrWhiteSpace(product.Manufacturer.Name)) 155 { 156 <span class="stickymenu__product-name--manufacturer">@product.Manufacturer.Name</span> 157 } 158 <span class="stickymenu__product-name--product">@product.Name</span> 159 </p> 160161 @if (displayPrice && displayProductPrice) 162 { 163 if (hasDiscount) 164 { 165 <div class="stickymenu_product__price__wrapper"> 166 <span class="stickymenu_product__price--old">@priceBeforeDiscountFormatted</span> 167 <span class="stickymenu_product__price--current">@priceFormatted</span> 168 <span class="stickymenu_product__price--suffix">@ProductdetailPriceSuffix</span> 169 <span class="stickymenu_product__price--profit">@Translate("Productdetail.YourProfitLabel", "Your profit:") @priceTotalDiscountFormatted</span> 170 </div> 171 } 172 else 173 { 174 <div class="stickymenu_product__price__wrapper"> 175 <span class="stickymenu_product__price--current">@priceFormatted</span> 176 <span class="stickymenu_product__price--suffix">@ProductdetailPriceSuffix</span> 177 </div> 178 } 179 } 180181 </div> 182 </div> 183184 @if(!hasVariants) 185 { 186 if (enableShoppingCart && enableProductShoppingCart) 187 { 188 <add-to-cart class="app-addtocart" 189 data-prodid="@product.Id" 190 data-variantid="@product.VariantId" 191 data-min-quantity="@product.PurchaseMinimumQuantity" 192 data-step="@product.PurchaseQuantityStep" 193 data-list-id="product_detail" 194 data-list-name="Product detail"> 195 </add-to-cart> 196 } 197 else 198 { 199 if (QuotePageID > 0) 200 { 201 <div class="py-4"> 202 <a href="/Default.aspx?ID=@QuotePageID&ProdID=@product.Id&VarID=@product.VariantId" class="btn product-detailpage__info-btn--request-quote"> 203 <span class="btn__text">@Translate("ProductDetail.StickyAddToCart.QuoteButton.Text", "Vraag een offerte aan")</span> 204 <i class="btn__icon @buttonIconClass"></i> 205 </a> 206 </div> 207 } 208 } 209 } 210211 </section> 212 </div> 213 </section> 214215 <script> 216 window.addEventListener('DOMContentLoaded', function (event) { 217 var stickyAddToCartEl = document.querySelector('.stickymenu__replaceable__wrapper'); 218 var pdpAddToCartElement = document.querySelector('.pdp-add-to-cart'); 219 var pdpQuoteButtonElement = document.querySelector('.pdp-quote-button'); 220 var scrollToTopEl = document.querySelector('#scroll-to-top'); 221222 if(pdpAddToCartElement || pdpQuoteButtonElement) { 223 var observer = new IntersectionObserver((entries, observer) => { 224 entries.forEach(entry => { 225 if(entry.intersectionRatio != 1 && window.scrollY >= entry.boundingClientRect.top) { 226 // Out of view 227 stickyAddToCartEl.classList.add('stickymenu__replaceable__wrapper--active'); 228 scrollToTopEl.classList.add('scroll-to-top--shown--lg'); 229 scrollToTopEl.style.setProperty('--sticky-bottom-offset', stickyAddToCartEl.offsetHeight + 'px'); 230 document.body.style.paddingBottom = stickyAddToCartEl.offsetHeight + 'px'; 231 } else { 232 // In view 233 stickyAddToCartEl.classList.remove('stickymenu__replaceable__wrapper--active'); 234 scrollToTopEl.classList.remove('scroll-to-top--shown--lg'); 235 scrollToTopEl.style.setProperty('--sticky-bottom-offset', '0px'); 236 document.body.style.paddingBottom = null; 237 } 238 }); 239 }, { 240 threshold: 1 241 }); 242243 if(pdpAddToCartElement) { 244 observer.observe(pdpAddToCartElement); 245 } else { 246 observer.observe(pdpQuoteButtonElement); 247 } 248249 } 250251 }); 252 </script> 253 <!-- END Stickymenu --> 254