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_cf18f4ff3c0948a6aa5c78010a92c824.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_9c75a72fe63449e99bbe3cdd2e1af579.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
¿Necesita asesoramiento profesional?

Pregunte a uno de nuestros especialistas.

Teléfono: +31 (0)72 540 66 99

Correo electrónico: info@koks.com

Llámame
  • Información del Producto
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_afbff7a54d0249e0bb9cb373c012929c.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_37d333e10d954d60b806d281107fe301.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_b0b86b19ca714b73a96f5419d9e94a68.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_e3ee16b7b2d5400687fab56f3d78ed61.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

Concertar una consulta con uno de nuestros especialistas

 Obtenga asesoramiento de un especialista
 Conózcanos y conozca nuestros productos
 Descubra qué solución se adapta mejor a sus necesidades

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_39c31adeb2e14feaa89a6175167006e8.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_fb9c9c7bec41404085356ce46543ca27.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetSecondaryInfo.cshtml:line 27
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

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