Branding Stylesheet || ProductId : PROD51 VariantId :

pdp - t&p

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_f99f616c2bae455bb712ec8e2cea8168.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
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_fa962333245e47c0883db806b0716aaf.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 20
   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 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 6 7 @{ 8 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 9 ProductDetailWidgetImages _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 12 ProductViewModel product = new ProductViewModel(); 13 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 14 { 15 product = (ProductViewModel) Dynamicweb.Context.Current.Items["ProductDetails"]; 16 } 17 18 List<FieldOptionValueViewModel> productRibbons = null; 19 20 if (product != null && product.ProductFields["ProductRibbon"] != null) 21 { 22 productRibbons = (List<FieldOptionValueViewModel>)product.ProductFields["ProductRibbon"].Value; 23 } 24 25 //ProductObj ProductObj = (ProductObj)HttpContext.Current.Session["ProductDetails"]; 26 27 //ProductDetailObj DefaultProduct = ProductObj.Default[0]; 28 29 //ProductInfoObj DefaultProductInfo = DefaultProduct.ProductInfo; 30 31 //List<ProductAssetsObj> Assets = DefaultProduct.ProductImages.ProductAssets; 32 33 bool displayRibbon = _data.DisplayRibbon; 34 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 35 } 36 37 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 38 39 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.ProductRibbon) && displayRibbon) 40 { 41 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@ProductAndVariants.ProductDetail.ProductRibbon</span></p> 42 } 43 44 <section class="product-detailpage__images pdp__images-container"> 45 <section class="productimages pdp__images"> 46 47 <section class="productimages__wrapper"> 48 49 <div class="productimages__carousel-big hidden"> 50 51 <div class="productimages__item"> 52 <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" /> 53 </div> 54 55 @if (ProductAndVariants.Images.AssetImages != null) 56 { 57 foreach (Image Image in ProductAndVariants.Images.AssetImages) 58 { 59 <div class="productimages__item"> 60 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@Image.Value" /> 61 </div> 62 } 63 64 } 65 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.YoutubeProductVideo)) 66 { 67 68 string YoutubeProductVideo = ProductAndVariants.ProductDetail.YoutubeProductVideo; 69 70 <div class="productimages__item"> 71 <div class="productimages__carousel__video-container"> 72 <lite-youtube videoid="@YoutubeProductVideo" params="controls=1&loop=0&playlist=@YoutubeProductVideo&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1& origin=@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()&disablekb=0"></lite-youtube> 73 </div> 74 </div> 75 76 } 77 78 </div> 79 80 </section> 81 82 <div class="productimages__carousel-thumbnails hidden"> 83 84 <div class="productimages__thumbnail"> 85 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Crop=7&Format=webp&Quality=-1&width=160&height=100" alt="@ProductAndVariants.Images.Default" height="100" width="100" /> 86 </div> 87 88 @if (ProductAndVariants.Images.AssetImages != null) 89 { 90 91 foreach (Image Thumb in ProductAndVariants.Images.AssetImages) 92 { 93 <div class="productimages__thumbnail"> 94 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=160&height=100" alt="Thumbnail @Thumb.Value" width="100" height="100" /> 95 </div> 96 } 97 } 98 99 <div class="productimages__thumbnail productimages__thumbnail--video pin-t mr-4" aria-hidden="true" style="position: absolute; left: 0px; transform: translateX(232%);"> 100 <img class="h-full" src="https://img.youtube.com/vi/@ProductAndVariants.ProductDetail.YoutubeProductVideo/0.jpg" alt="Video preview RIDGID K-45 AF-5 3" height="84" width="84"> 101 <span class="video-icon"> 102 <i class="fas fa-play"></i> 103 </span> 104 </div> 105 </div> 106 107 108 <section class="productimages__wrapper"> 109 110 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 111 { 112 <img src="/Admin/Public/GetImage.ashx?Image=/Files/@ProductAndVariants.Manufacturer.Logo&Crop=7&Format=webp&Quality=90&Compression=80&width=150" class="manufacturer__logo" alt="Manufacturer" width="150" height="50" /> 113 } 114 115 @*<div class="productimages__carousel-big hidden"> 116 @foreach (var i in product.AssetCategories) 117 { 118 foreach (var image in i.Assets) 119 { 120 <div class="productimages__item"> 121 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@image.Name" /> 122 </div> 123 } 124 } 125 </div>*@ 126 </section> 127 128 @*<div class="productimages__carousel-thumbnails hidden"> 129 @foreach (var i in product.AssetCategories) 130 { 131 foreach (var image in i.Assets) 132 { 133 <div class="productimages__thumbnail"> 134 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@image.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=160&height=100" alt="Thumbnail @image.Name" width="100" height="100" /> 135 </div> 136 } 137 } 138 </div>*@ 139 140 141 </section> 142 </section> 143 </div> 144 145 <style> 146 .productimages__item { 147 height: 400px; 148 } 149 </style> 150
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_1546f5ddd2084372ac1c8aa149f78d83.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 96 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 97 @if (displayPrice && displayProductPrice) 98 { 99 <div class="pdp-price__container"> 100 @if (hasDiscount) 101 { 102 <p class="pdp-price--original">@priceBeforeDiscountFormatted</p> 103 <section class="pdp-price__subcontainer"> 104 <span class="pdp-price">@priceFormatted</span> 105 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 106 <span class="pdp-price__percentage">@discountPercentage%</span> 107 </section> 108 } 109 else 110 { 111 <section class="pdp-price__subcontainer"> 112 <span class="pdp-price">@priceFormatted</span> 113 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 114 </section> 115 } 116 @if (!string.IsNullOrWhiteSpace(retailPrice)) 117 { 118 <p class="pdp-price__retail-price"> 119 @String.Format(Translate("ProductBlockTitle.RetailPrice", "Retail price: {0}"), retailPrice) 120 </p> 121 } 122 @if (hasDiscount) 123 { 124 <p class="pdp-price__yourprofit"> 125 @Translate("Productdetail.YourProfitLabel", "Your profit:") @priceTotalDiscountFormatted 126 </p> 127 } 128 </div> 129 } 130 </div> 131
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_10a859b1e5b94b52b6e5c0049d6e8a33.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetStock.cshtml:line 38
   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 32 <div id="@paragraphID" class="pdp-paragraph"> 33 @if(enableProductStock && !string.IsNullOrWhiteSpace(stockFormat)) 34 { 35 if(stockFormat == "text") { 36 StockLocation stockLocation = Dynamicweb.Ecommerce.Services.StockService.GetStockLocation(Pageview.Area.StockLocationID); 37 var currentProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, "", Pageview.Area.EcomLanguageId); 38 string stockText = Dynamicweb.Ecommerce.Services.Products.GetStockStatus(currentProduct, stockLocation, Pageview.Area.EcomLanguageId)?.Text; 39 40 if (!string.IsNullOrWhiteSpace(stockText)) 41 { 42 <p class="pdp-stockstate @stockStateClass">@string.Format(stockText, product.StockLevel)</p> 43 } 44 } 45 else 46 { 47 string translationTag = ""; 48 if(product.NeverOutOfstock) 49 { 50 translationTag = Translate("ProductBlockStockInfo.AmountInStock", "In stock"); 51 } 52 else if(product.StockLevel == 1) 53 { 54 translationTag = Translate("ProductBlockStockInfo.AmountInStockSingle", "{0} product in stock"); 55 } 56 else if(product.StockLevel > 1) 57 { 58 translationTag = Translate("ProductBlockStockInfo.AmountInStockMultiple", "{0} products in stock"); 59 } 60 else if(!inStock) 61 { 62 translationTag = Translate("ProductBlockStockInfo.AmountOutOfStock", "Out of stock"); 63 } 64 65 <p class="pdp-stockstate @stockStateClass">@string.Format(translationTag, product.StockLevel)</p> 66 } 67 } 68 </div> 69
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_00d9409a29fb4e7a8f40ec3f23abd55b.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetAddToCart.cshtml:line 33
   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 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 6 7 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 8 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 9 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 10 11 @{ 12 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 13 ProductDetailWidgetAddToCart _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetAddToCart", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetAddToCart>() ?? new ProductDetailWidgetAddToCart(); 14 15 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 16 17 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 18 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 19 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 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 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 28 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 29 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 30 31 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 32 bool enableProductShoppingCart = enableShoppingCart; 33 if (!enableAddToCartForZeroPrices && product.Price.Price <= 0) 34 { 35 enableProductShoppingCart = false; 36 } 37 if (!enableAddToCartForOutOfStock && !(product.StockLevel > 0 || product.NeverOutOfstock)) 38 { 39 enableProductShoppingCart = false; 40 } 41 42 int QuotePageID = GetPageIdByNavigationTag("QuoteForm"); 43 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 44 } 45 46 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 47 48 @if (product.Price.Price <= 0 && !string.IsNullOrWhiteSpace(_data.OffertePageId)) 49 { 50 ButtonConfiguration btnStyle = _data.ButtonConfiguration; 51 string btnStyleClass = btnStyle != null ? $"btn--{btnStyle.Id}" : ""; 52 53 string btnTarget = "javascript:void(0);"; 54 55 if (!string.IsNullOrWhiteSpace(_data.OffertePageId)) 56 { 57 btnTarget = $"/Default.aspx?ID={_data.OffertePageId}&ProdID={product.Id}"; 58 if (!string.IsNullOrWhiteSpace(product.VariantId)) 59 { 60 btnTarget = $"{btnTarget}&VarID={product.VariantId}"; 61 } 62 } 63 64 <style> 65 @if (btnStyle != null) 66 { 67 @btnStyle.GetButtonStylesheet() 68 } 69 </style> 70 <div class="pdp-quote-button"> 71 <a href="@btnTarget" class="btn default-btn @btnStyleClass"> 72 <span class="btn__text">@_data.ButtonText</span> 73 <i class="btn__icon @_data.ButtonIcon"></i> 74 </a> 75 </div> 76 77 } 78 else 79 { 80 81 <div class="pdp-add-to-cart pdp-add-to-cart__container"> 82 <add-to-cart class="app-addtocart" 83 data-prodid="@product.Id" 84 data-variantid="@product.VariantId" 85 data-min-quantity="@product.PurchaseMinimumQuantity" 86 data-step="@product.PurchaseQuantityStep" 87 data-list-id="product_detail" 88 data-list-name="Product detail"> 89 </add-to-cart> 90 </div> 91 92 } 93 94 @*@if (enableShoppingCart && enableProductShoppingCart) 95 { 96 <div class="pdp-add-to-cart pdp-add-to-cart__container"> 97 <add-to-cart class="app-addtocart" 98 data-prodid="@product.Id" 99 data-variantid="@product.VariantId" 100 data-min-quantity="@product.PurchaseMinimumQuantity" 101 data-step="@product.PurchaseQuantityStep" 102 data-list-id="product_detail" 103 data-list-name="Product detail"> 104 </add-to-cart> 105 </div> 106 } 107 else 108 { 109 if (QuotePageID > 0) 110 { 111 <div class="pdp-request-quote__container"> 112 <a href="/Default.aspx?ID=@QuotePageID&ProdID=@product.Id&VarID=@product.VariantId" class="btn"> 113 <span class="btn__text">@Translate("ProductDetail.QuoteButton.Text", "Request quote")</span> 114 <i class="btn__icon @buttonIconClass"></i> 115 </a> 116 </div> 117 } 118 }*@ 119 </div> 120
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_7b5d17bc4a594ab9ad7776ea2c22029c.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
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_eac649ac069f437bae28c62cdb11a7e2.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/ProductDetailWidgetDescription.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_a88ab08b7f224ad290273df40597c307.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetDescription.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 ProductDetailWidgetDescription _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetDescription", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetDescription>() ?? new ProductDetailWidgetDescription(); 10 ProductAndVariantsObj _product = (ProductAndVariantsObj)Dynamicweb.Context.Current.Items["ProductAndVariants"]; 11 } 12 13 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 14 <div class="pdp-short-description"> 15 @_product.ProductInfo.ShortDescription 16 17 @if (!string.IsNullOrWhiteSpace(_product.ProductInfo.LongDescription)) 18 { 19 <p class="pdp-short-description__readmore"> 20 <a href="#pdp-tabs">@Translate("Productdetail.Readmore", "Read more")</a> 21 </p> 22 } 23 24 @_product.ProductDetail.YoutubeProductVideo 25 </div> 26 </div> 27
Reviews

Reviews

/ 5 (1 review)
0 reviews
0 reviews
0 reviews
0 reviews
0 reviews

Write a review

Write a review

5 / 5

Test

Sander | 15 May 2025

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ë

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_ca4f4d28b7c143b5a8699e643b373d25.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetSecondaryInfo.cshtml:line 27
   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 string largeImage = product.DefaultImage.Value; 28 if (ProductAndVariants != null && ProductAndVariants.Images != null && ProductAndVariants.Images.Default != null) 29 { 30 largeImage = ProductAndVariants.Images.Default; 31 } 32 33 string productName = product.Name; 34 string productSubTitle = product.ProductFields["ProductDetailSubtitle"].Value.ToString(); 35 36 // Review 37 Dynamicweb.Content.Commenting.CommentCollection comments = Dynamicweb.Content.Commenting.Comment.GetComments("ecomProduct", product.Id, Pageview.Area.EcomLanguageId); 38 double? productRating = product.Rating; 39 int productCommentCount = comments.Count; 40 41 // Stock 42 bool hideStockForGuests = EcommerceConfiguration.HideStockForGuests; 43 bool enableProductStock = hideStockForGuests ? Pageview.User != null : true; 44 string stockFormat = EcommerceConfiguration.StockFormat; 45 bool inStock = product.StockLevel > 0 || product.NeverOutOfstock; 46 string stockStateClass = inStock ? "pdp-stockstate--instock" : "pdp-stockstate--outofstock"; 47 48 // Tagline 49 string productTagline = product.ProductFields != null && product.ProductFields.ContainsKey("ProductTagline") ? product.ProductFields["ProductTagline"].Value.ToString() : ""; 50 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false; 51 string productDetailPageTagline = ""; 52 if (!isVisualEditor) 53 { 54 productDetailPageTagline = Pageview.Item["Tagline"].ToString(); 55 } 56 57 // Price 58 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 59 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 60 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 61 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 62 WithVATBool = false; 63 } 64 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 65 WithVATBool = false; 66 } 67 68 bool hidePricesForGuests = EcommerceConfiguration.HidePricesForGuests; 69 bool hideZeroPrices = EcommerceConfiguration.HideZeroPrices; 70 bool displayPrice = hidePricesForGuests ? Pageview.User != null : true; 71 bool pricezero = product.Price.Price <= 0; 72 73 bool displayProductPrice = displayPrice; 74 if (hideZeroPrices && pricezero) 75 { 76 displayProductPrice = false; 77 } 78 79 string ProductdetailPriceSuffixWithVAT = Translate("Productdetail.Price.Suffix.WithVAT", "Incl. VAT"); 80 string ProductdetailPriceSuffixWithoutVAT = Translate("Productdetail.Price.Suffix.WithoutVAT", "Excl. VAT"); 81 string ProductdetailPriceSuffix = WithVATBool ? ProductdetailPriceSuffixWithVAT : ProductdetailPriceSuffixWithoutVAT; 82 83 var gtmValue = WithVATBool ? product.Price.PriceWithVat : product.Price.PriceWithoutVat; 84 var priceFormatted = WithVATBool ? product.Price.PriceWithVatFormatted : product.Price.PriceWithoutVatFormatted; 85 var priceBeforeDiscount = WithVATBool ? product.PriceBeforeDiscount.PriceWithVat : product.PriceBeforeDiscount.PriceWithoutVat; 86 var priceBeforeDiscountFormatted = WithVATBool ? product.PriceBeforeDiscount.PriceWithVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 87 var priceTotalDiscount = WithVATBool ? product.Discount.PriceWithVat : product.Discount.PriceWithoutVat; 88 var priceTotalDiscountFormatted = WithVATBool ? product.Discount.PriceWithVatFormatted : product.Discount.PriceWithoutVatFormatted; 89 double discountPercentage = Math.Round(((priceTotalDiscount / priceBeforeDiscount) * -100)); 90 bool hasDiscount = product.Discount.Price > 0; 91 92 string informativePrice = WithVATBool ? product.PriceInformative.PriceWithVatFormatted : product.PriceInformative.PriceWithoutVatFormatted; 93 if (EcommerceConfiguration.UseInformativePriceAsFromPrice && !string.IsNullOrWhiteSpace(informativePrice)) 94 { 95 double informativePriceValue = WithVATBool ? product.PriceInformative.PriceWithVat : product.PriceInformative.PriceWithoutVat; 96 hasDiscount = gtmValue < informativePriceValue; 97 if (hasDiscount) 98 { 99 priceBeforeDiscountFormatted = informativePrice; 100 discountPercentage = Math.Round((((gtmValue - informativePriceValue) / informativePriceValue) * 100)); 101 102 double yourProfitValue = informativePriceValue - gtmValue; 103 priceTotalDiscountFormatted = WithVATBool ? new PriceInfo { PriceWithVAT = yourProfitValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = yourProfitValue }.PriceWithoutVATFormatted; 104 } 105 } 106 107 string retailPrice = ""; 108 bool displayRetailPrice = EcommerceConfiguration.DisplayRetailPrice; 109 if(EcommerceConfiguration.DisplayRetailPriceForUsers && Pageview.User == null) { 110 displayRetailPrice = false; 111 } 112 if(displayRetailPrice) { 113 string priceFieldName = EcommerceConfiguration.RetailPriceField; 114 if(EcommerceConfiguration.RetailPriceIsDbPrice) { 115 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 116 PriceContext customerPriceContext = new PriceContext(Dynamicweb.Ecommerce.Common.Context.Currency, Dynamicweb.Ecommerce.Common.Context.Country, null, null, Dynamicweb.Ecommerce.Common.Context.ReverseChargeForVatEnabled, DateTime.Now); 117 var customerPrice = p?.GetPrice(customerPriceContext); 118 if(customerPrice.Price > 0) { 119 retailPrice = WithVATBool ? customerPrice.PriceWithVATFormatted : customerPrice.PriceWithoutVATFormatted; 120 } 121 } else if(!string.IsNullOrWhiteSpace(priceFieldName)) { 122 double customerPriceValue = 0.0; 123 if (product.ProductFields.TryGetValue(priceFieldName, out var fieldValue) && fieldValue.Value is double) { 124 customerPriceValue = (double)fieldValue.Value; 125 } 126 if(customerPriceValue > 0) { 127 retailPrice = WithVATBool ? new PriceInfo { PriceWithVAT = customerPriceValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = customerPriceValue }.PriceWithoutVATFormatted; 128 } 129 } 130 } 131 132 // Add to cart 133 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 134 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 135 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 136 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 137 bool enableProductShoppingCart = enableShoppingCart; 138 if (!enableAddToCartForZeroPrices && product.Price.Price <= 0) 139 { 140 enableProductShoppingCart = false; 141 } 142 if (!enableAddToCartForOutOfStock && !(product.StockLevel > 0 || product.NeverOutOfstock)) 143 { 144 enableProductShoppingCart = false; 145 } 146 147 int QuotePageID = GetPageIdByNavigationTag("QuoteForm"); 148 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 149 150 // Variant selector 151 int pageId = Model.PageID; 152 string variantSelection = product.VariantId.Replace(".", ","); 153 154 List<string[]> variantCombinationsIds = new List<string[]>(); 155 List<List<string>> variantGroupsOptionIds = new List<List<string>>(); 156 157 var variantCombinations = Dynamicweb.Ecommerce.Services.VariantCombinations.GetVariantCombinations(product.Id); 158 var variantGroups = Dynamicweb.Ecommerce.Services.VariantGroups.GetVariantGroupsByProductId(product.Id); 159 160 foreach (var combination in variantCombinations) 161 { 162 variantCombinationsIds.Add(combination.VariantId.Split('.')); 163 } 164 string variantCombinationsIdsJson = JsonConvert.SerializeObject(variantCombinationsIds).Replace("\"", "\'"); 165 166 foreach (var variantGroup in variantGroups) 167 { 168 var variantsObject = new List<string>(); 169 foreach (var variantOption in variantGroup.GetAllVariantOptions()) 170 { 171 variantsObject.Add(variantOption.Id); 172 } 173 variantGroupsOptionIds.Add(variantsObject); 174 } 175 string variantGroupsOptionIdsJson = JsonConvert.SerializeObject(variantGroupsOptionIds).Replace("\"", "\'"); 176 177 var selectedPaymentLogos = Pageview.Area.Item["FooterPaymentLogos"]; 178 } 179 <div id="@paragraphID" class="pdp-paragraph"> 180 <section class="pdp-secondary-info"> 181 <div class="container pdp-secondary-info__container"> 182 <div class="pdp-secondary-info__column"> 183 @if (!string.IsNullOrWhiteSpace(largeImage)) 184 { 185 <figure class="pdp-secondary-info__image-container"> 186 <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" /> 187 </figure> 188 } 189 </div> 190 <div class="pdp-secondary-info__column"> 191 @if (!string.IsNullOrWhiteSpace(productSubTitle)) 192 { 193 <h3 class="pdp-header__subtitle"> 194 <span class="pdp-header__subtitle-product">@productSubTitle</span> 195 </h3> 196 } 197 198 <h2 class="pdp-header__title"> 199 @if (product.Manufacturer != null) 200 { 201 <span class="pdp-header__manufacturer">@product.Manufacturer.Name</span> 202 } 203 <span class="pdp-header__productname"> 204 @productName 205 </span> 206 </h2> 207 208 @if (productCommentCount > 0) 209 { 210 <div class="pdp-review-indicator"> 211 @renderReviewIndicator("#86C440", productRating, productCommentCount) 212 </div> 213 } 214 215 @if (enableProductStock && !string.IsNullOrWhiteSpace(stockFormat)) 216 { 217 if (stockFormat == "text") 218 { 219 StockLocation stockLocation = Dynamicweb.Ecommerce.Services.StockService.GetStockLocation(Pageview.Area.StockLocationID); 220 var currentProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, "", Pageview.Area.EcomLanguageId); 221 string stockText = Dynamicweb.Ecommerce.Services.Products.GetStockStatus(currentProduct, stockLocation, Pageview.Area.EcomLanguageId)?.Text; 222 223 if (!string.IsNullOrWhiteSpace(stockText)) 224 { 225 <p class="pdp-stockstate @stockStateClass">@string.Format(stockText, product.StockLevel)</p> 226 } 227 } 228 else 229 { 230 string translationTag = ""; 231 if (product.NeverOutOfstock) 232 { 233 translationTag = Translate("ProductBlockStockInfo.AmountInStock", "In stock"); 234 } 235 else if (product.StockLevel == 1) 236 { 237 translationTag = Translate("ProductBlockStockInfo.AmountInStockSingle", "{0} product in stock"); 238 } 239 else if (product.StockLevel > 1) 240 { 241 translationTag = Translate("ProductBlockStockInfo.AmountInStockMultiple", "{0} products in stock"); 242 } 243 else if (!inStock) 244 { 245 translationTag = Translate("ProductBlockStockInfo.AmountOutOfStock", "Out of stock"); 246 } 247 248 <p class="pdp-stockstate @stockStateClass">@string.Format(translationTag, product.StockLevel)</p> 249 } 250 } 251 252 @if (!string.IsNullOrWhiteSpace(productDetailPageTagline)) 253 { 254 <div class="pdp-tagline__container"> 255 @if (!string.IsNullOrWhiteSpace(productDetailPageTagline)) 256 { 257 <p class="pdp-tagline"> 258 @productDetailPageTagline 259 </p> 260 } 261 </div> 262 } 263 </div> 264 <div class="pdp-secondary-info__column"> 265 266 @if (!string.IsNullOrWhiteSpace(product.Number)) 267 { 268 <p class="pdp-articlenumber"> 269 @Translate("Productdetail.ArticleNumber.Prefix", "Article number:") @product.Number 270 </p> 271 } 272 273 @if (displayPrice && displayProductPrice) 274 { 275 <div class="pdp-price__container"> 276 @if (hasDiscount) 277 { 278 <p class="pdp-price--original">@priceBeforeDiscountFormatted</p> 279 <section class="pdp-price__subcontainer"> 280 <span class="pdp-price">@priceFormatted</span> 281 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 282 <span class="pdp-price__percentage">@discountPercentage%</span> 283 </section> 284 } 285 else 286 { 287 <section class="pdp-price__subcontainer"> 288 <span class="pdp-price">@priceFormatted</span> 289 <span class="pdp-price--suffix">@ProductdetailPriceSuffix</span> 290 </section> 291 } 292 @if (!string.IsNullOrWhiteSpace(retailPrice)) 293 { 294 <p class="pdp-price__retail-price"> 295 @String.Format(Translate("ProductBlockTitle.RetailPrice", "Retail price: {0}"), retailPrice) 296 </p> 297 } 298 @if (hasDiscount) 299 { 300 <p class="pdp-price__yourprofit"> 301 @Translate("Productdetail.YourProfitLabel", "Your profit:") @priceTotalDiscountFormatted 302 </p> 303 } 304 </div> 305 } 306 307 @if (variantGroups.Any()) 308 { 309 <div class="product-variants__wrapper pdp-variants"> 310 <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"> 311 @foreach (var variantGroup in variantGroups) 312 { 313 bool containsImage = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.SmallImage)); 314 bool containsColor = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.Color)); 315 string variantGroupName = variantGroup.GetName(Pageview.Area.EcomLanguageId); 316 string variantGroupId = variantGroup.Id; 317 var variantGroupOptions = variantGroup.GetAllVariantOptions(); 318 319 if (containsImage || containsColor) 320 { 321 <p class="product-variants__title">@variantGroupName</p> 322 323 <div class="product-variants__options-wrapper"> 324 @foreach (VariantOption variantOption in variantGroupOptions) 325 { 326 string variantOptionName = variantOption.GetName(Pageview.Area.EcomLanguageId); 327 328 if (!string.IsNullOrEmpty(variantOption.SmallImage)) 329 { 330 string variantImage = "/Files/" + variantOption.SmallImage; 331 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--image"> 332 <img src="@variantImage" alt="@variantOptionName" title="@variantOptionName" /> 333 </div> 334 } 335 else if (!string.IsNullOrEmpty(variantOption.Color)) 336 { 337 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--color"> 338 <span title="@variantOptionName" style="--variant-color: @variantOption.Color;"></span> 339 </div> 340 } 341 else 342 { 343 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn">@variantOptionName</button> 344 } 345 } 346 </div> 347 } 348 else 349 { 350 <p class="product-variants__title">@variantGroupName</p> 351 352 <div class="product-variants__dropdown"> 353 <div class="product-variants__dropdown-wrapper"> 354 355 <button class="product-variants__toggle"> 356 <span>@Translate(string.Format("VariantDropdown.Placeholder.{0}", variantGroupName), "Select your option")</span> 357 <i class="fal fa-chevron-down"></i> 358 </button> 359 360 <div class="product-variants__options-wrapper product-variants__options-wrapper--dropdown product-variants__dropdown-options-wrapper"> 361 @foreach (VariantOption variantOption in variantGroupOptions) 362 { 363 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__dropdown-btn"> 364 @variantOption.GetName(Pageview.Area.EcomLanguageId) 365 </button> 366 } 367 </div> 368 </div> 369 </div> 370 } 371 } 372 </div> 373 </div> 374 } 375 376 @if (enableShoppingCart && enableProductShoppingCart) 377 { 378 <div class="pdp-add-to-cart pdp-add-to-cart__container"> 379 <add-to-cart class="app-addtocart" 380 data-prodid="@product.Id" 381 data-variantid="@product.VariantId" 382 data-min-quantity="@product.PurchaseMinimumQuantity" 383 data-step="@product.PurchaseQuantityStep" 384 data-list-id="product_detail" 385 data-list-name="Product detail"> 386 </add-to-cart> 387 </div> 388 } 389 else 390 { 391 if (QuotePageID > 0) 392 { 393 <div class="pdp-request-quote__container"> 394 <a href="/Default.aspx?ID=@QuotePageID&ProdID=@product.Id&VarID=@product.VariantId" class="btn"> 395 <span class="btn__text">@Translate("ProductDetail.QuoteButton.Text", "Request quote")</span> 396 <i class="btn__icon @buttonIconClass"></i> 397 </a> 398 </div> 399 } 400 } 401 402 @* Snippet PdpPaymentLogos *@ 403 @if (displayPrice && displayProductPrice && selectedPaymentLogos != null) 404 { 405 <section class="pdp-paymentlogos paymentlogos--small"> 406 <div class="footer-paymentoptions" data-paymentmethods="@selectedPaymentLogos"></div> 407 </section> 408 } 409 410 </div> 411 </div> 412 </section> 413 </div> 414 415 @helper renderReviewIndicator(string progressbarColor, double? value, int commentCount = 0) 416 { 417 string ratingPercentage = ((100 / 5) * value).ToString() + "%"; 418 string reviewTranslationKey = Translate("Reviews.Amount.Multiple", "{0} reviews"); 419 if (commentCount == 1) 420 { 421 reviewTranslationKey = Translate("Reviews.Amount.Singular", "{0} review"); 422 } 423 424 <section style="display: flex; flex-direction: row; position: relative; align-items: center;"> 425 <div class="reviews__indicator" style="display: flex; flex-direction: row;"> 426 <div class="reviews__indicator-progressbar" style="width: @ratingPercentage; background-color: @progressbarColor;"></div> 427 <ul class="reviews__indicator-star-list"> 428 <li class="reviews__indicator-star-list-item"></li> 429 <li class="reviews__indicator-star-list-item"></li> 430 <li class="reviews__indicator-star-list-item"></li> 431 <li class="reviews__indicator-star-list-item"></li> 432 <li class="reviews__indicator-star-list-item"></li> 433 </ul> 434 </div> 435 <span style="display: flex; position: relative; font-size: 12px; line-height: initial;"> 436 @value / 5 437 <text>(@string.Format(reviewTranslationKey, commentCount))</text> 438 </span> 439 </section> 440 } 441