Branding Stylesheet || ProductId : PROD313 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_280558f10a4d4dc296605af8f05d792e.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_606e476459c44403ab6a8a22bfe41877.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/ProductDetailWidgetVariantSelector.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_1308845d321f476c9295cb6404cf92fe.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetVariantSelector.cshtml:line 17
   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.Variants; 5 @using Newtonsoft.Json; 6 7 @{ 8 int pageId = Model.PageID; 9 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 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 string variantSelection = product.VariantId.Replace(".", ","); 18 19 List<string[]> variantCombinationsIds = new List<string[]>(); 20 List<List<string>> variantGroupsOptionIds = new List<List<string>>(); 21 22 var variantCombinations = Dynamicweb.Ecommerce.Services.VariantCombinations.GetVariantCombinations(product.Id); 23 var variantGroups = Dynamicweb.Ecommerce.Services.VariantGroups.GetVariantGroupsByProductId(product.Id); 24 25 foreach (var combination in variantCombinations) 26 { 27 variantCombinationsIds.Add(combination.VariantId.Split('.')); 28 } 29 string variantCombinationsIdsJson = JsonConvert.SerializeObject(variantCombinationsIds).Replace("\"", "\'"); 30 31 foreach (var variantGroup in variantGroups) 32 { 33 var variantsObject = new List<string>(); 34 foreach (var variantOption in variantGroup.GetAllVariantOptions()) 35 { 36 variantsObject.Add(variantOption.Id); 37 } 38 variantGroupsOptionIds.Add(variantsObject); 39 } 40 string variantGroupsOptionIdsJson = JsonConvert.SerializeObject(variantGroupsOptionIds).Replace("\"", "\'"); 41 42 } 43 44 <div id="@paragraphID" class="pdp-paragraph"> 45 @if(variantGroups.Any()) { 46 <div class="product-variants__wrapper pdp-variants"> 47 <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"> 48 @foreach (var variantGroup in variantGroups) 49 { 50 bool containsImage = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.SmallImage)); 51 bool containsColor = variantGroup.GetAllVariantOptions().Any(v => !string.IsNullOrEmpty(v.Color)); 52 string variantGroupName = variantGroup.GetName(Pageview.Area.EcomLanguageId); 53 string variantGroupId = variantGroup.Id; 54 var variantGroupOptions = variantGroup.GetAllVariantOptions(); 55 56 if (containsImage || containsColor) 57 { 58 <p class="product-variants__title">@variantGroupName</p> 59 60 <div class="product-variants__options-wrapper"> 61 @foreach (VariantOption variantOption in variantGroupOptions) 62 { 63 string variantOptionName = variantOption.GetName(Pageview.Area.EcomLanguageId); 64 65 if (!string.IsNullOrEmpty(variantOption.SmallImage)) 66 { 67 string variantImage = "/Files/" + variantOption.SmallImage; 68 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--image"> 69 <img src="@variantImage" alt="@variantOptionName" title="@variantOptionName" /> 70 </div> 71 } 72 else if (!string.IsNullOrEmpty(variantOption.Color)) 73 { 74 <div data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn product-variants__btn--color"> 75 <span title="@variantOptionName" style="--variant-color: @variantOption.Color;"></span> 76 </div> 77 } 78 else 79 { 80 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__btn">@variantOptionName</button> 81 } 82 } 83 </div> 84 } 85 else 86 { 87 <p class="product-variants__title">@variantGroupName</p> 88 89 <div class="product-variants__dropdown"> 90 <div class="product-variants__dropdown-wrapper"> 91 92 <button class="product-variants__toggle"> 93 <span>@Translate(string.Format("VariantDropdown.Placeholder.{0}", variantGroupName), "Select your option")</span> 94 <i class="fal fa-chevron-down"></i> 95 </button> 96 97 <div class="product-variants__options-wrapper product-variants__options-wrapper--dropdown product-variants__dropdown-options-wrapper"> 98 @foreach (VariantOption variantOption in variantGroupOptions) 99 { 100 <button type="button" data-variant-id="@variantOption.Id" data-variant-group="@variantGroupId" class="js-variant-option product-variants__dropdown-btn"> 101 @variantOption.GetName(Pageview.Area.EcomLanguageId) 102 </button> 103 } 104 </div> 105 </div> 106 </div> 107 } 108 } 109 </div> 110 </div> 111 } 112 </div> 113
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_bb4a6eb93e15482d8703c51a0e17c7d6.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_baeec9e802c74d519f9bac667b9d56fb.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

Voor 12:00 uur besteld, morgen in huis

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_5cb82d311a54421e8f813ff2a3dc3fbb.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_ac499f4e2dc040dfaa2ef9678f526b6b.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_6404d2c42ba74322afa53953fc536ba4.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_77cad06205f34d41a33997b110416e42.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
Benötigen Sie professionellen Rat?

Fragen Sie einen unserer Spezialisten.

Tel.: +31 (0)72 540 66 99

E-mail: info@koks.com

 

Rufen Sie mich zurĂĽck
  • Produktinformation
  • Spezifikationen
  • Reviews
  • Accessoires
  • Andere uitvoeringen
  • Optionen
  • Vorteile
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_263282db37344f458e8a40a473b91b2c.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/ProductDetailWidgetStandardSpecifications.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_1bd9c4f929f049cf865acebb86530e7d.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetStandardSpecifications.cshtml:line 14
   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.Frontend; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Configuration.EcomConfiguration.ProductDetail.Widgets; 5 @using Dynamicweb.Ecommerce.ProductCatalog; 6 7 @{ 8 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 9 10 ProductDetailWidgetStandardSpecifications _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetStandardSpecifications", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetStandardSpecifications>() ?? new ProductDetailWidgetStandardSpecifications(); 11 12 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 13 14 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(ProductAndVariants.ProductId, ProductAndVariants.ProductVariantId, Pageview.Area.EcomLanguageId); 15 16 var product = new ProductViewModel 17 { 18 Number = p.Number 19 }; 20 21 string productNumber = product.Number; 22 string manufacturerName = ProductAndVariants?.Manufacturer?.Name ?? ""; 23 string productEan = ProductAndVariants?.ProductInfo?.EAN ?? ""; 24 } 25 26 @if (!string.IsNullOrWhiteSpace(manufacturerName) || !string.IsNullOrWhiteSpace(productNumber) || !string.IsNullOrWhiteSpace(productEan)) 27 { 28 <section id="@paragraphID" @_data.CssClass> 29 <h2>@Translate("Productdetail.Specifications", "Specificaties")</h2> 30 <section> 31 <div class="productdetail_specifications"> 32 @if (!string.IsNullOrEmpty(manufacturerName)) 33 { 34 <label>@Translate("Productdetail.Manufacturer", "Fabrikant: ") @manufacturerName</label> 35 } 36 @if (!string.IsNullOrEmpty(productNumber)) 37 { 38 <label>@Translate("Productdetail.ProductNumber", "Artikelnummer: ") @productNumber</label> 39 } 40 @if (!string.IsNullOrEmpty(productEan)) 41 { 42 <label>@Translate("Productdetail.EANCode", "EAN code: ") @productEan</label> 43 } 44 </div> 45 </section> 46 </section> 47 } 48 49 <style> 50 .productdetail_specifications { 51 flex-direction: column; 52 display: flex; 53 } 54 </style> 55
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetVideo.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_eaebc411e4cc4ec3b1b313e330d2a375.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetVideo.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.Configuration.EcomConfiguration.ProductDetail.Widgets; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 @using System.Text.RegularExpressions; 6 7 @{ 8 var paragraphID = Pageview.CurrentParagraph.ID; 9 ProductDetailWidgetVideo _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetVideo", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetVideo>() ?? new ProductDetailWidgetVideo(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 12 string videoUrl = ProductAndVariants.ProductDetail == null ? null : ProductAndVariants.ProductDetail.YoutubeProductVideo; 13 string videoId = ""; 14 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 15 16 } 17 18 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 19 @{ 20 if (!string.IsNullOrWhiteSpace(videoUrl)) 21 { 22 // Regex for https://youtu.be/{videoId} 23 Match match = new Regex(@".be\/(.[^?]*)").Match(videoUrl); 24 if (match.Success) 25 { 26 videoId = match.Groups[1].Value; 27 28 <div class="product-video"> 29 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 30 </div> 31 } 32 33 // Regex for https://www.youtube.com/watch?v={videoId} 34 match = new Regex(@"v=([^&]+)").Match(videoUrl); 35 if (match.Success) 36 { 37 videoId = match.Groups[1].Value; 38 39 <div class="product-video"> 40 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 41 </div> 42 } 43 44 // Regex for https://player.vimeo.com/video/{videoId} 45 match = new Regex("(?:http:|https:|)\\/\\/(?:player.|www.)?vimeo\\.com\\/(?:video\\/|embed\\/|watch\\?\\S*v=|v\\/)?(\\d*)", RegexOptions.IgnoreCase).Match(videoUrl); 46 if (match.Success) 47 { 48 videoId = match.Groups[1].Value; 49 50 <div class="product-video"> 51 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="Vimeo video player" src="https://player.vimeo.com/video/@videoId?title=0&byline=0&portrait=0&autoplay=0&controls=1&loop=0&muted=1"></iframe> 52 </div> 53 } 54 55 if (string.IsNullOrWhiteSpace(videoId)) 56 { 57 <div class="product-video"> 58 <iframe loading="lazy" data-video="@videoUrl" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoUrl?autoplay=0&controls=1&loop=0&playlist=@videoUrl&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 59 </div> 60 } 61 } 62 } 63 </div> 64 65 <style> 66 .product-video iframe { 67 aspect-ratio: 16 / 9; 68 width: 50%; 69 height: auto; 70 min-width: 325px; 71 } 72 </style> 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_2d85c17c3b8d4caa9b15ea48fdb9be21.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

Vereinbaren Sie einen Beratungstermin mit einem unserer Spezialisten

 Lassen Sie sich von einem Spezialisten beraten
 Lernen Sie uns und unsere Produkte kennen
 Finden Sie heraus, welche Lösung am besten zu Ihnen passt

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