Error executing template "Designs/junckers/eCom/Product/junckers-woodcare.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_da038f9d201649ccb585d025e64260ac.Execute() in D:\dynamicweb.net\Solutions\junckers.espresso4.dk\Files\Templates\Designs\junckers\eCom\Product\junckers-woodcare.cshtml:line 1879 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 Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using Dynamicweb.Ecommerce.Prices; 3 @using Co3.Espresso.Base.Extensions; 4 @using Co3.Espresso.Base.Models; 5 @using System.Web 6 @using System 7 @using System.Collections.Generic 8 @using Dynamicweb.Ecommerce.Prices 9 @using Co3.Espresso.Base.Extensions 10 @using Co3.Espresso.Base.Models 11 @using Co3.Espresso.Website.Models.FrontEnd 12 @using Co3.Espresso.Website.Services 13 @using Dynamicweb.Ecommerce.Common.eCom7 14 @using Dynamicweb.Rendering 15 @using System.Linq 16 @using Dynamicweb.Ecommerce 17 @using Dynamicweb.Ecommerce.Notifications 18 @using Dynamicweb.Ecommerce.Stocks 19 @using Dynamicweb.Security.UserManagement 20 @using Dynamicweb.Ecommerce.Variants 21 @using Dynamicweb.Frontend 22 @using Dynamicweb.Ecommerce.Products; 23 @using ProductService = Co3.Espresso.Website.Services.ProductService 24 @using System.Text.RegularExpressions 25 @using Dynamicweb.Analytics.Goals 26 @using Dynamicweb.Ecommerce.CheckoutHandlers.BBSPayment.no.bbs.epayment 27 @using System.Globalization 28 @using Co3.Espresso.Base.Extensions 29 @using Co3.Espresso.DownloadManager.Models 30 @using Co3.Espresso.Website.Models.FrontEnd 31 @using Co3.Espresso.Website.Services 32 @using Dynamicweb.Content 33 @using Dynamicweb.Frontend 34 @using Dynamicweb.Rendering 35 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 36 37 @functions { 38 39 public string getCountryCodeFromArea( Area area ) 40 { 41 RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); 42 return regionInfo.TwoLetterISORegionName; 43 } 44 45 public dynamic GetPriceInfo( string beforePrice = "", string basicPrice = "" ) 46 { 47 double vat = EcomContext.Country.Vat; 48 double dblBeforePrice = 0; 49 double.TryParse( beforePrice, out dblBeforePrice ); 50 double dblBasicPrice = 0; 51 double.TryParse( basicPrice, out dblBasicPrice ); 52 double dblBeforePriceWithVat = 0; 53 double dblDiffPrice = 0; 54 int pct = 0; 55 56 if ( dblBeforePrice > 0 ) 57 { 58 dblBeforePriceWithVat = dblBeforePrice * ( ( vat / 100d ) + 1 ); 59 if ( dblBeforePriceWithVat > dblBasicPrice ) 60 { 61 dblDiffPrice = dblBeforePriceWithVat - dblBasicPrice; 62 pct = (int)Math.Ceiling((( 100d / dblBeforePriceWithVat ) * dblDiffPrice)); 63 } 64 } 65 66 dynamic returnValue = new 67 { 68 beforePriceWithVat = dblBeforePriceWithVat, 69 beforePriceWithVatFormatted = ProductService.Instance.GetPriceFormatted(dblBeforePriceWithVat), 70 basicPrice = dblBasicPrice, 71 basicPriceFormatted = ProductService.Instance.GetPriceFormatted(dblBasicPrice), 72 diffPrice = dblDiffPrice, 73 diffPriceFormatted = ProductService.Instance.GetPriceFormatted(dblDiffPrice), 74 pct = pct, 75 vat = vat 76 }; 77 return returnValue; 78 } 79 80 } 81 82 83 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null) 84 { 85 if ( string.IsNullOrEmpty( content ) == false ) 86 { 87 ClassList headingClassList = new ClassList(); 88 headingClassList.AddClasses( "col-12" ); 89 ClassList contentClassList = new ClassList(); 90 contentClassList.AddClasses( "col-12" ); 91 92 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses ) 93 94 if ( string.IsNullOrEmpty( heading ) == false ) 95 { 96 <div class="@headingClassList"> 97 <h2>@heading</h2> 98 </div> 99 } 100 <div class="@contentClassList"> 101 @content 102 </div> 103 104 @sectionEnd() 105 } 106 } 107 108 109 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 110 { 111 if ( string.IsNullOrEmpty( videoURL ) == false ) 112 { 113 ClassList headingClassList = new ClassList(); 114 headingClassList.AddClasses( "col-12" ); 115 ClassList contentClassList = new ClassList(); 116 contentClassList.AddClasses( "col-12" ); 117 118 119 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 120 121 if ( string.IsNullOrEmpty( heading ) == false ) 122 { 123 <div class="@headingClassList"> 124 <h2>@heading</h2> 125 </div> 126 } 127 128 <div class="@contentClassList"> 129 <div class="embed-responsive embed-responsive-16by9 mb-2"> 130 <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 131 </div> 132 </div> 133 @sectionEnd() 134 } 135 } 136 137 @helper ProductRelatedProducts(string sectionClasses = "e-section p-section p-section-bg-white pt-3 border-bottom", string contentClasses = null, string heading = null, 138 IEnumerable<RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem> productLoop = null) 139 { 140 if ( productLoop != null && productLoop.Any() == true ) 141 { 142 ClassList headingClassList = new ClassList(); 143 headingClassList.AddClasses( "col-10 mx-auto" ); 144 ClassList contentClassList = new ClassList(); 145 contentClassList.AddClasses( "col-10 mx-auto" ); 146 147 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 148 149 if ( string.IsNullOrEmpty( heading ) == false ) 150 { 151 <div class="@headingClassList"> 152 <h2>@heading</h2> 153 </div> 154 } 155 156 157 <div class="@contentClassList"> 158 <div class="e-products mb-2"> 159 <div class="row"> 160 @{ 161 string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); 162 } 163 @foreach ( RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem product in productLoop ) 164 { 165 @ProductlistItem( product, productlistItemClassList ) 166 } 167 </div> 168 </div> 169 </div> 170 171 @sectionEnd() 172 } 173 } 174 175 @helper ProductlistItem(RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem product, string productlistItemClassList = null) 176 { 177 if ( product != null ) 178 { 179 dynamic productData = new 180 { 181 id = product.GetString( "Ecom:Product.ID" ), 182 url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ) ), 183 number = product.GetString( "Ecom:Product.Number" ), 184 name = product.GetString( "Ecom:Product.Name" ), 185 imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageLarge.Clean" ), 450, 350, 5 ), 186 price = ProductService.Instance.GetPriceFormatted( product.GetDouble( "Ecom:Product.Price.Price" ) ), 187 descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), 188 descriptionShort = product.GetString( "Ecom:Product.ShortDescription" ), 189 stock = new 190 { 191 id = product.GetString( "Ecom:Product:Stock.ID" ), 192 quantity = product.GetString( "Ecom:Product.Stock" ), 193 text = product.GetString( "Ecom:Product:Stock.Text" ), 194 delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) 195 } 196 }; 197 198 <div class="@productlistItemClassList"> 199 <div class="e-products-item js-e-products-item"> 200 <div class="e-products-item-container"> 201 <div class="junckers-relatedproducts-item-image-container" style="background: url(@productData.imageLarge)"> 202 @if ( string.IsNullOrEmpty( productData.descriptionShort ) == false ) 203 {<div class="junckers-relatedproducts-item-text-container py-1"> 204 <p class="e-products-item-text mb-0 px-2 small"> 205 <strong>Package Size</strong> 206 </p> 207 <p class="e-products-item-text mb-0 text-muted px-2 small"> 208 @productData.descriptionShort 209 </p> 210 </div> 211 } 212 </div> 213 <div class="e-products-item-text-container text-center"> 214 <h3 class="e-products-item-name mb-0"> 215 @productData.name 216 </h3> 217 @* <p class="e-products-item-text mb-0"> *@ 218 @* <small class="e-products-item-price small text-muted"> *@ 219 @* <a href="@productData.url"> *@ 220 @* @productData.price *@ 221 @* </a> *@ 222 @* </small> *@ 223 @* </p> *@ 224 </div> 225 </div> 226 </div> 227 </div> 228 } 229 } 230 231 232 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string collapseToggleTextExpand = "Se mere", string collapseToggleTextCollapse = "Se mindre") 233 { 234 ClassList sectionClassList = new ClassList(); 235 sectionClassList.AddClasses( sectionClasses ); 236 ClassList contentClassList; 237 string collapseId = Guid.NewGuid().ToString( "N" ); 238 ClassList collapseToggleClassList = new ClassList(); 239 if ( contentClasses == null ) 240 { 241 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); 242 } 243 else 244 { 245 contentClassList = new ClassList(); 246 contentClassList.AddClasses( contentClasses ); 247 } 248 if ( sectionCollapse == true ) 249 { 250 sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); 251 collapseToggleClassList.AddClasses( contentClasses ); 252 collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); 253 contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); 254 } 255 @:<section class="@sectionClassList"> 256 @:<div class="container-fluid"> 257 @:<div class="row"> 258 259 if ( sectionCollapse == true ) 260 // TODO: SplitPattern into seperate heler function 261 { 262 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> 263 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button"> 264 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> 265 </button> 266 <small class="p-section-collapse-toggle-text h4" data-expand-text="@collapseToggleTextExpand" data-collapse-text="@collapseToggleTextCollapse"></small> 267 </div> 268 } 269 270 @:<div class="@contentClassList" id="@collapseId"> 271 @:<div class="row"> 272 } 273 274 @helper sectionEnd() 275 { 276 @:</div> 277 @:</div> 278 @:</div> 279 @:</div> 280 @:</section> 281 } 282 283 284 285 286 287 @{ 288 bool isRequestingPDF = System.Web.HttpContext.Current.Request["pdfgeneratorworking"] == "true" || System.Web.HttpContext.Current.Request["newpdf"] == "true" || System.Web.HttpContext.Current.Request["newpdf"] == "test"; 289 Dictionary<string, string> packageSizeFieldsTranslated = Co3.Junckers.Dw.Services.ProductService.Instance.GetFieldOptionsTranslationsByCategory( "Woodcare_Variant_Package_Size" ); 290 291 dynamic JSON = new 292 { 293 productid = GetValue( "Ecom:Product.ID" ), 294 variantoptions = new List<dynamic>(), 295 variantCombos = new Dictionary<string, dynamic>() 296 }; 297 298 string primaryVariantComboId = GetString( "Ecom:Product.SelectedVariantComboID" ); 299 300 VariantOptionService variantOptionService = new VariantOptionService(); 301 302 VariantCombinationService variantComboService = new VariantCombinationService(); 303 IEnumerable<VariantCombination> variantCombos = variantComboService.GetVariantCombinations( GetString( "Ecom:Product.ID" ) ).Where( vc => vc.Product.Active == true && vc.Product.IsVariantMaster == false ); 304 305 306 bool hasVariant = variantCombos.Any(); 307 if ( hasVariant ) 308 { 309 foreach ( VariantCombination variant in variantCombos ) 310 { 311 List<string> packageSize = new List<string>(); 312 List<string> packageSizeNumber = new List<string>(); 313 List<string> packageSizeText = new List<string>(); 314 315 316 List<string> images = new List<string>(); 317 foreach ( LoopItem image in GetLoop( "Espresso.DetailImages" ) ) 318 { 319 images.Add( ImageService.Instance.GetImageURL( image.GetString( "File.Url" ), 1440, 0, 5, 75, "png" ) ); 320 } 321 if ( string.IsNullOrEmpty( primaryVariantComboId ) ) 322 { 323 primaryVariantComboId = variant.Product.DefaultVariantComboId; 324 } 325 326 object packageSizeObject = variant.Product.GetCategoryValue( "Woodcare_Variant_Package_Size", "Package_Sizes" ); 327 328 if ( packageSizeObject != null ) 329 { 330 packageSizeObject.ToString().Split( new String[] {","}, StringSplitOptions.RemoveEmptyEntries ).ToList().ForEach( ps => 331 { 332 if ( packageSizeFieldsTranslated.ContainsKey( ps ) ) 333 { 334 packageSize.Add( packageSizeFieldsTranslated[ps] ); 335 } 336 else 337 { 338 packageSize.Add( ps ); 339 } 340 } ); 341 } 342 343 JSON.variantCombos[variant.Product.VariantId] = new 344 { 345 id = variant.Product.Id, 346 variantId = variant.Product.VariantId, 347 variantName = variantOptionService.GetVariantOption( variant.Product.VariantId, PageView.Current().Area.EcomLanguageId ) != null ? variantOptionService.GetVariantOption( variant.Product.VariantId, PageView.Current().Area.EcomLanguageId ) : new VariantOption(), 348 variantIdDefault = variant.Product.DefaultVariantComboId, 349 name = variant.Product.Name, 350 images = images, 351 packageSize = packageSize, 352 imageSmall = ImageService.Instance.GetImageURL( variant.Product.ImageSmall, 1440, 0, 5, 75, "png" ), 353 }; 354 } 355 } 356 string primaryGroupID = GetString( "Ecom:Product.PrimaryGroupID" ); 357 GroupService groupService = new GroupService(); 358 } 359 360 @{ 361 string variantgroupstyles = string.Empty; 362 if ( GetLoop( "VariantGroups" ).Any() ) 363 { 364 variantgroupstyles = "justify-content-between"; 365 } 366 else 367 { 368 variantgroupstyles = ""; 369 } 370 } 371 372 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 373 374 @{ 375 string eComProductCanonical = string.Empty; 376 string globalValueUrl = GetGlobalValue( "Global:Pageview.Url" ); 377 378 if ( GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) > -1 ) 379 { 380 globalValueUrl = GetGlobalValue( "Global:Pageview.Url" ).Substring( 0, GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) ); 381 } 382 383 if ( string.IsNullOrEmpty( GetString( "Ecom:Product.Canonical" ) ) == false ) 384 { 385 eComProductCanonical = String.Format( "{0}://{1}{2}", GetGlobalValue( "Global:Request.Scheme" ), GetGlobalValue( "Global:Request.Host" ), GetString( "Ecom:Product.Canonical" ) ); 386 } 387 else 388 { 389 eComProductCanonical = String.Format( "{0}://{1}{2}", GetGlobalValue( "Global:Request.Scheme" ), GetGlobalValue( "Global:Request.Host" ), globalValueUrl ); 390 } 391 string metaTitle = @GetString( "Ecom:Product.MetaTitle" ); 392 string metaDescription = @GetString( "Ecom:Product.MetaDescription" ); 393 } 394 395 @SnippetStart( "productMetaTags" ) 396 397 @{ 398 if (string.IsNullOrEmpty( metaTitle ) ) 399 { 400 metaTitle = GetString( "Ecom:Product.Name" ); 401 } 402 403 } 404 405 <title>@metaTitle</title> 406 <meta title="@metaTitle" /> 407 <meta name="description" content="@metaDescription" /> 408 <link rel="canonical" href="@eComProductCanonical"> 409 @SnippetEnd( "productMetaTags" ) 410 411 <script> 412 var junckers = junckers || {}; 413 junckers.data = junckers.data || {}; 414 junckers.data.product = junckers.data.product || {}; 415 junckers.data.product["@GetString( "Ecom:Product.ID" )"] = @JsonService.Instance.ToJson( JSON ); 416 </script> 417 418 @sectionEnd() 419 420 <div class="e-product j-product-woodcare js-e-product d-flex flex-column" data-pdf="@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )" data-productid="@GetString( "Ecom:Product.ID" )" data-variant="@Convert.ToString( hasVariant ).ToLower()"> 421 @sectionStart( "e-section p-0 p-section-bg-white pdf-first-section" ) 422 423 <div class="col-12"> 424 <div class="row"> 425 <div class="col-12 pt-5 py-lg-5 @( isRequestingPDF ? "col-sm-9" : "col-md-6" )"> 426 <div class="e-product-text-container pr-lg-6"> 427 <h1 class="e-product-name"> 428 @GetString( "Ecom:Product.Name" ) 429 </h1> 430 @*<p class="small text-muted">Varenummer: XXX</p>*@ 431 432 @* <div class="e-product-text mb-2"> *@ 433 @* <span class="lead">@GetString( "Ecom:Product.ShortDescription" )</span> *@ 434 @* </div> *@ 435 <div class="e-product-text mb-2 pdf-hidden small"> 436 @GetString( "Ecom:Product.LongDescription" ) 437 </div> 438 439 </div> 440 </div> 441 <div class="col-12 @( isRequestingPDF ? "col-sm-3" : "col-md-6" ) order-first bg-light"> 442 <div class="e-product-image-container"> 443 @using Co3.Espresso.Base.Extensions 444 @using Co3.Espresso.Base.Models 445 @using Co3.Espresso.Website.Services 446 @using Dynamicweb.Ecommerce.Products 447 448 @{ 449 string extraAltText = string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.FloorCategoryName.Value" ) ) ? GetString( "Ecom:Product.ShortDescription" ).StripHtml() : GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.FloorCategoryName.Value" ); 450 451 Product dynamicwebProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), Dynamicweb.Ecommerce.Common.Context.LanguageID, false); 452 IEnumerable< Detail > detailsImages = Dynamicweb.Ecommerce.Services.Details.GetDetails( dynamicwebProduct, "0" ).Where( d => d.GroupId == 1 ); 453 454 List< Detail > details = new List< Detail >(); 455 if ( Dynamicweb.Ecommerce.Services.Details.GetDefaultDetail( dynamicwebProduct ) != null ) 456 { 457 details.Add(Dynamicweb.Ecommerce.Services.Details.GetDefaultDetail( dynamicwebProduct )); 458 } 459 if ( detailsImages.Any() ) 460 { 461 details.AddRange(detailsImages); 462 } 463 } 464 465 <div class="e-product-image-container my-2 my-lg-5"> 466 <div class="carousel" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 467 <div class="e-product-image-wrapper"> 468 @{ 469 var variantOption = GetLoop( "VariantGroups" ).Any( vg => vg.GetLoop( "VariantAvailableOptions" ).Any() ); 470 string variantGroupName = string.Empty; 471 472 } 473 <div class="carousel-inner fade d-flex align-items-center"> 474 475 @if ( variantOption ) 476 { 477 foreach ( LoopItem variantGroup in GetLoop( "VariantGroups" ) ) 478 { 479 variantGroupName = variantGroup.GetString( "Ecom:VariantGroup.Name" ); 480 if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) != "Gloss" ) 481 { 482 <img class="j-product-image-detail-image js-chosen-variant-image" src=""> 483 } 484 } 485 } 486 487 @if ( !details.Any() ) 488 { 489 <div class="active carousel-item" data-target="#js-e-product-image-modal" data-toggle="modal"> 490 <img src="/admin/public/getimage.ashx?Crop=0&Image=@dynamicwebProduct.ImageLarge&Format=jpg&Width=1000&Height=&Quality=90" alt="@GetString( "Ecom:Product.Name" ) @extraAltText" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="0" @(variantOption ? "" : "style='left:0'")> 491 </div> 492 } 493 494 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 495 { 496 string activeClass = image.Index == 0 ? "active" : string.Empty; 497 <div class="carousel-item pdf-hidden @activeClass" data-target="#js-e-product-image-modal" data-toggle="modal"> 498 <img style="@(variantGroupName == "Gloss" ? "left:0" : "")" src="/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=1000&Height=&Quality=90" alt="@GetString( "Ecom:Product.Name" )" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="@( image.Index )" > 499 </div> 500 } 501 502 @{ 503 int loopCounter = 0; 504 } 505 @foreach ( ElementWithIndex<Detail> imageDetails in details.WithIndex() ) 506 { 507 if ( loopCounter == 1 && details.WithIndex().Count() > 1 ) 508 { 509 if ( !string.IsNullOrEmpty( imageDetails.Element.Value ) ) 510 { 511 <a class="carousel-control-prev pdf-hidden" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 512 <a class="carousel-control-next pdf-hidden" data-slide="next" data-target="#js-e-product-image-carousel"></a> 513 } 514 } 515 loopCounter++; 516 } 517 </div> 518 </div> 519 520 @{ int CarouselItemLoopCounter = 1; } 521 522 @foreach ( ElementWithIndex<Detail> imageDetails in details.WithIndex() ) 523 { 524 if ( CarouselItemLoopCounter == 1 && details.WithIndex().Count() > 1 ) 525 { 526 527 if ( !string.IsNullOrEmpty( imageDetails.Element.Value ) ) 528 { 529 530 <ol class="carousel-indicators pdf-hidden"> 531 @if ( !details.Any() ) 532 { 533 <li class="active" data-slide-to="0" data-target="#js-e-product-image-carousel"> 534 <span style="background-size: cover; background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@( imageDetails.Element.Value )&Format=jpg&Width=50&Height=&Quality=90)"></span> 535 </li> 536 } 537 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 538 { 539 string activeClass = image.Index == 0 ? "active" : string.Empty; 540 541 <li class="@activeClass" data-target="#js-e-product-image-carousel" data-slide-to="@( image.Index )"> 542 <span style="background-size: cover; background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=50&Height=&Quality=75)"></span> 543 </li> 544 } 545 </ol> 546 } 547 CarouselItemLoopCounter++; 548 } 549 } 550 </div> 551 </div> 552 553 554 @*<section id="js-e-product-banner-carousel" class="e-section p-0 carousel slide junckers-carousel" data-keyboard="false" data-interval="0">*@ 555 @* <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel">*@ 556 @* <div class="carousel-inner">*@ 557 @* <div class="active carousel-item" data-target="#js-e-product-image-modal" data-toggle="modal">*@ 558 @* <img style="width: 100%;" src="/admin/public/getimage.ashx?Crop=0&Image=@GetValue( "Ecom:Product.ImageLarge.Clean" )&Format=jpg&Width=2000&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="0">*@ 559 @* </div>*@ 560 @* @foreach ( ElementWithIndex<LoopItem> image in GetLoop( "Details" ).WithIndex() )*@ 561 @* {*@ 562 @* <div class="carousel-item" data-target="#js-e-product-image-modal" data-toggle="modal">*@ 563 @* <img style="width: 100%;" src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=2000&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="@( image.Index + 1 )">*@ 564 @* </div>*@ 565 @* }*@ 566 @* <a class="carousel-control-prev" data-slide="prev" data-target="#js-e-product-image-carousel"></a>*@ 567 @* <a class="carousel-control-next" data-slide="next" data-target="#js-e-product-image-carousel"></a>*@ 568 @* </div>*@ 569 @* </div>*@ 570 @*</section>*@ 571 572 </div> 573 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal" data-backdrop="false" data-keyboard="true"> 574 <div class="modal-dialog"> 575 <div class="modal-content"> 576 <div class="modal-body"> 577 578 <button type="button" class="close" data-dismiss="modal"> 579 <i class="material-icons">close</i> 580 </button> 581 582 <div id="js-e-product-image-modal-carousel" class="carousel slide" data-keyboard="true" data-interval="false"> 583 <div class="carousel-inner"> 584 @if ( !details.Any() ) 585 { 586 <div class="carousel-item active" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@GetValue( "Ecom:Product.ImageLarge.Clean" )&Format=jpg&Width=&Height=1800&Quality=90)"> 587 </div> 588 } 589 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 590 { 591 string activeClass = image.Index == 0 ? "active" : string.Empty; 592 <div class="carousel-item @activeClass" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=&Height=1800&Quality=90)"> 593 </div> 594 } 595 </div> 596 @{ int CarouselModalItemLoopCounter = 1; } 597 598 @foreach ( ElementWithIndex<Detail> imageIndicator in details.WithIndex() ) 599 { 600 if ( CarouselModalItemLoopCounter == 1 ) 601 { 602 if ( !string.IsNullOrEmpty( imageIndicator.Element.Value ) ) 603 { 604 <ol class="carousel-indicators"> 605 @if ( !details.Any() ) 606 { 607 <li data-target="#js-e-product-image-modal-carousel" data-slide-to="0" class="active"> 608 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@( imageIndicator.Element.Value )&Format=jpg&Width=50&Height=&Quality=90)"></span> 609 </li> 610 } 611 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 612 { 613 string activeClass = image.Index == 0 ? "active" : string.Empty; 614 <li class="@activeClass" data-target="#js-e-product-image-modal-carousel" data-slide-to="@( image.Index + 1 )"> 615 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=50&Height=&Quality=75)"></span> 616 </li> 617 } 618 </ol> 619 <a class="carousel-control-prev" data-target="#js-e-product-image-modal-carousel" data-slide="prev"></a> 620 <a class="carousel-control-next" data-target="#js-e-product-image-modal-carousel" data-slide="next"></a> 621 } 622 CarouselModalItemLoopCounter++; 623 } 624 } 625 </div> 626 627 </div> 628 </div> 629 </div> 630 </div> 631 632 </div> 633 <div class="col-12 col-md-6 d-flex py-2 order-first bg-light d-lg-none"> 634 <form action="/system/data/cart" class="d-flex e-product-form js-junckers-variant-form mt-0 pdf-hidden w-100 @variantgroupstyles" method="post"> 635 <input name="ProductID" type="hidden" value="@GetString( "Ecom:Product.ID" )"> 636 <input name="Redirect" type="hidden" value=""> 637 <div class="junckers-variant-colors"> 638 639 @foreach ( LoopItem variantGroup in GetLoop( "VariantGroups" ) ) 640 { 641 if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) == "Gloss" ) 642 { 643 <h3 class="mt-0">@Translate( "eCom Product - Variant Gloss - Heading", "Gloss" ):</h3> 644 } 645 if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) == "Colors" ) 646 { 647 <h3 class="mt-0">@Translate( "eCom Product - Variant Color - Heading", "Colors" ):</h3> 648 } 649 if ( isRequestingPDF ) 650 { 651 } 652 else 653 { 654 <div class="d-flex flex-row flex-wrap"> 655 656 @foreach ( LoopItem variantCombination in GetLoop( "VariantCombinations" ) ) 657 { 658 <div class="d-flex"> 659 <input data-image="@ImageService.Instance.GetImageURL( variantCombination.GetString( "Ecom:Product.ImageDefault.Default.Clean" ), 400, 0, 5, 75, "png" )" id="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )" name="PackageSize" type="radio" value="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )"> 660 <label class="btn btn-tertiary d-flex flex-column font-weight-bold mr-1 p-0" for="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )"> 661 662 @if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) != "Gloss" ) 663 { 664 <span class="js-junckers-variant-image" style="background-image: url('@ImageService.Instance.GetImageURL( variantCombination.GetString( "Ecom:Product.ImageDefault.Default.Clean" ), 70, 0, 5, 75, "png" )')"> 665 <span class="d-flex h2 h2 justify-content-center m-0 py-1"> </span> 666 </span> 667 <span class="align-items-center bg-white border-dark border-top d-flex font-weight-light h-100 justify-content-center px-1 text-dark" style="width: 6em; hyphens: auto; text-transform: capitalize;">@variantCombination.GetString( "Ecom:VariantCombination.VariantText" )</span> 668 } 669 else 670 { 671 <span class="align-items-center bg-white border-dark py-2 d-flex font-weight-light h-100 justify-content-center px-1 text-dark" style="width: 6em; hyphens: auto; text-transform: capitalize;">@variantCombination.GetString( "Ecom:VariantCombination.VariantText" )</span> 672 } 673 </label> 674 </div> 675 } 676 </div> 677 @*foreach ( LoopItem variantOption in variantGroup.GetLoop( "VariantAvailableOptions" ) ) 678 { 679 <input type="radio" id="@variantOption.GetString( "Ecom:VariantOption.ID" )" name="PackageSize" value="@variantOption.GetString( "Ecom:VariantOption.ID" )"> 680 <label class="btn btn-tertiary font-weight-bold mr-1" for="@variantOption.GetString( "Ecom:VariantOption.ID" )">@variantOption.GetString( "Ecom:VariantOption.Name" )</label> 681 }*@ 682 } 683 } 684 685 </div> 686 687 @* Variant Package Size *@ 688 689 <script id="js-e-handlebars-tmpl-variant-package-size" type="text/x-handlebars-template"> 690 <div class="d-flex flex-column"> 691 <h3 class="d-flex">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 692 <div class="d-flex"> 693 {{#each packageSize}} 694 <span class="btn btn-tertiary border-dark bg-white mr-1 mb-1 d-flex flex-column align-items-center p-0"> 695 <span class="h2 font-weight-bold m-0 py-1">{{packageSizeNumber this 0}}</span> 696 <span class="px-1 border-top border-dark">{{packageSizeNumber this 1}}</span> 697 </span> 698 {{/each}} 699 </div> 700 </div> 701 </script> 702 703 @if ( isRequestingPDF ) 704 { 705 foreach ( KeyValuePair<string, dynamic> combo in JSON.variantCombos ) 706 { 707 <p class="mb-0"> 708 <strong class="mr-1">@combo.Value.variantName.Name</strong> 709 <h3 class="mt-1 small">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 710 @foreach ( string package in combo.Value.packageSize ) 711 { 712 <span class="junckers-product-variation-option-pdf ">@package</span> 713 } 714 </p> 715 } 716 } 717 else 718 { 719 <div class="js-junckers-variant-package-size junckers-variant-package-size"></div> 720 } 721 722 723 @* General Package Size *@ 724 @* 725 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Variant_Package_Size.Package_Sizes.OptionLabel" ) ) ) 726 { 727 string[] GeneralPackageSize = GetString( "Ecom:Product.CategoryField.Woodcare_Variant_Package_Size.Package_Sizes.OptionLabel" ).Split( ',' ); 728 729 <div class="d-flex flex-column"> 730 <h3 class="d-flex mt-0">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 731 <div class="d-flex"> 732 @foreach ( string prop in GeneralPackageSize ) 733 { 734 string[] propNumber = prop.Split( Convert.ToChar( " " ) ); 735 if ( prop != "" ) 736 { 737 <span class="align-items-center bg-white border border-dark d-flex flex-column mb-1 mr-1 p-0"> 738 <span class="font-weight-bold h2 m-0 py-1">@propNumber[0]</span> 739 <span class="border-dark border-top px-1">@propNumber[1]</span> 740 </span> 741 } 742 } 743 </div> 744 </div> 745 } 746 *@ 747 </form> 748 </div> 749 </div> 750 </div> 751 752 @sectionEnd() 753 754 @{ 755 var highlightFieldDisplayGroup = GetLoop( "FieldDisplayGroups" ).Where( fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Highlights" ); 756 } 757 758 @if ( GetLoop( "VariantGroups" ).Count > 0 || GetDouble( "Ecom:Product.Price.Price" ) != 0 || highlightFieldDisplayGroup.Any() && highlightFieldDisplayGroup.Any( fdp => fdp.GetLoop( "Fields" ).Any() ) ) 759 { 760 761 @sectionStart( "e-section p-0 p-section-bg-white" ) 762 763 <div class="col-12"> 764 <div class="row"> 765 <div class="col-12 col-md-6 d-none d-lg-flex order-last order-md-first py-2"> 766 <form action="/system/data/cart" class="d-flex e-product-form js-junckers-variant-form mt-0 pdf-hidden w-100 @variantgroupstyles" method="post"> 767 <input name="ProductID" type="hidden" value="@GetString( "Ecom:Product.ID" )"> 768 <input name="Redirect" type="hidden" value=""> 769 <div class="junckers-variant-colors"> 770 771 @foreach ( LoopItem variantGroup in GetLoop( "VariantGroups" ) ) 772 { 773 if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) == "Gloss" ) 774 { 775 <h3 class="mt-0">@Translate( "eCom Product - Variant Gloss - Heading", "Gloss" ):</h3> 776 } 777 if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) == "Colors" ) 778 { 779 <h3 class="mt-0">@Translate( "eCom Product - Variant Color - Heading", "Colors" ):</h3> 780 } 781 if ( isRequestingPDF ) 782 { 783 } 784 else 785 { 786 <div class="d-flex flex-row flex-wrap"> 787 788 @foreach ( LoopItem variantCombination in GetLoop( "VariantCombinations" ) ) 789 { 790 <div class="d-flex"> 791 <input data-image="@ImageService.Instance.GetImageURL( variantCombination.GetString( "Ecom:Product.ImageDefault.Default.Clean" ), 400, 0, 5, 75, "png" )" id="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )" name="PackageSize" type="radio" value="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )"> 792 <label class="btn btn-tertiary d-flex flex-column font-weight-bold mr-1 p-0" for="@variantCombination.GetString( "Ecom:VariantCombination.VariantID" )"> 793 794 @if ( variantGroup.GetString( "Ecom:VariantGroup.Name" ) != "Gloss" ) 795 { 796 <span class="js-junckers-variant-image" style="background-image: url('@ImageService.Instance.GetImageURL( variantCombination.GetString( "Ecom:Product.ImageDefault.Default.Clean" ), 70, 0, 5, 75, "png" )')"> 797 <span class="d-flex h2 h2 justify-content-center m-0 py-1"> </span> 798 </span> 799 <span class="align-items-center bg-white border-dark border-top d-flex font-weight-light h-100 justify-content-center px-1 text-dark" style="width: 6em; hyphens: auto; text-transform: capitalize;">@variantCombination.GetString( "Ecom:VariantCombination.VariantText" )</span> 800 } 801 else 802 { 803 <span class="align-items-center bg-white border-dark py-2 d-flex font-weight-light h-100 justify-content-center px-1 text-dark" style="width: 6em; hyphens: auto; text-transform: capitalize;">@variantCombination.GetString( "Ecom:VariantCombination.VariantText" )</span> 804 } 805 </label> 806 </div> 807 } 808 </div> 809 @*foreach ( LoopItem variantOption in variantGroup.GetLoop( "VariantAvailableOptions" ) ) 810 { 811 <input type="radio" id="@variantOption.GetString( "Ecom:VariantOption.ID" )" name="PackageSize" value="@variantOption.GetString( "Ecom:VariantOption.ID" )"> 812 <label class="btn btn-tertiary font-weight-bold mr-1" for="@variantOption.GetString( "Ecom:VariantOption.ID" )">@variantOption.GetString( "Ecom:VariantOption.Name" )</label> 813 }*@ 814 } 815 } 816 817 </div> 818 819 @* Variant Package Size *@ 820 821 <script id="js-e-handlebars-tmpl-variant-package-size" type="text/x-handlebars-template"> 822 <div class="d-flex flex-column"> 823 <h3 class="d-flex">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 824 <div class="d-flex"> 825 {{#each packageSize}} 826 <span class="btn btn-tertiary border-dark bg-white mr-1 mb-1 d-flex flex-column align-items-center p-0"> 827 <span class="h2 font-weight-bold m-0 py-1">{{packageSizeNumber this 0}}</span> 828 <span class="px-1 border-top border-dark">{{packageSizeNumber this 1}}</span> 829 </span> 830 {{/each}} 831 </div> 832 </div> 833 </script> 834 835 @if ( isRequestingPDF ) 836 { 837 foreach ( KeyValuePair<string, dynamic> combo in JSON.variantCombos ) 838 { 839 <p class="mb-0"> 840 <strong class="mr-1">@combo.Value.variantName.Name</strong> 841 <h3 class="mt-1 small">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 842 @foreach ( string package in combo.Value.packageSize ) 843 { 844 <span class="junckers-product-variation-option-pdf ">@package</span> 845 } 846 </p> 847 } 848 } 849 else 850 { 851 <div class="js-junckers-variant-package-size junckers-variant-package-size"></div> 852 } 853 854 855 @* General Package Size *@ 856 @* 857 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Variant_Package_Size.Package_Sizes.OptionLabel" ) ) ) 858 { 859 string[] GeneralPackageSize = GetString( "Ecom:Product.CategoryField.Woodcare_Variant_Package_Size.Package_Sizes.OptionLabel" ).Split( ',' ); 860 861 <div class="d-flex flex-column"> 862 <h3 class="d-flex mt-0">@Translate( "eCom Product - Package Size - Text", "Package Size" ):</h3> 863 <div class="d-flex"> 864 @foreach ( string prop in GeneralPackageSize ) 865 { 866 string[] propNumber = prop.Split( Convert.ToChar( " " ) ); 867 if ( prop != "" ) 868 { 869 <span class="align-items-center bg-white border border-dark d-flex flex-column mb-1 mr-1 p-0"> 870 <span class="font-weight-bold h2 m-0 py-1">@propNumber[0]</span> 871 <span class="border-dark border-top px-1">@propNumber[1]</span> 872 </span> 873 } 874 } 875 </div> 876 </div> 877 } 878 *@ 879 </form> 880 </div> 881 882 @if ( GetDouble( "Ecom:Product.Price.Price" ) != 0 || highlightFieldDisplayGroup.Any() && highlightFieldDisplayGroup.Any( fdp => fdp.GetLoop( "Fields" ).Any() ) ) 883 { 884 885 <div class="col-12 col-md-6 d-flex py-2"> 886 887 <div class="align-items-lg-center d-flex flex-column flex-md-row justify-content-between w-100"> 888 889 @if ( GetDouble( "Ecom:Product.Price.Price" ) != 0 ) 890 { 891 <div class="d-flex flex-column order-last order-md-first"> 892 <p class="small mb-0 text-muted">Vejledende udsalgspris fra</p> 893 <h2 class="m-0 h1 small">@ProductService.Instance.GetPriceFormatted( GetDouble( "Ecom:Product.Price.Price" ) )</h2> 894 </div> 895 } 896 <div class="@(GetDouble( "Ecom:Product.Price.Price" ) != 0 ? "ml-lg-auto" : "") order-first order-md-last mb-4 mb-md-0"> 897 @using Co3.Espresso.Website.Services 898 899 @{ 900 Dictionary<string, string> highlights = new Dictionary<string, string>(); 901 } 902 903 @foreach ( LoopItem fieldDisplayGroup in GetLoop( "FieldDisplayGroups" ).Where(fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Highlights" ) ) 904 { 905 906 foreach ( LoopItem field in fieldDisplayGroup.GetLoop( "Fields" ) ) 907 { 908 909 string[] highlightKeyParts = field.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Split( '|' ); 910 string highlightKey = string.Format("{0}_{1}",highlightKeyParts[0],highlightKeyParts[1]); 911 912 if ( highlights.ContainsKey( highlightKey ) ) 913 { 914 continue; 915 } 916 917 highlights[highlightKey] = highlightKey; 918 919 string highlightLogo = GetString( string.Format( "Ecom:Product.CategoryField.{0}.HighlightLogo.Value", highlightKeyParts[1] ) ); 920 string highlightName = GetString( string.Format( "Ecom:Product.CategoryField.{0}.HighlightName.Value", highlightKeyParts[1] ) ); 921 string highlightDesc = GetString( string.Format( "Ecom:Product.CategoryField.{0}.HighlightDesc.Value", highlightKeyParts[1] ) ); 922 923 <a tabindex="0" class="js-junckers-highlight-popover text-decoration-none" data-toggle="popover" data-html="true" data-trigger="focus" data-placement="top" data-content="<h3 class='my-1'>@highlightName</h3> @highlightDesc"> 924 <img class="mr-2" src="@highlightLogo" style="max-height: 50px;"> 925 </a> 926 927 } 928 929 } 930 931 932 933 </div> 934 </div> 935 </div> 936 } 937 938 </div> 939 </div> 940 941 @sectionEnd() 942 943 } 944 945 946 947 948 @sectionStart( "e-section p-0 p-section-bg-white" ) 949 950 <div class="col-12"> 951 <div class="row"> 952 953 <div class="col-md-6 d-flex order-last order-md-first p-section-bg-brand-latte-25 py-4"> 954 @if ( !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Calculator.Value.Clean" ) ) ) 955 { 956 <div class="align-items-lg-center d-flex flex-column flex-lg-row justify-content-between w-100"> 957 <h2 class="d-inline-flex mb-1 mb-xl-0 mr-3"> 958 @Translate( "Ecom Woodcare Product Heading - Klik, og beregn hvor meget du skal bruge", "Klik, og beregn hvor meget du skal bruge" ) 959 </h2> 960 <div class="ml-lg-auto"> 961 962 <button class="bg-transparent border border-dark btn btn-secondary" data-target="#calculator" data-toggle="modal" type="button"> 963 <span>@Translate( "Ecom Woodcare Calculate Heading", "Beregn" )</span> 964 </button> 965 966 </div> 967 </div> 968 } 969 </div> 970 971 <div class="bg-light col-12 col-md-6 ml-auto py-4"> 972 <div class="align-items-lg-center d-flex flex-column flex-lg-row justify-content-between w-100"> 973 <h2 class="d-inline-flex mb-1 mb-xl-0 mr-3">@Translate( "Ecom Woodcare Product - Interested", "Noget for dig?" )</h2> 974 <div class="ml-lg-auto" style="transform: translateY(5px);"> 975 @*<a href="#" class="btn btn-success mr-1 mb-1">Gå til webshop</a>*@ 976 977 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.FloorProductShopLinkTertiary.Value" ) ) ) 978 { 979 <a class="btn btn-success mb-1 mb-1 mr-1 pdf-hidden" href="@GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.FloorProductShopLinkTertiary.Value" )">@GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.FloorProductShopLinkTertiaryLinkName.Value" )</a> 980 } 981 982 @if ( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Hide_Get_Quote_Button.Value" ) != "True" ) 983 { 984 <a class="btn btn-primary junckers-btn-get-quote mb-1 mr-1 pdf-hidden" href="@GetString( "Ecom:Product.Link.Clean" )#junckers-form-link">@Translate( "Get contacted", "Get contacted" )</a> 985 } 986 987 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.WhereToBuy.Value" ) ) ) 988 { 989 <a class="bg-transparent border border-dark btn btn-secondary mb-1 mr-1 pdf-hidden" href="@GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.WhereToBuy.Value" )">@Translate( "Where to buy", "Where to buy" )</a> 990 } 991 992 </div> 993 </div> 994 </div> 995 </div> 996 </div> 997 998 @sectionEnd() 999 1000 1001 @{ 1002 var certificateFieldDisplayGroup = GetLoop( "FieldDisplayGroups" ).Where( fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Certificates" ); 1003 } 1004 @if ( certificateFieldDisplayGroup.Any() && certificateFieldDisplayGroup.Any( fdp => fdp.GetLoop( "Fields" ).Any() ) ) 1005 { 1006 @sectionStart( 1007 contentClasses: "col-12 col-md-10 mx-auto py-6", 1008 sectionClasses: "e-section p-section-bg-white" 1009 ) 1010 <div class="col-12 col-md-6"> 1011 <h3 class="col-12 mb-2 px-0">@Translate( "Certifikater og godkendelser", "Certifikater og godkendelser" )</h3> 1012 <div class="col-12 px-0"> 1013 @using Co3.Espresso.Website.Services 1014 1015 @{ 1016 Dictionary<string, string> certificates = new Dictionary<string, string>(); 1017 } 1018 1019 1020 @foreach ( LoopItem fieldDisplayGroup in GetLoop( "FieldDisplayGroups" ).Where(fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Certificates" ) ) 1021 { 1022 1023 foreach ( LoopItem field in fieldDisplayGroup.GetLoop( "Fields" ) ) 1024 { 1025 string[] certificateKeyParts = field.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Split( '|' ); 1026 string certificateKey = string.Format("{0}_{1}",certificateKeyParts[0],certificateKeyParts[1]); 1027 1028 if ( certificates.ContainsKey( certificateKey ) ) 1029 { 1030 continue; 1031 } 1032 1033 certificates[certificateKey] = certificateKey; 1034 string certificateLogo = GetString( string.Format( "Ecom:Product.CategoryField.{0}.CertificateLogo.Value", certificateKeyParts[1] ) ); 1035 string certificateName = GetString( string.Format( "Ecom:Product.CategoryField.{0}.CertificateName.Value", certificateKeyParts[1] ) ); 1036 string certificateDesc = GetString( string.Format( "Ecom:Product.CategoryField.{0}.CertificateDesc.Value", certificateKeyParts[1] ) ); 1037 string certificateDownloadLinkName = GetString( string.Format( "Ecom:Product.CategoryField.{0}.Certificate_Download_Linkname.Value", certificateKeyParts[1] ) ); 1038 string certificateDownload = GetString( string.Format( "Ecom:Product.CategoryField.{0}.CertificateDownload.Value", certificateKeyParts[1] ) ); 1039 1040 <a tabindex="0" class="js-junckers-certificate-popover text-decoration-none" data-toggle="popover" data-html="true" data-trigger="focus" data-placement="top" data-content="<h3 class='my-1'>@certificateName</h3> @certificateDesc @(!string.IsNullOrEmpty( certificateDownload ) ? "<a class='mb-2 pb-2' href='"+@certificateDownload+"' download>"+certificateDownloadLinkName+"</a>" : "")"> 1041 <img class="mr-2" src="@certificateLogo" style="max-height: 50px;"> 1042 </a> 1043 1044 } 1045 1046 } 1047 1048 1049 1050 </div> 1051 </div> 1052 @* 1053 <div class="col-12 col-md-6"> 1054 <h3 class="col-12 mb-2">Relaterede produkter</h3> 1055 <div class="col-12"> 1056 1057 </div> 1058 </div> 1059 *@ 1060 @sectionEnd() 1061 } 1062 @using Co3.Espresso.Base.Extensions 1063 @using Co3.Espresso.Base.Models 1064 @using Co3.Espresso.Website.Services 1065 @using Dynamicweb.Ecommerce.Products 1066 1067 @{ 1068 IEnumerable<Detail> videos = Dynamicweb.Ecommerce.Services.Details.GetDetails( dynamicwebProduct, "0" ).Where( d => d.GroupId == 3 ); 1069 } 1070 1071 @if ( @videos.Count() > 0 || !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RememberToBuy.Value" )) ) 1072 { 1073 @sectionStart( 1074 contentClasses: "col-12 col-lg-10 mx-auto py-6", 1075 sectionClasses: "e-section p-section-bg-light pdf-hidden" 1076 ) 1077 1078 <div class="col-12"> 1079 <h2>@GetString( "Ecom:Product:Field.VideoHeading" )</h2> 1080 </div> 1081 1082 <div class="col-12 col-md-9 py-2"> 1083 <div class="row"> 1084 1085 @foreach ( Detail video in dynamicwebProduct.Details ) 1086 { 1087 if ( video.GroupId == 3 ) 1088 { 1089 1090 string videoUrl = video.Value; 1091 videoUrl = videoUrl.Replace( "https://www.youtube.com/embed/", "" ); 1092 videoUrl = videoUrl.Replace( "https://www.youtube.com/watch?v=", "" ); 1093 videoUrl = videoUrl.Replace( "&t=1s", "" ); 1094 string videoUrlEmbed = "https://www.youtube.com/embed/" + videoUrl; 1095 1096 <div class="col-12 col-md-6 py-2"> 1097 <div class="embed-responsive embed-responsive-16by9"> 1098 <iframe allowfullscreen class="embed-responsive-item" src="@videoUrlEmbed"></iframe> 1099 </div> 1100 </div> 1101 } 1102 } 1103 </div> 1104 </div> 1105 if ( !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RememberToBuy.Value" ) ) ) 1106 { 1107 <div class="col-12 col-md-3 py-2"> 1108 <h3>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RememberToBuy.Label" )</h3> 1109 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RememberToBuy.Value" ) 1110 </div> 1111 } 1112 @sectionEnd() 1113 } 1114 1115 @*@ProductVideo( 1116 heading: GetString("Ecom:Product:Field.VideoHeading"), 1117 videoURL: GetString("Ecom:Product:Field.Video"), 1118 contentClasses: "col-12 col-md-10 mx-auto pt-5 pb-4", 1119 sectionClasses: "e-section p-section-bg-white" 1120 ) 1121 *@ 1122 1123 @if ( GetString( "Ecom:Product.CategoryField.Woodcare_General_Description.Technical_Information__Do_not_show_in_frontend.Value" ) != "True" ) 1124 { 1125 @sectionStart( 1126 contentClasses: "col-12 col-md-10 mx-auto py-6", 1127 sectionClasses: "e-section p-section-bg-light", 1128 collapseToggleTextExpand: Translate( "eCom Product - View more - Text", "View more" ), 1129 collapseToggleTextCollapse: Translate( "eCom Product - View less - Text", "View less" ), 1130 sectionCollapse: true 1131 ) 1132 1133 <div class="col-12"> 1134 <div class="pdf-page-break-avoid"> 1135 <div class="row"> 1136 <div class="col-12 col-md-9 pdf-col-12"> 1137 <div class="pdf-page-break-avoid"> 1138 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_General_Description.General_Description.Value" ) ) ) 1139 { 1140 <div class="border-bottom mb-4 pb-1 pdf-hidden small"> 1141 <h3 class="mb-1 text-uppercase">@GetString( "Ecom:Product.CategoryField.Woodcare_General_Description.General_Description.Label" )</h3> 1142 <div class="pdf-hidden">@GetString( "Ecom:Product.CategoryField.Woodcare_General_Description.General_Description.Value" )</div> 1143 </div> 1144 } 1145 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.LongDescription" ) ) ) 1146 { 1147 <div class="border-bottom mb-4 pb-1 pdf-only small"> 1148 <h3 class="mb-1 text-uppercase">@GetString( "Ecom:Product.CategoryField.Woodcare_General_Description.General_Description.Label" )</h3> 1149 <div class="e-product-text mb-2"> 1150 @GetString( "Ecom:Product.LongDescription" ) 1151 </div> 1152 </div> 1153 } 1154 </div> 1155 </div> 1156 <div class="col-12 col-md-3 order-first order-md-last pdf-hidden"> 1157 <div class="pdf-page-break-avoid"> 1158 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Header.DocumentID.Value" ) ) ) 1159 { 1160 <p class="font-weight-bold h1 text-primary">@GetString( "Ecom:Product.CategoryField.Woodcare_Header.DocumentID.Value" )</p> 1161 } 1162 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Header.HeaderText.Value" ) ) ) 1163 { 1164 <p>@GetString( "Ecom:Product.CategoryField.Woodcare_Header.HeaderText.Value" )</p> 1165 } 1166 </div> 1167 </div> 1168 </div> 1169 </div> 1170 1171 <div class="pdf-page-break-avoid"> 1172 <div class="row"> 1173 <div class="col-12 col-md-9 pdf-col-12"> 1174 @if ( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Do_not_show_in_frontend.Value.Clean" ) != "True" ) 1175 { 1176 <div class="border-bottom mb-4 pb-1 small"> 1177 <h3 class="mb-1 text-uppercase">@Translate( "eCom Product - Product Description - Text", "Product Description" )</h3> 1178 1179 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Product.Value" ) ) ) 1180 { 1181 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Product.Label" ):</strong> 1182 @GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Product.Value" ) 1183 } 1184 1185 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Gloss.Value" ) ) ) 1186 { 1187 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Gloss.Label" ):</strong> 1188 @GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Gloss.Value" ) 1189 } 1190 1191 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Farver.Value" ) ) ) 1192 { 1193 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Farver.Label" ):</strong> 1194 @GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Farver.Value" ) 1195 } 1196 1197 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Appearance.Value" ) ) ) 1198 { 1199 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Appearance.Label" ):</strong> 1200 @GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Appearance.Value" ) 1201 } 1202 1203 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Mixing_of_Colours.Value" ) ) ) 1204 { 1205 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Mixing_of_Colours.Label" ):</strong> 1206 @GetString( "Ecom:Product.CategoryField.Woodcare_Product_Description.Mixing_of_Colours.Value" ) 1207 } 1208 1209 </div> 1210 } 1211 </div> 1212 </div> 1213 </div> 1214 <div class="pdf-page-break-avoid"> 1215 <div class="row"> 1216 <div class="col-12 col-md-9 pdf-col-12"> 1217 @if ( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Do_not_show_in_frontend.Value.Clean" ) != "True" ) 1218 { 1219 <div class="border-bottom mb-4 pb-1 small"> 1220 <h3 class="mb-1 text-uppercase">@Translate( "eCom Product - Technical Data - Text", "Technical Data" )</h3> 1221 1222 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Coverage.Value" ) ) ) 1223 { 1224 <p> 1225 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Coverage.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Coverage.Value" ).StripHtml() 1226 </p> 1227 } 1228 1229 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.The_product_contains.Value" ) ) ) 1230 { 1231 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.The_product_contains.Label" ):</strong> 1232 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.The_product_contains.Value" ) 1233 } 1234 1235 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Mixing.Value" ) ) ) 1236 { 1237 <p> 1238 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Mixing.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Mixing.Value" ).StripHtml() 1239 </p> 1240 } 1241 1242 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.PH_Value.Value" ) ) ) 1243 { 1244 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.PH_Value.Label" ):</strong> 1245 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.PH_Value.Value" ) 1246 } 1247 1248 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Before_application.Value" ) ) ) 1249 { 1250 <p> 1251 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Before_application.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Before_application.OptionLabel" ).StripHtml() 1252 </p> 1253 } 1254 1255 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Potlife.Value" ) ) ) 1256 { 1257 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Potlife.Label" ):</strong> 1258 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Potlife.Value" ) 1259 } 1260 1261 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Application_tools.Value" ) ) ) 1262 { 1263 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Application_tools.Label" ):</strong> 1264 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Application_tools.Value" ) 1265 } 1266 1267 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Surface_temperature.Value" ) ) ) 1268 { 1269 <p> 1270 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Surface_temperature.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Surface_temperature.Value" ).StripHtml() 1271 </p> 1272 } 1273 1274 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Dilution.Value" ) ) ) 1275 { 1276 <p> 1277 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Dilution.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Dilution.Value" ).StripHtml() 1278 </p> 1279 } 1280 1281 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20NY.Value" ) ) ) 1282 { 1283 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20NY.Label" ):</strong> 1284 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20NY.Value" ) 1285 } 1286 1287 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20_C_and_50__RH.Value" ) ) ) 1288 { 1289 <p> 1290 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20_C_and_50__RH.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Drying_time_at_20_C_and_50__RH.Value" ).StripHtml() 1291 </p> 1292 } 1293 1294 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RH.Value" ) ) ) 1295 { 1296 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RH.Label" ):</strong> 1297 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.RH.Value" ) 1298 } 1299 1300 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Declaration.Value" ) ) ) 1301 { 1302 <p> 1303 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Declaration.Label" ):</strong> 1304 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Declaration.Value" ) 1305 </p> 1306 } 1307 1308 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Smudging.Value" ) ) ) 1309 { 1310 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Smudging.Label" ):</strong> 1311 @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Smudging.Value" ) 1312 } 1313 1314 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Cleaning_of_tools.Value" ) ) ) 1315 { 1316 <p> 1317 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Cleaning_of_tools.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Cleaning_of_tools.OptionLabel" ).StripHtml() 1318 </p> 1319 } 1320 1321 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Storage.Value" ) ) ) 1322 { 1323 <p> 1324 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Storage.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Storage.Value" ).StripHtml() 1325 </p> 1326 } 1327 1328 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Industrial_Parquet.Value" ) ) ) 1329 { 1330 <p> 1331 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Industrial_Parquet.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Industrial_Parquet.Value" ).StripHtml() 1332 </p> 1333 } 1334 1335 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Field_of_application.Value" ) ) ) 1336 { 1337 <p> 1338 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Field_of_application.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Field_of_application.Value" ).StripHtml() 1339 </p> 1340 } 1341 1342 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Weight.Value" ) ) ) 1343 { 1344 <p> 1345 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Weight.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Weight.Value" ).StripHtml() 1346 </p> 1347 } 1348 1349 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Used_Cloths.Value" ) ) ) 1350 { 1351 <p> 1352 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Used_Cloths.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Used_Cloths.Value" ).StripHtml() 1353 </p> 1354 } 1355 1356 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Disposal.Value" ) ) ) 1357 { 1358 <p> 1359 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Disposal.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Disposal.Value" ).StripHtml() 1360 </p> 1361 } 1362 1363 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Safety.Value" ) ) ) 1364 { 1365 <p> 1366 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Safety.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Safety.Value" ).StripHtml() 1367 </p> 1368 } 1369 1370 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Marking.Value" ) ) ) 1371 { 1372 <p> 1373 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Marking.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Marking.Value" ).StripHtml() 1374 </p> 1375 } 1376 1377 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Gloss.Value" ) ) ) 1378 { 1379 <p> 1380 <strong>@GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Gloss.Label" ):</strong> @GetString( "Ecom:Product.CategoryField.Woodcare_Technical_Data.Gloss.Value" ).StripHtml() 1381 </p> 1382 } 1383 1384 </div> 1385 } 1386 </div> 1387 </div> 1388 </div> 1389 <div class="pdf-page-break-avoid"> 1390 <div class="row"> 1391 <div class="col-12 col-md-9 pdf-col-12"> 1392 1393 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_System_Recommendations.System_Recommendations.Value" ) ) ) 1394 { 1395 <div class="border-bottom mb-4 pb-1 small"> 1396 <h3 class="mb-1 text-uppercase">@Translate( "eCom Product - System Recommendations - Text", "System Recommendations" )</h3> 1397 @GetString( "Ecom:Product.CategoryField.Woodcare_System_Recommendations.System_Recommendations.Value" ) 1398 </div> 1399 } 1400 </div> 1401 </div> 1402 </div> 1403 <div class="pdf-page-break-avoid"> 1404 <div class="row"> 1405 <div class="col-12 col-md-9 pdf-col-12"> 1406 1407 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Direction_For_Use.Direction_For_Use.Value" ) ) ) 1408 { 1409 <div class="border-bottom mb-4 pb-1 small"> 1410 <h3 class="mb-1 text-uppercase">@GetString( "Ecom:Product.CategoryField.Woodcare_Direction_For_Use.Direction_For_Use.Label" )</h3> 1411 @GetString( "Ecom:Product.CategoryField.Woodcare_Direction_For_Use.Direction_For_Use.Value" ) 1412 </div> 1413 } 1414 </div> 1415 </div> 1416 </div> 1417 <div class="pdf-page-break-avoid"> 1418 <div class="row"> 1419 <div class="col-12 col-md-9 pdf-col-12"> 1420 1421 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Precautionary_Measures.Precautionary_Measures.Value" ) ) ) 1422 { 1423 <div class="border-bottom mb-4 pb-1 small"> 1424 <h3 class="mb-1 text-uppercase">@GetString( "Ecom:Product.CategoryField.Woodcare_Precautionary_Measures.Precautionary_Measures.Label" )</h3> 1425 @GetString( "Ecom:Product.CategoryField.Woodcare_Precautionary_Measures.Precautionary_Measures.Value" ) 1426 </div> 1427 } 1428 </div> 1429 </div> 1430 </div> 1431 <div class="pdf-page-break-avoid"> 1432 <div class="row"> 1433 <div class="col-12 col-md-9 pdf-col-12"> 1434 1435 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Woodcare_Further_Information.Further_Information.Value" ) ) ) 1436 { 1437 <div class="border-bottom mb-4 pb-1 small"> 1438 <h3 class="mb-1 text-uppercase">@GetString( "Ecom:Product.CategoryField.Woodcare_Further_Information.Further_Information.Label" )</h3> 1439 @GetString( "Ecom:Product.CategoryField.Woodcare_Further_Information.Further_Information.Value" ) 1440 </div> 1441 } 1442 1443 </div> 1444 </div> 1445 </div> 1446 </div> 1447 @sectionEnd() 1448 } 1449 1450 @{ 1451 List<string> productsCategoryGenerelResourceList = new List<string>( new string[] 1452 { 1453 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource1.Value" ), 1454 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource2.Value" ), 1455 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource3.Value" ), 1456 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource4.Value" ), 1457 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource5.Value" ), 1458 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource6.Value" ), 1459 GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Ressource7.Value" ) 1460 } ); 1461 } 1462 1463 @if ( productsCategoryGenerelResourceList.Any( r => r != null ) ) 1464 { 1465 @sectionStart( 1466 contentClasses: "col-12 col-md-10 mx-auto pt-6 pb-3", 1467 sectionClasses: "e-section p-section-bg-white pdf-hidden" 1468 ) 1469 1470 Dictionary< string, List< dynamic > > resourcesList = new Dictionary< string, List< dynamic > >(); 1471 1472 foreach ( LoopItem pc in GetLoop( "ProductCategories" ) ) 1473 { 1474 1475 if ( pc.GetString( "Ecom:Product.Category.ID" ) == "ProductsCategoryGenerel" ) 1476 { 1477 foreach ( LoopItem pci in pc.GetLoop( "ProductCategoryFields" ) ) 1478 { 1479 if ( pci.GetString( "Ecom:Product.CategoryField.ID" ).ToLower().Contains( "doctype" ) == true && string.IsNullOrEmpty( pci.GetString( "Ecom:Product.CategoryField.Value" ) ) == false ) 1480 { 1481 if ( resourcesList.ContainsKey( pci.GetString( "Ecom:Product.CategoryField.Value" ) ) == false ) 1482 { 1483 resourcesList.Add( pci.GetString( "Ecom:Product.CategoryField.Value" ), new List< dynamic >() ); 1484 } 1485 1486 string catIdNew = string.Format( "Ressource #{0}", System.Text.RegularExpressions.Regex.Match( pci.GetString( "Ecom:Product.CategoryField.Label" ), @"\d+" ).Value ); 1487 string catLabelNew = string.Format( "Ressource #{0} Type", System.Text.RegularExpressions.Regex.Match( pci.GetString( "Ecom:Product.CategoryField.Label" ), @"\d+" ).Value ); 1488 1489 string catId = pci.GetString( "Ecom:Product.CategoryField.Label" ).Replace( " Doctype", string.Empty ); 1490 string catLabel = pci.GetString( "Ecom:Product.CategoryField.Label" ).Replace( "Doctype", "Type" ); 1491 1492 LoopItem pdfLinkItem = pc.GetLoop( "ProductCategoryFields" ).FirstOrDefault( pcil => pcil.GetString( "Ecom:Product.CategoryField.Label" ) == catIdNew ); 1493 LoopItem pdfTextItem = pc.GetLoop( "ProductCategoryFields" ).FirstOrDefault( pcil => pcil.GetString( "Ecom:Product.CategoryField.Label" ) == catLabelNew ); 1494 1495 foreach ( LoopItem damn in pc.GetLoop( "ProductCategoryFields" ) ) 1496 { 1497 } 1498 1499 if ( pdfLinkItem != null && pdfTextItem != null && string.IsNullOrEmpty( pdfLinkItem.GetString( "Ecom:Product.CategoryField.Value" ) ) == false ) 1500 { 1501 resourcesList[ pci.GetString( "Ecom:Product.CategoryField.Value" ) ].Add( new 1502 { 1503 pdfLinkItem = pdfLinkItem.GetString( "Ecom:Product.CategoryField.Value" ), 1504 pdfTextItem = pdfTextItem.GetString( "Ecom:Product.CategoryField.Value" ) 1505 } ); 1506 } 1507 } 1508 } 1509 } 1510 } 1511 1512 1513 <h2 class="col-12 x">@Translate( "Resources", "Resources" )</h2> 1514 if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product:Field.DocumentationPdf.Value" ) ) ) 1515 { 1516 <div class="col-4 col-md-2 mb-4"> 1517 <a href="@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )"> 1518 <img alt="" class="border col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )&Format=jpg&Width=300&Height=440&Quality=75"> 1519 </a> 1520 <h4 class="mt-1 small">@GetString( "Ecom:Product:Field.PDFDocumentTitle.Value" )</h4> 1521 </div> 1522 } 1523 1524 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1525 { 1526 if ( kpv.Key == "SafetyDataSheets" ) 1527 { 1528 foreach ( dynamic item in kpv.Value ) 1529 { 1530 <div class="col-4 col-md-2 mb-4"> 1531 <a href="@item.pdfLinkItem"> 1532 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1533 </a> 1534 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1535 </div> 1536 } 1537 } 1538 } 1539 1540 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1541 { 1542 if ( kpv.Key == "Brochure" ) 1543 { 1544 foreach ( dynamic item in kpv.Value ) 1545 { 1546 <div class="col-4 col-md-2 mb-4"> 1547 <a href="@item.pdfLinkItem"> 1548 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1549 </a> 1550 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1551 </div> 1552 } 1553 } 1554 } 1555 1556 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1557 { 1558 if ( kpv.Key == "StyleChart" ) 1559 { 1560 foreach ( dynamic item in kpv.Value ) 1561 { 1562 <div class="col-4 col-md-2 mb-4"> 1563 <a href="@item.pdfLinkItem"> 1564 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1565 </a> 1566 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1567 </div> 1568 } 1569 } 1570 } 1571 1572 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1573 { 1574 if ( kpv.Key == "Certificates" ) 1575 { 1576 foreach ( dynamic item in kpv.Value ) 1577 { 1578 <div class="col-4 col-md-2 mb-4"> 1579 <a href="@item.pdfLinkItem"> 1580 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1581 </a> 1582 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1583 </div> 1584 } 1585 } 1586 } 1587 1588 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1589 { 1590 if ( kpv.Key == "TechnicalInformation" ) 1591 { 1592 foreach ( dynamic item in kpv.Value ) 1593 { 1594 <div class="col-4 col-md-2 mb-4"> 1595 <a href="@item.pdfLinkItem"> 1596 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1597 </a> 1598 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1599 </div> 1600 } 1601 } 1602 } 1603 1604 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1605 { 1606 if ( kpv.Key == "Image" ) 1607 { 1608 foreach ( dynamic item in kpv.Value ) 1609 { 1610 <div class="col-4 col-md-2 mb-4"> 1611 <a href="@item.pdfLinkItem"> 1612 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1613 </a> 1614 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1615 </div> 1616 } 1617 } 1618 } 1619 1620 foreach ( KeyValuePair< string, List< dynamic > > kpv in resourcesList ) 1621 { 1622 if ( kpv.Key == "SpecificationResource" ) 1623 { 1624 foreach ( dynamic item in kpv.Value ) 1625 { 1626 <div class="col-4 col-md-2 mb-4"> 1627 <a href="@item.pdfLinkItem"> 1628 <img alt="" class="col-12 image-lazyload image-lazyloading js-image-lazyloading p-0" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@item.pdfLinkItem&Format=jpg&Width=300&Height=440&Quality=75"> 1629 </a> 1630 <h4 class="mt-1 small">@item.pdfTextItem</h4> 1631 </div> 1632 } 1633 } 1634 } 1635 1636 @sectionEnd() 1637 } 1638 1639 1640 @{ 1641 List<string> productsCategoryFieldFloorTechnicalDocumentList = new List<string>( new string[] 1642 { 1643 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc1.Value" ), 1644 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc2.Value" ), 1645 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc3.Value" ), 1646 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc4.Value" ), 1647 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc5.Value" ), 1648 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc6.Value" ), 1649 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc7.Value" ), 1650 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc8.Value" ), 1651 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc9.Value" ), 1652 GetString( "Ecom:Product.CategoryField.FloorTechnicalDocuments.TecDoc10.Value" ) 1653 } ); 1654 } 1655 1656 @if ( productsCategoryFieldFloorTechnicalDocumentList.Any( t => t != null ) ) 1657 { 1658 @sectionStart( 1659 contentClasses: "col-12 col-md-10 mx-auto pt-6 pb-3", 1660 sectionClasses: "e-section col-12 p-section-bg-light pdf-hidden" 1661 ) 1662 <h2 class="col-12">@Translate("Technical Documents","Technical Documents")</h2> 1663 @:@foreach (var techDocs in GetLoop("TechnicalDocuments")) 1664 { 1665 <div class="col-4 col-md-2 mb-4"> 1666 <a href="@techDocs.GetValue("URL")"> 1667 <img alt="" class="col-12 p-0 border js-image-lazyloading image-lazyloading image-lazyload" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="/admin/public/getimage.ashx?Crop=0&Image=@techDocs.GetValue("URL")&Format=jpg&Width=300&Height=440&Quality=75"> 1668 </a> 1669 <h4 class="mt-1 small"><span class="text-primary">@techDocs.GetValue("Id")</span><br/> @techDocs.GetValue("Title")</h4> 1670 </div> 1671 } 1672 1673 @sectionEnd() 1674 } 1675 1676 1677 1678 @if ( !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Calculator.Value.Clean" ) ) ) 1679 { 1680 <!-- Modal --> 1681 <div aria-hidden="true" aria-labelledby="calculatorLabel" class="fade modal" id="calculator" role="dialog" tabindex="-1"> 1682 <div class="modal-dialog modal-lg" role="document"> 1683 <div class="modal-content"> 1684 <div class="modal-header"> 1685 <h2 class="modal-title" id="calculatorLabel">@Translate( "Ecom Woodcare Calculate Heading", "Beregn" )</h2> 1686 <button aria-label="Close" class="close" data-dismiss="modal" type="button"> 1687 <span aria-hidden="true">×</span> 1688 </button> 1689 </div> 1690 <div class="modal-body p-0"> 1691 @GetString( "Ecom:Product.CategoryField.ProductsCategoryGenerel.Calculator.Value.Clean" ) 1692 </div> 1693 </div> 1694 </div> 1695 </div> 1696 } 1697 1698 @using Co3.Espresso.Base.Extensions 1699 @using Co3.Espresso.Base.Models 1700 @using Co3.Espresso.Website.Services 1701 @using Dynamicweb.Ecommerce.Products 1702 @using Dynamicweb.Ecommerce.Products.Categories 1703 @{ 1704 Product dynamicwebProduct1 = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), Dynamicweb.Ecommerce.Common.Context.LanguageID, false); 1705 } 1706 1707 @if ( GetLoop( "ProductRelatedGroups" ).Any( prg => prg.GetValue( "Ecom:Product:RelatedGroup.Name" ).ToString().Contains( "COMPARISON" ) ) ) 1708 { 1709 <!-- Button trigger modal --> 1710 <div class="d-flex justify-content-center mb-3 position-fixed w-100" style="bottom: 0; left: 0; z-index: 1"> 1711 <button class="btn btn-success p-2 px-4" data-target="#compare" data-toggle="modal" type="button"> 1712 <i class="material-icons material-icons-large ">sync_alt</i> 1713 <span>@Translate("Sammenlign", "Sammenlign")</span> 1714 </button> 1715 </div> 1716 1717 } 1718 1719 <!-- Modal --> 1720 <div aria-hidden="true" aria-labelledby="compareLabel" class="fade modal" id="compare" role="dialog" tabindex="-1"> 1721 <div class="modal-dialog modal-lg" role="document"> 1722 <div class="modal-content"> 1723 <div class="modal-header"> 1724 <h2 class="modal-title" id="compareLabel">@Translate("Sammenlign", "Sammenlign")</h2> 1725 <button aria-label="Close" class="close" data-dismiss="modal" type="button"> 1726 <span aria-hidden="true">×</span> 1727 </button> 1728 </div> 1729 <div class="modal-body p-0 horizontal-scroll"> 1730 1731 1732 @if ( GetLoop( "ProductRelatedGroups" ).Any( prg => prg.GetValue( "Ecom:Product:RelatedGroup.Name" ).ToString().Contains( "COMPARISON" ) ) ) 1733 { 1734 LoopItem group = GetLoop( "ProductRelatedGroups" ).First( prg => prg.GetValue( "Ecom:Product:RelatedGroup.Name" ).ToString().Contains( "COMPARISON" ) ); 1735 1736 <div class="d-flex"> 1737 1738 @foreach ( LoopItem fieldDisplayGroup in GetLoop( "FieldDisplayGroups" ).Where( fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Comparison_Woodcare" ) ) 1739 { 1740 Detail productDetail = Dynamicweb.Ecommerce.Services.Details.GetDefaultDetail( dynamicwebProduct ); 1741 1742 <div class="d-flex flex-column js-woodcare-compare-data woodcare-compare-data active"> 1743 <img class="image-lazyload p-img" src="@ImageService.Instance.GetImageURL( productDetail.Value ), 200, 0, 5 )" style="max-height: 134px; max-width: 200px;object-fit:contain;"> 1744 <h3 class="mb-2 text-primary"> 1745 <span class="pl-3">@dynamicwebProduct1.Name</span> 1746 </h3> 1747 @foreach ( LoopItem relatedProductfield in fieldDisplayGroup.GetLoop( "Fields" ) ) 1748 { 1749 1750 <div class="border-top js-compare-div px-3 py-2" data-row-name="@relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Name" )" style="width: 300px; white-space: initial;"> 1751 1752 <h4 class="small">@GetTranslatedLabel( relatedProductfield )</h4> 1753 1754 @if ( !string.IsNullOrEmpty( relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) ) 1755 { 1756 if ( relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ).Contains( "_star" ) ) 1757 { 1758 string numberOfStars = relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" ); 1759 numberOfStars = numberOfStars.Replace( "-star", "" ); 1760 int intNumberOfStars = Convert.ToInt16( numberOfStars ); 1761 1762 int score = 1 * Convert.ToInt32( "6" ); 1763 for ( int i = 0; i < intNumberOfStars; i++ ) 1764 { 1765 string ratings = string.Empty; 1766 if ( i < score ) 1767 { 1768 ratings = "text-primary"; 1769 } 1770 <span class="material-icons @ratings"> 1771 star 1772 </span> 1773 } 1774 } 1775 else 1776 { 1777 <span class="small">@relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</span> 1778 } 1779 } 1780 1781 </div> 1782 } 1783 </div> 1784 } 1785 <div class="d-flex horizontal-scroll-desktop"> 1786 @foreach ( LoopItem product in group.GetLoop( "RelatedProducts" ) ) 1787 { 1788 Product relatedProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ), Dynamicweb.Ecommerce.Common.Context.LanguageID, false ); 1789 Detail relatedProductDetail = Dynamicweb.Ecommerce.Services.Details.GetDefaultDetail( relatedProduct ); 1790 1791 <div class="d-flex flex-column js-woodcare-compare-data woodcare-compare-data"> 1792 <img class="image-lazyload p-img" src="@ImageService.Instance.GetImageURL( relatedProductDetail.Value ), 200, 0, 5 )" style="max-height: 134px; max-width: 200px;object-fit:contain;"> 1793 <h3 class="mb-2 text-primary"> 1794 <span class="pl-3">@relatedProduct.Name</span> 1795 </h3> 1796 1797 @foreach ( LoopItem fieldDisplayGroup in product.GetLoop( "FieldDisplayGroups" ).Where( fdg => fdg.GetString( "Ecom:FieldDisplayGroup.Name" ) == "Comparison_Woodcare" ) ) 1798 { 1799 foreach ( LoopItem relatedProductfield in fieldDisplayGroup.GetLoop( "Fields" ) ) 1800 { 1801 <div class="border-top js-compare-div px-3 py-2" data-row-name="@relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Name" )" style="width: 300px; white-space: initial;"> 1802 <h4 class="small">@GetTranslatedLabel( relatedProductfield )</h4> 1803 1804 @if ( !string.IsNullOrEmpty( relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) ) 1805 { 1806 if ( relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ).Contains( "_star" ) ) 1807 { 1808 string numberOfStars = relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" ); 1809 numberOfStars = numberOfStars.Replace( "-star", "" ); 1810 int intNumberOfStars = Convert.ToInt16( numberOfStars ); 1811 1812 int score = 1 * Convert.ToInt32( "6" ); 1813 for ( int i = 0; i < intNumberOfStars; i++ ) 1814 { 1815 string ratings = string.Empty; 1816 if ( i < score ) 1817 { 1818 ratings = "text-primary"; 1819 } 1820 <span class="material-icons @ratings"> 1821 star 1822 </span> 1823 } 1824 } 1825 else 1826 { 1827 <span class="small">@relatedProductfield.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</span> 1828 } 1829 } 1830 </div> 1831 } 1832 } 1833 </div> 1834 } 1835 </div> 1836 </div> 1837 } 1838 1839 </div> 1840 </div> 1841 </div> 1842 </div> 1843 1844 @functions 1845 {public string GetTranslatedLabel(LoopItem relatedProductfield) 1846 { 1847 string returnValue = relatedProductfield.GetString("Ecom:FieldDisplayGroup.Field.Name"); 1848 1849 IList<Category> categories = Category.GetCategoriesByLanguage( Dynamicweb.Ecommerce.Common.Context.LanguageID ); 1850 string[] facetFieldSplit = relatedProductfield.GetString("Ecom:FieldDisplayGroup.Field.Id").Split( '|' ); 1851 if ( facetFieldSplit.Length == 3 ) 1852 { 1853 string categoryId = facetFieldSplit[1]; 1854 string fieldId = facetFieldSplit[2]; 1855 foreach (Category category in categories.Where( c => c.Id == categoryId) ) 1856 { 1857 1858 foreach (Field categoryField in category.Fields.Where( cf => cf.Id == fieldId) ) 1859 { 1860 1861 FieldOption fieldOption = categoryField.FieldOptions.FirstOrDefault( fo => fo.Value == relatedProductfield.GetString("Ecom:FieldDisplayGroup.Field.Value") ); 1862 1863 if ( fieldOption != null && !string.IsNullOrEmpty( fieldOption.Name ) ) 1864 { 1865 returnValue = categoryField.Label; 1866 } 1867 } 1868 } 1869 } 1870 return returnValue; 1871 } 1872 } 1873 1874 1875 <script type="application/ld+json"> 1876 { 1877 "@@context" : "http://schema.org", 1878 "@@type" : "Product", 1879 "category" : "@groupService.GetGroup(primaryGroupID).Name", 1880 "description" : "@GetString("Ecom:Product.LongDescription").StripHtml()", 1881 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 1882 "name" : "@GetString("Ecom:Product.Name").StripHtml()", 1883 "image" : "@( GetGlobalValue( "Global:Request.Scheme" ) + "://" + GetGlobalValue( "Global:Request.Host" ) + GetString("Ecom:Product.ImageLarge.Clean") )", 1884 "offers" : { 1885 "@@type" : "Offer", 1886 "availability" : "http://schema.org/InStock", 1887 "price" : "@GetDouble("Ecom:Product.Price.Price")", 1888 "priceCurrency" : "@EcomContext.Currency.Code" 1889 } 1890 } 1891 </script> 1892 1893 1894 <code class="js-e-breadcrumb-item-append" data-link="@HttpUtility.HtmlAttributeEncode( ProductService.Instance.GetProductLink( GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), GetString( "Ecom:Product.ID" ) ) )" data-text="@HttpUtility.HtmlAttributeEncode( GetString( "Ecom:Product.Name" ) )"></code> 1895 1896 </div> 1897 1898 <script> 1899 dataLayer.push({ 1900 event: 'view_item', 1901 ecommerce: { 1902 items: [ 1903 { 1904 item_name: "@GetString( "Ecom:Product.Name" )", 1905 item_id: "@GetString( "Ecom:Product.ID" )", 1906 item_category: "@groupService.GetGroup(primaryGroupID).Name", 1907 } 1908 ] 1909 } 1910 }); 1911 </script> 1912 @sectionStart()