Branding Stylesheet || ProductId : PROD313 VariantId :

pdp - add to cart

Product detail configuration page

KOKS CYCLOVAC

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
  • Anwendung: Flüssigkeiten und Trockensubstanzen (ADR)
  • Saugschlauch: bis Ø 6 Zoll
  • Besondere Eigenschaft: leicht zu reinigen

Die KOKS CycloVac Luftförderanlage mit Zyklonabscheider (auch genannt: Saugwagen mit Zyklonabscheider) ist für den schweren Industrieeinsatz ausgelegt und für das Saugen, Verblasen (Sonderausrüstung), Transportieren und Entleeren trockener, nasser Stoffe und Gefahrgüter wie verschiedene Katalystarten, (Dach-)Kies, Pulver, Flugasche und Schlamm geeignet. Speziell für das Arbeiten mit Gefahrgütern und verunreinigten Stoffen ist die Anlage mit PED, ASME, ADR (CEOC) und oder ATEX (Ex)-(Pumpensystem)-Ausrüstung erhältlich und gemäß allen geltenden Sicherheitsanforderungen gebaut.

Read more
Professional advice needed?

Ask one of our specialists.

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

E-mail: info@koks.com

 

Call me back
  • Product Information
  • Specifications
  • Reviews
  • Accessoires
  • Andere uitvoeringen
  • Options
  • Benefits
Product information

Specifications

Schedule a consultation with one of our specialists

 Get advice from a specialist
 Get to know us and our products
 Get insight into which solution suits you best

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