Error executing template "Designs/junckers/eCom/Product/junckers-cases.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_8fb52dc6cc994c1d94e06c152511c40e.Execute() in D:\dynamicweb.net\Solutions\junckers.espresso4.dk\Files\Templates\Designs\junckers\eCom\Product\junckers-cases.cshtml:line 633
   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 RazorTemplateBase< RazorTemplateModel< Template > > 2 @using Dynamicweb.Ecommerce.Prices; 3 @using Co3.Espresso.Base.Extensions; 4 @using Co3.Espresso.Base.Models; 5 @using Co3.Espresso.Website.Models.FrontEnd 6 @using Co3.Espresso.Website.Services 7 @using Dynamicweb.Ecommerce.Common.eCom7 8 @using Dynamicweb.Rendering 9 @using System.Web 10 @using Dynamicweb.Ecommerce.Products; 11 @using ProductService = Co3.Espresso.Website.Services.ProductService 12 @using System.Globalization 13 @using Co3.Espresso.Base.Extensions 14 @using Co3.Espresso.DownloadManager.Models 15 @using Co3.Espresso.Website.Models.FrontEnd 16 @using Co3.Espresso.Website.Services 17 @using Dynamicweb.Content 18 @using Dynamicweb.Frontend 19 @using Dynamicweb.Rendering 20 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 21 22 @functions { 23 24 public string getCountryCodeFromArea( Area area ) 25 { 26 RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); 27 return regionInfo.TwoLetterISORegionName; 28 } 29 30 public dynamic GetPriceInfo( string beforePrice = "", string basicPrice = "" ) 31 { 32 double vat = EcomContext.Country.Vat; 33 double dblBeforePrice = 0; 34 double.TryParse( beforePrice, out dblBeforePrice ); 35 double dblBasicPrice = 0; 36 double.TryParse( basicPrice, out dblBasicPrice ); 37 double dblBeforePriceWithVat = 0; 38 double dblDiffPrice = 0; 39 int pct = 0; 40 41 if ( dblBeforePrice > 0 ) 42 { 43 dblBeforePriceWithVat = dblBeforePrice * ( ( vat / 100d ) + 1 ); 44 if ( dblBeforePriceWithVat > dblBasicPrice ) 45 { 46 dblDiffPrice = dblBeforePriceWithVat - dblBasicPrice; 47 pct = (int)Math.Ceiling((( 100d / dblBeforePriceWithVat ) * dblDiffPrice)); 48 } 49 } 50 51 dynamic returnValue = new 52 { 53 beforePriceWithVat = dblBeforePriceWithVat, 54 beforePriceWithVatFormatted = ProductService.Instance.GetPriceFormatted(dblBeforePriceWithVat), 55 basicPrice = dblBasicPrice, 56 basicPriceFormatted = ProductService.Instance.GetPriceFormatted(dblBasicPrice), 57 diffPrice = dblDiffPrice, 58 diffPriceFormatted = ProductService.Instance.GetPriceFormatted(dblDiffPrice), 59 pct = pct, 60 vat = vat 61 }; 62 return returnValue; 63 } 64 65 } 66 67 68 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null) 69 { 70 if ( string.IsNullOrEmpty( content ) == false ) 71 { 72 ClassList headingClassList = new ClassList(); 73 headingClassList.AddClasses( "col-12" ); 74 ClassList contentClassList = new ClassList(); 75 contentClassList.AddClasses( "col-12" ); 76 77 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses ) 78 79 if ( string.IsNullOrEmpty( heading ) == false ) 80 { 81 <div class="@headingClassList"> 82 <h2>@heading</h2> 83 </div> 84 } 85 <div class="@contentClassList"> 86 @content 87 </div> 88 89 @sectionEnd() 90 } 91 } 92 93 94 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 95 { 96 if ( string.IsNullOrEmpty( videoURL ) == false ) 97 { 98 ClassList headingClassList = new ClassList(); 99 headingClassList.AddClasses( "col-12" ); 100 ClassList contentClassList = new ClassList(); 101 contentClassList.AddClasses( "col-12" ); 102 103 104 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 105 106 if ( string.IsNullOrEmpty( heading ) == false ) 107 { 108 <div class="@headingClassList"> 109 <h2>@heading</h2> 110 </div> 111 } 112 113 <div class="@contentClassList"> 114 <div class="embed-responsive embed-responsive-16by9 mb-2"> 115 <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 116 </div> 117 </div> 118 @sectionEnd() 119 } 120 } 121 122 @helper ProductRelatedProducts(string sectionClasses = "e-section p-section p-section-bg-white pt-3 border-bottom", string contentClasses = null, string heading = null, 123 IEnumerable<RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem> productLoop = null) 124 { 125 if ( productLoop != null && productLoop.Any() == true ) 126 { 127 ClassList headingClassList = new ClassList(); 128 headingClassList.AddClasses( "col-10 mx-auto" ); 129 ClassList contentClassList = new ClassList(); 130 contentClassList.AddClasses( "col-10 mx-auto" ); 131 132 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 133 134 if ( string.IsNullOrEmpty( heading ) == false ) 135 { 136 <div class="@headingClassList"> 137 <h2>@heading</h2> 138 </div> 139 } 140 141 142 <div class="@contentClassList"> 143 <div class="e-products mb-2"> 144 <div class="row"> 145 @{ 146 string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth( null ).ToResponsiveClasses(); 147 } 148 @foreach ( RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem product in productLoop ) 149 { 150 @ProductlistItem( product, productlistItemClassList ) 151 } 152 </div> 153 </div> 154 </div> 155 156 @sectionEnd() 157 } 158 } 159 160 @helper ProductlistItem(RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem product, string productlistItemClassList = null) 161 { 162 if ( product != null ) 163 { 164 dynamic productData = new 165 { 166 id = product.GetString( "Ecom:Product.ID" ), 167 url = ProductService.Instance.GetProductLink( product.GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), product.GetString( "Ecom:Product.ID" ) ), 168 number = product.GetString( "Ecom:Product.Number" ), 169 name = product.GetString( "Ecom:Product.Name" ), 170 imageLarge = ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageLarge.Clean" ), 450, 350, 5 ), 171 price = ProductService.Instance.GetPriceFormatted( product.GetDouble( "Ecom:Product.Price.Price" ) ), 172 descriptionShortExtra01 = product.GetString( "Ecom:Product:Field.DescriptionShortExtra01" ), 173 descriptionShort = product.GetString( "Ecom:Product.ShortDescription" ), 174 stock = new 175 { 176 id = product.GetString( "Ecom:Product:Stock.ID" ), 177 quantity = product.GetString( "Ecom:Product.Stock" ), 178 text = product.GetString( "Ecom:Product:Stock.Text" ), 179 delivery = product.GetString( "Ecom:Product:Stock.DeliveryText" ) 180 } 181 }; 182 183 <div class="@productlistItemClassList"> 184 <div class="e-products-item js-e-products-item"> 185 <div class="e-products-item-container"> 186 <div class="junckers-relatedproducts-item-image-container" style="background: url(@productData.imageLarge)"> 187 @if ( string.IsNullOrEmpty( productData.descriptionShort ) == false ) 188 {<div class="junckers-relatedproducts-item-text-container py-1"> 189 <p class="e-products-item-text mb-0 px-2 small"> 190 <strong>Package Size</strong> 191 </p> 192 <p class="e-products-item-text mb-0 text-muted px-2 small"> 193 @productData.descriptionShort 194 </p> 195 </div> 196 } 197 </div> 198 <div class="e-products-item-text-container text-center"> 199 <h3 class="e-products-item-name mb-0"> 200 @productData.name 201 </h3> 202 @* <p class="e-products-item-text mb-0"> *@ 203 @* <small class="e-products-item-price small text-muted"> *@ 204 @* <a href="@productData.url"> *@ 205 @* @productData.price *@ 206 @* </a> *@ 207 @* </small> *@ 208 @* </p> *@ 209 </div> 210 </div> 211 </div> 212 </div> 213 } 214 } 215 216 217 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string collapseToggleTextExpand = "Se mere", string collapseToggleTextCollapse = "Se mindre") 218 { 219 ClassList sectionClassList = new ClassList(); 220 sectionClassList.AddClasses( sectionClasses ); 221 ClassList contentClassList; 222 string collapseId = Guid.NewGuid().ToString( "N" ); 223 ClassList collapseToggleClassList = new ClassList(); 224 if ( contentClasses == null ) 225 { 226 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); 227 } 228 else 229 { 230 contentClassList = new ClassList(); 231 contentClassList.AddClasses( contentClasses ); 232 } 233 if ( sectionCollapse == true ) 234 { 235 sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); 236 collapseToggleClassList.AddClasses( contentClasses ); 237 collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); 238 contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); 239 } 240 @:<section class="@sectionClassList"> 241 @:<div class="container-fluid"> 242 @:<div class="row"> 243 244 if ( sectionCollapse == true ) 245 // TODO: SplitPattern into seperate heler function 246 { 247 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> 248 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button"> 249 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> 250 </button> 251 <small class="p-section-collapse-toggle-text h4" data-expand-text="@collapseToggleTextExpand" data-collapse-text="@collapseToggleTextCollapse"></small> 252 </div> 253 } 254 255 @:<div class="@contentClassList" id="@collapseId"> 256 @:<div class="row"> 257 } 258 259 @helper sectionEnd() 260 { 261 @:</div> 262 @:</div> 263 @:</div> 264 @:</div> 265 @:</section> 266 } 267 268 269 270 271 @{ 272 string logoPrimary = Espresso.Area.Item.LogoPrimary; 273 bool isRequestingPDF = System.Web.HttpContext.Current.Request[ "pdfgeneratorworking" ] == "true" || System.Web.HttpContext.Current.Request[ "newpdf" ] == "true" || System.Web.HttpContext.Current.Request[ "newpdf" ] == "test"; 274 275 dynamic JSON = new 276 { 277 productid = GetValue( "Ecom:Product.ID" ), 278 variantoptions = new List< dynamic >(), 279 variantcombinations = new List< dynamic >() 280 }; 281 282 foreach ( LoopItem variantCombo in GetLoop( "VariantCombinations" ) ) 283 { 284 if ( variantCombo.GetBoolean( "Ecom:VariantCombination.Product.Active" ) == true ) 285 { 286 JSON.variantcombinations.Add( new 287 { 288 id = variantCombo.GetString( "Ecom:VariantCombination.Product.ID" ), 289 name = variantCombo.GetString( "Ecom:VariantCombination.Product.Name" ), 290 text = variantCombo.GetString( "Ecom:VariantCombination.VariantText" ), 291 number = variantCombo.GetString( "Ecom:VariantCombination.Product.Number" ), 292 price = variantCombo.GetDouble( "Ecom:VariantCombination.Product.Price.Price" ), 293 imageLarge = variantCombo.GetString( "Ecom:VariantCombination.Product.ImageLarge.Clean" ), 294 stock = variantCombo.GetDouble( "Ecom:VariantCombination.Product.Stock" ), 295 stockState = variantCombo.GetString( "Ecom:VariantCombination.Product.Stock.Text" ), 296 delivery = variantCombo.GetString( "Ecom:VariantCombination.Product.Stock.DeliveryText" ) 297 } ); 298 } 299 } 300 string primaryGroupID = GetString( "Ecom:Product.PrimaryGroupID" ); 301 GroupService groupService = new GroupService(); 302 303 304 Product dynamicwebProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), Dynamicweb.Ecommerce.Common.Context.LanguageID, false); 305 306 IEnumerable<Detail> details = Dynamicweb.Ecommerce.Services.Details.GetDetails( dynamicwebProduct, "0" ).Where( d => d.GroupId == 1 ); 307 } 308 309 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 310 311 @{ 312 string eComProductCanonical = string.Empty; 313 string globalValueUrl = GetGlobalValue( "Global:Pageview.Url" ); 314 315 if ( GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) > -1 ) 316 { 317 globalValueUrl = GetGlobalValue( "Global:Pageview.Url" ).Substring( 0, GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) ); 318 } 319 320 if ( string.IsNullOrEmpty( GetString( "Ecom:Product.Canonical" ) ) == false ) 321 { 322 eComProductCanonical = String.Format( "{0}://{1}{2}", GetGlobalValue( "Global:Request.Scheme" ), GetGlobalValue( "Global:Request.Host" ), GetString( "Ecom:Product.Canonical" ) ); 323 } 324 else 325 { 326 eComProductCanonical = String.Format( "{0}://{1}{2}", GetGlobalValue( "Global:Request.Scheme" ), GetGlobalValue( "Global:Request.Host" ), globalValueUrl ); 327 } 328 string metaTitle = @GetString( "Ecom:Product.MetaTitle" ); 329 string metaDescription = @GetString( "Ecom:Product.MetaDescription" ); 330 } 331 332 @SnippetStart( "productMetaTags" ) 333 334 @{ 335 if (string.IsNullOrEmpty( metaTitle ) ) 336 { 337 metaTitle = GetString( "Ecom:Product.Name" ); 338 } 339 340 } 341 342 <title>@metaTitle</title> 343 <meta title="@metaTitle" /> 344 <meta name="description" content="@metaDescription" /> 345 <link rel="canonical" href="@eComProductCanonical"> 346 @SnippetEnd( "productMetaTags" ) 347 348 @sectionEnd() 349 350 <input id="js-junckers-case-documentation-link-value" type="hidden" value="@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )" /> 351 352 <section class="align-items-center e-reveal-done e-section mb-0 p p-banner p-banner-medium pb-auto pt-auto junckers-case-banner pdf-page-break-avoid @(isRequestingPDF ? "pdf-case-banner-height" : "")"> 353 <div class="p-banner-img-center-middle p-img-container" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetValue( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=2000&Height=&Quality=90)" title=""></div> 354 <div class="is-visible p-banner-txt-left-bottom p-txt-animate p-txt-container w-100"> 355 <div class="container-fluid"> 356 <div class="p-txt-wrapper row"> 357 <div class="col-11 col-md-9 mx-auto p-0"> 358 </div> 359 </div> 360 </div> 361 </div> 362 </section> 363 364 @sectionStart( "e-section p-section-bg-white pt-4" ) 365 366 <div class="e-product js-e-product junckers-product-case-description col-12 px-2 @(isRequestingPDF ? "junckers-product-case-text-min-height" : "")" data-pdf="@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )"> 367 <div class="col-12 col-12 px-0"> 368 369 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.ShortDescription" ) ) ) 370 { 371 <div class="row"> 372 <div class="col-12 col-md-4"> 373 <h1 class="e-product-name mb-0 pdf-h1"> 374 @GetString( "Ecom:Product.Name" ) 375 </h1> 376 <div class="e-product-text-container h2 pdf-h2 mt-1"> 377 @GetString( "Ecom:Product.ShortDescription" ) 378 </div> 379 <div class="e-product-text-container row small mb-4"> 380 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.Categories.Value" ) ) ) 381 { 382 <div class="col-6"> 383 <h3> 384 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Categories.Label" ) 385 </h3> 386 <ul class="material-icons-ul mt-0 mb-1"> 387 @{ 388 string[] detailsSpecialProps = GetString( "Ecom:Product.CategoryField.CasesGeneral.Categories.OptionLabel" ).Split( ',' ); 389 } 390 @foreach ( string prop in detailsSpecialProps ) 391 { 392 if ( prop != "" ) 393 { 394 <li><i class="material-icons">check</i>@prop</li> 395 } 396 } 397 </ul> 398 </div> 399 } 400 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.SquareMeters.Value" ) ) ) 401 { 402 <div class="col-6"> 403 <h3> 404 @GetString( "Ecom:Product.CategoryField.CasesGeneral.SquareMeters.Label" ) 405 </h3> 406 <p> 407 @GetString( "Ecom:Product.CategoryField.CasesGeneral.SquareMeters.Value" ) m<sup>2</sup> 408 </p> 409 </div> 410 } 411 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.Architect.Value" ) ) ) 412 { 413 <div class="col-6"> 414 <h3> 415 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Architect.Label" ) 416 </h3> 417 <p> 418 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Architect.Value" ) 419 </p> 420 </div> 421 } 422 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.Contractor.Value" ) ) ) 423 { 424 <div class="col-6"> 425 <h3> 426 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Contractor.Label" ) 427 </h3> 428 <p> 429 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Contractor.Value" ) 430 </p> 431 </div> 432 } 433 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.Country.Value" ) ) ) 434 { 435 <div class="col-6"> 436 <h3> 437 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Country.Label" ) 438 </h3> 439 <p> 440 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Country.OptionLabel" ) 441 </p> 442 </div> 443 } 444 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.CasesGeneral.Location.Value" ) ) ) 445 { 446 <div class="col-6"> 447 <h3> 448 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Location.Label" ) 449 </h3> 450 <p> 451 @GetString( "Ecom:Product.CategoryField.CasesGeneral.Location.Value" ) 452 </p> 453 </div> 454 } 455 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.FloorType.Value" ) ) ) 456 { 457 <div class="col-6"> 458 <h3> 459 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.FloorType.Label" ) 460 </h3> 461 <p> 462 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.FloorType.OptionLabel" ) 463 </p> 464 </div> 465 } 466 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.WoodType.Value" ) ) ) 467 { 468 <div class="col-6"> 469 <h3> 470 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.WoodType.Label" ) 471 </h3> 472 <p> 473 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.WoodType.OptionLabel" ) 474 </p> 475 </div> 476 } 477 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Finish.Value" ) ) ) 478 { 479 <div class="col-6"> 480 <h3> 481 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Finish.Label" ) 482 </h3> 483 <p> 484 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Finish.OptionLabel" ) 485 </p> 486 </div> 487 } 488 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Segment.Value" ) ) ) 489 { 490 <div class="col-6"> 491 <h3> 492 @GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Segment.Label" ) 493 </h3> 494 <ul class="material-icons-ul mt-0 mb-1"> 495 @{ 496 string[] detailsSpecialProps = GetString( "Ecom:Product.CategoryField.Cases_Wood_Flooring.Segment.OptionLabel" ).Split( ',' ); 497 } 498 @foreach ( string prop in detailsSpecialProps ) 499 { 500 if ( prop != "" ) 501 { 502 <li><i class="material-icons">check</i>@prop</li> 503 } 504 } 505 </ul> 506 </div> 507 } 508 </div> 509 </div> 510 @if ( !string.IsNullOrWhiteSpace( GetString( "Ecom:Product.LongDescription" ) ) ) 511 { 512 <div class="col-12 col-md-8"> 513 <div class="e-product-text-container mt-1 @(isRequestingPDF ? "pb-0" : "pb-2")"> 514 @GetString( "Ecom:Product.LongDescription" ) 515 </div> 516 </div> 517 } 518 </div> 519 } 520 </div> 521 </div> 522 @sectionEnd() 523 524 @sectionStart( "e-section p-section-bg-white px-0 mt-auto " + (isRequestingPDF ? "py-0" : "") ) 525 <div class="e-product js-e-product junckers-product-case-description col-12 px-0" data-pdf="@GetString( "Ecom:Product:Field.DocumentationPdf.Value" )"> 526 <div class="e-product-image-container mb-0"> 527 <div class="junckers-product-image-container col-12"> 528 <div class="row"> 529 530 <div class="col-6 col-md-4 @(isRequestingPDF ? "px-1 mb-1" : "px-2 mb-4")" data-toggle="modal" data-target="#js-e-product-image-modal" data-slide-to="0"> 531 <span class="junckers-case-image" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetValue( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=500&Height=&Quality=90)"></span> 532 </div> 533 534 @foreach ( ElementWithIndex<Detail> image in details.Where( d => d.GroupId == 1 ).WithIndex() ) 535 { 536 if ( !isRequestingPDF || (isRequestingPDF && image.Index < 2) ) 537 { 538 <div class="col-6 col-md-4 @(isRequestingPDF ? "px-1 mb-1" : "px-2 mb-4")" data-toggle="modal" data-target="#js-e-product-image-modal" data-slide-to="@( image.Index + 1 )"> 539 <span class="junckers-case-image" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=500&Height=&Quality=75)"></span> 540 </div> 541 } 542 } 543 </div> 544 @if(isRequestingPDF) 545 { 546 <div class="row"> 547 <div class="col-2 mx-auto text-center"> 548 <a href="/"> 549 <img src="@logoPrimary" class="p-img"> 550 </a> 551 </div> 552 </div> 553 } 554 </div> 555 </div> 556 557 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal" data-backdrop="false" data-keyboard="true"> 558 <div class="modal-dialog"> 559 <div class="modal-content"> 560 <div class="modal-body"> 561 562 <button type="button" class="close" data-dismiss="modal"> 563 <i class="material-icons">close</i> 564 </button> 565 566 <div id="js-e-product-image-modal-carousel" class="carousel slide" data-keyboard="true" data-interval="false"> 567 <div class="carousel-inner"> 568 @if ( !details.Any() ) 569 { 570 <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)"> 571 </div> 572 } 573 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 574 { 575 string activeClass = image.Index == 0 ? "active" : string.Empty; 576 <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)"> 577 </div> 578 } 579 </div> 580 @{ int CarouselModalItemLoopCounter = 1; } 581 582 @foreach ( ElementWithIndex<Detail> imageIndicator in details.WithIndex() ) 583 { 584 if ( CarouselModalItemLoopCounter == 1 ) 585 { 586 if ( !string.IsNullOrEmpty( imageIndicator.Element.Value ) ) 587 { 588 <ol class="carousel-indicators"> 589 @if ( !details.Any() ) 590 { 591 <li data-target="#js-e-product-image-modal-carousel" data-slide-to="0" class="active"> 592 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@( imageIndicator.Element.Value )&Format=jpg&Width=50&Height=&Quality=90)"></span> 593 </li> 594 } 595 @foreach ( ElementWithIndex<Detail> image in details.WithIndex() ) 596 { 597 string activeClass = image.Index == 0 ? "active" : string.Empty; 598 <li class="@activeClass" data-target="#js-e-product-image-modal-carousel" data-slide-to="@( image.Index + 1 )"> 599 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@(image.Element.Value)&Format=jpg&Width=50&Height=&Quality=75)"></span> 600 </li> 601 } 602 </ol> 603 <a class="carousel-control-prev" data-target="#js-e-product-image-modal-carousel" data-slide="prev"></a> 604 <a class="carousel-control-next" data-target="#js-e-product-image-modal-carousel" data-slide="next"></a> 605 } 606 CarouselModalItemLoopCounter++; 607 } 608 } 609 </div> 610 611 </div> 612 </div> 613 </div> 614 </div> 615 616 </div> 617 @sectionEnd() 618 619 @* @foreach ( LoopItem group in GetLoop( "ProductRelatedGroups" ) ) *@ 620 @* { *@ 621 @* @ProductRelatedProducts( *@ 622 @* heading: group.GetString( "Ecom:Product:RelatedGroup.Name" ), *@ 623 @* productLoop: group.GetLoop( "RelatedProducts" ).Take( 4 ) *@ 624 @* ) *@ 625 @* } *@ 626 627 628 629 <script type="application/ld+json"> 630 { 631 "@@context" : "http://schema.org", 632 "@@type" : "Product", 633 "category" : "@groupService.GetGroup(primaryGroupID).Name", 634 "description" : "@GetString("Ecom:Product.LongDescription").StripHtml()", 635 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 636 "name" : "@GetString("Ecom:Product.Name").StripHtml()", 637 "image" : "@( GetGlobalValue( "Global:Request.Scheme" ) + "://" + GetGlobalValue( "Global:Request.Host" ) + GetString("Ecom:Product.ImageLarge.Clean") )", 638 "offers" : { 639 "@@type" : "Offer", 640 "availability" : "http://schema.org/InStock", 641 "price" : "@GetDouble("Ecom:Product.Price.Price")", 642 "priceCurrency" : "@EcomContext.Currency.Code" 643 } 644 } 645 </script> 646 647 648 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode( GetString( "Ecom:Product.Name" ) )" data-link="@HttpUtility.HtmlAttributeEncode( ProductService.Instance.GetProductLink( GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), GetString( "Ecom:Product.ID" ) ) )"></code> 649 650
keyboard_arrow_up



picture_as_pdf