Error executing template "Designs/innovationliving/eCom/Product/innovationliving.cshtml"System.NullReferenceException: Object reference not set to an instance of an object.at Co3.IL.Dw.Repositories.ProductRepository.GetAllProductDeliveryInfo() in C:\Data\Development\git\innovationliving-master\Co3.IL.Dynamicweb\Repositories\ProductRepository.cs:line 87at Co3.IL.Dw.Services.ProductService.GetAllProductDeliveryInfo() in C:\Data\Development\git\innovationliving-master\Co3.IL.Dynamicweb\Services\ProductService.cs:line 74at Co3.IL.Dw.Services.ProductService.GetProductDeliveryInfo(Product product) in C:\Data\Development\git\innovationliving-master\Co3.IL.Dynamicweb\Services\ProductService.cs:line 198at CompiledRazorTemplates.Dynamic.RazorEngine_94bded6612b94316990695266965977c.<>c__DisplayClass7_0.b__0(TextWriter __razor_helper_writer) in D:\Sites\innovationliving.com\files\Templates\Designs\innovationliving\eCom\Product\innovationliving.cshtml:line 237at CompiledRazorTemplates.Dynamic.RazorEngine_94bded6612b94316990695266965977c.<>c__DisplayClass5_0.b__0(TextWriter __razor_helper_writer) in D:\Sites\innovationliving.com\files\Templates\Designs\innovationliving\eCom\Product\innovationliving.cshtml:line 143at CompiledRazorTemplates.Dynamic.RazorEngine_94bded6612b94316990695266965977c.Execute() in D:\Sites\innovationliving.com\files\Templates\Designs\innovationliving\eCom\Product\innovationliving.cshtml:line 1795at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using Dynamicweb.Ecommerce.Prices 3 @using Dynamicweb.Ecommerce.Common.eCom7 4 @using Dynamicweb.Rendering 5 @using System.Web 6 @using Dynamicweb.Frontend 7 @using Co3.Espresso.Base.Models 8 @using Co3.Espresso.Website.Services 9 @using Co3.IL.Dw.Models 10 @using Dynamicweb.Ecommerce.Products 11 @using Dynamicweb.Ecommerce.Products.Categories 12 @using ProductService = Co3.Espresso.Website.Services.ProductService 13 @using System.Collections.Generic; 14 @using Dynamicweb.Admin.dk.dynamicweb.templates 15 @using System.Text.RegularExpressions 16 @using Co3.Espresso.Base.Extensions 17 @using Co3.Espresso.Website.Models.FrontEnd.Elements 18 @using Dynamicweb.Admin 19 @using Dynamicweb.Ecommerce.Common 20 21 @using System.Globalization 22 @using System.Security.Cryptography.X509Certificates 23 @using Co3.Espresso.Base.Extensions 24 @using Co3.Espresso.Website.Models.FrontEnd 25 @using Co3.Espresso.Website.Services 26 @using Dynamicweb.Content 27 @using Dynamicweb.Ecommerce.Products 28 @using Dynamicweb.Ecommerce.Products.Categories 29 @using Dynamicweb.Frontend 30 @using Dynamicweb.Rendering 31 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 32 @using ProductService = Co3.Espresso.Website.Services.ProductService 33 @using Co3.IL.Dw.Models 34 @using System.Web 35 @using Dynamicweb.Admin 36 @using Dynamicweb.Content.Items 37 @using Dynamicweb.Indexing.Notifications 38 39 @{ 40 ProductCategoryService productCategory = new ProductCategoryService(); 41 } 42 43 44 @functions { 45 46 public string getCountryCodeFromArea(Area area) 47 { 48 RegionInfo regionInfo = new RegionInfo(area.CultureInfo.LCID); 49 return regionInfo.TwoLetterISORegionName; 50 } 51 52 public static string GetStandardCollapseToggleTextExpand() 53 { 54 return "Se mere"; 55 } 56 57 public static string GetStandardCollapseToggleTextCollapse() 58 { 59 return "Se mindre"; 60 } 61 } 62 63 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 64 { 65 if ( string.IsNullOrEmpty(content) == false ) 66 { 67 ClassList headingClassList = new ClassList(); 68 headingClassList.AddClasses("col-12"); 69 ClassList contentClassList = new ClassList(); 70 contentClassList.AddClasses("col-12"); 71 72 @sectionStart(sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand) 73 74 if ( string.IsNullOrEmpty(heading) == false ) 75 { 76 <div class="@headingClassList"> 77 <h2>@heading</h2> 78 </div> 79 } 80 <div class="@contentClassList"> 81 @content 82 </div> 83 84 @sectionEnd() 85 } 86 } 87 88 89 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 90 { 91 if ( string.IsNullOrEmpty(videoURL) == false ) 92 { 93 ClassList headingClassList = new ClassList(); 94 headingClassList.AddClasses("col-12"); 95 ClassList contentClassList = new ClassList(); 96 contentClassList.AddClasses("col-12"); 97 98 99 @sectionStart(sectionClasses: sectionClasses, contentClasses: contentClasses)100101 if ( string.IsNullOrEmpty(heading) == false )102 {103 <div class="@headingClassList">104 <h2>@heading</h2>105 </div>106 }107108 <div class="@contentClassList">109 <div class="embed-responsive embed-responsive-16by9 mb-2">110 <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>111 </div>112 </div>113 @sectionEnd()114 }115 }116117 @helper ProductRelatedProducts(string sectionClasses = "e-section", string contentClasses = null, string heading = null,118 IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null)119 {120 if ( productLoop != null && productLoop.Any() == true )121 {122 ClassList headingClassList = new ClassList();123 headingClassList.AddClasses("col-12");124 ClassList contentClassList = new ClassList();125 contentClassList.AddClasses("col-12");126127 @sectionStart(sectionClasses: sectionClasses, contentClasses: contentClasses)128129 if ( string.IsNullOrEmpty(heading) == false )130 {131 <div class="@headingClassList">132 <h2 class="text-center">@heading</h2>133 </div>134 }135 <div class="@contentClassList">136 <div class="e-products mb-2">137 <div class="row">138 @{139 string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth(null).ToResponsiveClasses();140 }141 @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop )142 {143 @ProductlistItem(product, productlistItemClassList)144 }145 </div>146 </div>147 </div>148149 @sectionEnd()150 }151 }152153 @helper ProductRelatedComfortProducts(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string introduction = null,154 IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > productLoop = null, Product mainProduct = null)155 {156 if ( productLoop != null && productLoop.Any() == true )157 {158 ClassList headingClassList = new ClassList();159 headingClassList.AddClasses("col-12");160 ClassList contentClassList = new ClassList();161 contentClassList.AddClasses("col-12");162163 @sectionStart(sectionClasses: sectionClasses, contentClasses: contentClasses)164165 if ( string.IsNullOrEmpty(heading) == false )166 {167 <div class="@headingClassList">168 <h2 class="mb-0 text-center">@heading</h2>169 @if ( string.IsNullOrEmpty(introduction) == false )170 {171 <h4 class="mb-1 mt-1 text-center">@introduction</h4>172 }173 </div>174 }175 <div class="@contentClassList">176 <div class="e-products mb-2">177 <div class="row">178 @{179 string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth(null).ToResponsiveClasses();180 }181 @if ( mainProduct != null )182 {183 var comfortName = mainProduct.GetCategoryValue("FinalProduct", "RelComfortName");184 var comfortFirmRate = mainProduct.GetCategoryValue("FinalProduct", "RelComfortFirmRate");185 var comfortDesc = mainProduct.GetCategoryValue("FinalProduct", "RelComfortDesc").ToString().StripHtml();186 string comfortImage = ImageService.Instance.GetImageURL("/Files/Images/" + mainProduct.GetCategoryValue("FinalProduct", "RelComfortImage"), 400, 400, 1);187188 <div class="@productlistItemClassList il-comfort-related-group-item">189 <div class="active bg-white e-products-item">190 <div class="e-products-item-container">191 <div class="e-products-item-text-container text-center">192 <h3>193 @comfortName194 </h3>195 <p class="il-comfort-related-group-item-firmness mb-0">196 <strong>Firmness rating:</strong> @comfortFirmRate</p>197 <p>@comfortDesc</p>198 </div>199 <div class="e-products-item-image-container">200 <div class="e-products-item-image-wrapper">201 <img src="@comfortImage" alt="" class="e-products-item-image">202 </div>203 </div>204205 </div>206 </div>207 </div>208 }209210211212 @foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product in productLoop )213 {214 @ProductlistRelatedComfortItem(product, productlistItemClassList)215 }216 </div>217 </div>218 </div>219220 @sectionEnd()221 }222 }223224 @helper ProductlistItem(RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null)225 {226 if ( product != null )227 {228 string currentDomain = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host;229 //ProductDeliveryInfo productDeliveryInfo = Co3.IL.Dw.Services.ProductService.Instance.GetProductDeliveryInfo(product.GetString("Ecom:Product:Field.BaseSKU.Value"));230231 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService();232 Dynamicweb.Ecommerce.Products.Product productObject = dwProductService.GetProductById( product.GetString( "Ecom:Product.ID" ), product.GetString( "Ecom:Product.VariantID" ), Dynamicweb.Ecommerce.Common.Context.LanguageID, false );233234 ProductDeliveryInfo productDeliveryInfo = null;235 if ( productObject != null )236 {237 productDeliveryInfo = Co3.IL.Dw.Services.ProductService.Instance.GetProductDeliveryInfo( productObject );238 }239 else240 {241 productDeliveryInfo = Co3.IL.Dw.Services.ProductService.Instance.GetProductDeliveryInfo(product.GetString("Ecom:Product:Field.BaseSKU.Value"));242 }243244245 List< Product > inStock = new List< Product >();246 List< dynamic > inStockTextiles = new List< dynamic >();247 if ( productDeliveryInfo != null && productDeliveryInfo.InStock != null)248 {249 inStock = productDeliveryInfo.InStock.Any() ? productDeliveryInfo.InStock : inStock;250 }251252 foreach ( Product productionProduct in inStock )253 {254 string textileImageClean = productionProduct.GetCategoryValue("Textile", "TextileColorImage")?.ToString();255 string textileImagePath = "/files/images/" + textileImageClean;256 inStockTextiles.Add(new257 {258 color = productionProduct.GetCategoryValue("Textile", "TextileColorHex")?.ToString()259 });260 }261262 dynamic productData = new263 {264 id = product.GetString("Ecom:Product.ID"),265 variantId = product.GetString("Ecom:Product.VariantID"),266 url = ProductService.Instance.GetProductLink(product.GetString("Ecom:Product.PrimaryOrFirstGroupID"), product.GetString("Ecom:Product.ID"), product.GetString("Ecom:Product.VariantID")),267 number = product.GetString("Ecom:Product.Number"),268 name = ProductService.Instance.GetName(product.GetString("Ecom:Product.ID"), product.GetString("Ecom:Product.VariantID")),269 imageDefault = ImageService.Instance.GetImageURL(product.GetString("Ecom:Product.ImageDefault.Clean"), 400, 400, 5),270 //Ecom:Product.ImageDefault.Clean271 price = 0,// ProductService.Instance.GetPrice(product.GetString("Ecom:Product.ID")),272 descriptionShortExtra01 = product.GetString("Ecom:Product:Field.DescriptionShortExtra01"),273 inStockTextiles = inStockTextiles,274 inStockTextilesTotal = inStockTextiles.Count,275 includePIMPacks = product.GetString("Ecom:Product.CategoryField.FinalProduct.IncludePIMPacks.Value.Clean") == "True",276 cylindo = new277 {278 sku = product.GetString("Ecom:Product:Field.BaseSKU.Value"),279 legFinish = product.GetString("Ecom:Product:Field.FeatureGroup1.Value"),280 fallbackImage = string.IsNullOrEmpty(product.GetString( "Ecom:Product.ImageDefault.Clean" )) == false ? string.Format( "{0}{1}", currentDomain, ImageService.Instance.GetImageURL( product.GetString( "Ecom:Product.ImageDefault.Clean" ), 400, 400, 5 ) ) : string.Empty,281 position = string.IsNullOrEmpty(product.GetString( "Ecom:Product:Field.Positions.Value" )) == false ? product.GetString( "Ecom:Product:Field.Positions.Value" ).Split( ',' )[0] : "1",282 fabric = string.IsNullOrEmpty(product.GetString("DefaultTextile")) == false ? product.GetString("DefaultTextile") : "521"283 },284 stock = new285 {286 id = product.GetString("Ecom:Product:Stock.ID"),287 quantity = product.GetString("Ecom:Product.Stock"),288 text = product.GetString("Ecom:Product:Stock.Text"),289 delivery = product.GetString("Ecom:Product:Stock.DeliveryText")290 }291 };292293 string cssOpacity = string.Empty;294 if ( productData.inStockTextilesTotal == 0 )295 {296 cssOpacity = "opacity-zero";297 }298299 <div class="@productlistItemClassList">300 <div class="e-products-item js-e-products-item bg-white js-e-products-item-@productData.id js-e-block-link e-block-link" data-variant-id="@productData.variantId">301 <div class="e-products-item-container">302303 <div class="e-products-item-text-container text-center small">304 <h3 class="e-products-item-name mb-0"><a href="@productData.url">@productData.name</a></h3>305 <small class="il-colors-instock mt-1 mb-1 d-block @cssOpacity"><a href="@productData.url">@productData.inStockTextilesTotal colors in stock</a></small>306 <ul class="il-color-list @cssOpacity">307 @{308 int counter = 0;309 }310 @foreach ( var inStockTextile in productData.inStockTextiles )311 {312 if ( counter < 8) {313 <li style="background-color: #@inStockTextile.color;"></li>314 }315 counter++;316 }317 @if ( productData.inStockTextiles.Count > 8 )318 {319 <li class="morethanmax"></li>320 }321 </ul>322323 <div class="js-cylindo-viewer cylindo-viewer" id="@productData.id" data-use-pim-packs="@productData.includePIMPacks" data-sku="@productData.cylindo.sku" data-position="@productData.cylindo.position" data-leg-finish="@productData.cylindo.legFinish" data-fabric="@productData.cylindo.fabric" data-fallback-image="@productData.cylindo.fallbackImage"></div>324 <p class="e-products-item-text mb-0 @cssOpacity">325 <a href="@productData.url">326 More colors available327 </a>328 </p>329 </div>330 </div>331 </div>332 </div>333334 @*<div class="@productlistItemClassList">335 <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link border-bottom" data-variant-id="@productData.variantId">336 <div class="e-products-item-container">337 <div class="cylindo-viewer js-cylindo-viewer" id="@productData.cylindo.sku" data-leg-finish="@productData.cylindo.legFinish" data-fallback-image="@productData.imageDefault"></div>338339 //<div class="e-products-item-image-container">340 //<a class="e-products-item-image-wrapper" href="@productData.url">341 //<img src="@productData.imageDefault" alt="" class="e-products-item-image">342 //</a>343 //</div>344 <div class="e-products-item-text-container text-center">345 <h3 class="e-products-item-name mb-0">346 <a href="@productData.url">347 @productData.name348 </a>349 </h3>350 @if ( string.IsNullOrEmpty( productData.descriptionShortExtra01 ) == false )351 {352 <p class="e-products-item-text mb-0">353 <a href="@productData.url">354 @productData.descriptionShortExtra01355 </a>356 </p>357 }358 <p class="e-products-item-text mb-0">359 <small class="e-products-item-price small text-muted">360 <a href="@productData.url">361 @productData.price362 </a>363 </small>364 </p>365 </div>366 </div>367 </div>368 </div>*@369 }370 }371372373 @helper ProductlistRelatedComfortItem(RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem product, string productlistItemClassList = null)374 {375 if ( product != null )376 {377 dynamic productData = new378 {379 id = product.GetString("Ecom:Product.ID"),380 variantId = product.GetString("Ecom:Product.VariantID"),381 url = ProductService.Instance.GetProductLink(product.GetString("Ecom:Product.PrimaryOrFirstGroupID"), product.GetString("Ecom:Product.ID")),382 name = product.GetString("Ecom:Product.CategoryField.FinalProduct.RelComfortName.Value.Clean"),383 imageDefault = ImageService.Instance.GetImageURL(product.GetString("Ecom:Product.CategoryField.FinalProduct.RelComfortImage.Value.Clean"), 400, 400, 1),384 description = product.GetString("Ecom:Product.CategoryField.FinalProduct.RelComfortDesc.Value.Clean").StripHtml(),385 firmness = product.GetString("Ecom:Product.CategoryField.FinalProduct.RelComfortFirmRate.Value.Clean")386 };387388 <div class="@productlistItemClassList il-comfort-related-group-item">389 <div class="e-products-item js-e-products-item js-e-products-item-@productData.id js-e-block-link e-block-link bg-white" data-variant-id="@productData.variantId">390 <div class="e-products-item-container">391 <div class="e-products-item-text-container text-center">392 <h3>393 <a href="@productData.url">394 @productData.name395 </a>396 </h3>397 <p class="il-comfort-related-group-item-firmness mb-0">398 <strong>Firmness rating:</strong> @productData.firmness</p>399 <p>@productData.description</p>400 </div>401 <div class="e-products-item-image-container">402 <a class="e-products-item-image-wrapper" href="@productData.url">403 <img src="@productData.imageDefault" alt="" class="e-products-item-image">404 </a>405 </div>406407 </div>408 </div>409 </div>410 }411 }412413414 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null)415 {416 sectionId = string.IsNullOrEmpty(sectionId) ? Guid.NewGuid().ToString("N") : sectionId;417 ClassList sectionClassList = new ClassList();418 sectionClassList.AddClasses(sectionClasses);419 ClassList contentClassList;420421 if ( contentClasses == null )422 {423 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem(PageView.Current().Page.Item);424 }425 else426 {427 contentClassList = new ClassList();428 contentClassList.AddClasses(contentClasses);429 }430431 // TODO: Split collapse logic into separate helper function.432 string collapseId = Guid.NewGuid().ToString("N");433 ClassList collapseToggleClassList = new ClassList();434 if ( sectionCollapse )435 {436 sectionClassList.AddClasses("p-section-collapse js-p-section-collapse");437 collapseToggleClassList.AddClasses(contentClasses);438 collapseToggleClassList.AddClasses("p-section-collapse-toggle collapsed order-last text-center");439 contentClassList.AddClasses("p-section-collapse-content collapse is-md");440 }441442 @:<section class="@sectionClassList" id="@sectionId">443 @:<div class="container-fluid">444 @:<div class="row">445446 // TODO: Split collapse logic into separate helper function.447 if ( sectionCollapse )448 {449 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId">450 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button">451 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i>452 </button>453 <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty(collapseToggleTextExpand) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand)" data-collapse-text="@( string.IsNullOrEmpty(collapseToggleTextCollapse) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse)"></small>454 </div>455 }456457 @:<div class="@contentClassList" id="@collapseId">458 @:<div class="row">459 }460461 @helper sectionEnd()462 {463 @:</div>464 @:</div>465 @:</div>466 @:</div>467 @:</section>468 }469470 @* Custom IL instock/production *@471 @helper getProductionStockAndProduction(List< Product > ProductList, ProductCategoryService productCategory, Dictionary<string,dynamic> jsonFabrics = null, IEnumerable< RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem > fieldLoop = null)472 {473 foreach ( Product productionProduct in ProductList )474 {475 string textileNumber = System.Int32.Parse( productionProduct.Number ).ToString();476 string textileName = productionProduct.GetCategoryValue("Textile", "TextileName")?.ToString();477 string textileImageClean = productionProduct.GetCategoryValue("Textile", "TextileColorImage")?.ToString();478 string textileImagePath = "/files/images/" + textileImageClean;479 string textileImage = ImageService.Instance.GetImageURL(textileImagePath?.ToString(), 100, 100);480481 dynamic displayFields = new List< dynamic >();482483 foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem groupItem in fieldLoop )484 {485 if ( groupItem.GetLoop( "Fields" ).Count > 0 )486 {487 if ( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) == "7" )488 {489 foreach ( RazorTemplateBase< RazorTemplateModel< Template > >.LoopItem fieldItem in groupItem.GetLoop( "Fields" ) )490 {491 if(!string.IsNullOrEmpty(productionProduct.GetCategoryValue("Textile", fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TemplateTag"))?.ToString()))492 {493 if(!string.IsNullOrEmpty(productionProduct.GetCategoryValue("Textile", fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TemplateTag"))?.ToString()))494 {495 //string value = productionProduct.GetCategoryValue( "Textile", fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) )?.ToString();496 string label = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" );497 string value = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct(productionProduct, fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id"));498499 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" )500 {501 value = ImageService.Instance.GetImageURL(string.Format("/files/images/{0}", value), 100, 100);502 label = string.Empty;503 }504 displayFields.Add( new505 {506 label = label,507 type = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName"),508 value = value509 } );510 }511 }512 }513 }514 }515 }516517 if ( productionProduct.Number != null && !string.IsNullOrEmpty(textileName) )518 {519 if ( !jsonFabrics.ContainsKey( textileNumber ) )520 {521 jsonFabrics[ textileNumber ] = new List< dynamic >();522 jsonFabrics[ textileNumber ].Add( new523 {524 number = textileNumber,525 name = textileName,526 paramValue = textileName.Replace(' ', '-'),527 displayFields = displayFields528 });529 }530 }531532 int loopCounter = 0;533534 <label>535 <input name="variant-color" type="radio" data-title="@textileName" data-fabric="@textileNumber" class="js-variant-color" value="variant-@productionProduct.Id"><span class="border select-option" style="background-image: url(@textileImage)"></span>536 <div class="desc-wrapper">537 <div class="desc-content">538 <h4>@textileName</h4>539 <p>540 @foreach ( dynamic displayField in displayFields )541 {542 if ( displayField.type != "Filemanager" && displayField.type != "Link" )543 {544 if ( loopCounter > 0 )545 {546 <span> / </span>547 }548 @displayField.label<span>: </span> @displayField.value549 loopCounter++;550 }551 }552 </p>553 </div>554 </div>555 </label>556 }557 }558559560561 @{562 bool isUserAuthenticated = PageView.Current().User != null;563 bool isIOSDevice = Dynamicweb.Frontend.Devices.DeviceInfo.ParseFromUserAgentString( HttpContext.Current.Request.UserAgent ).PlatformType.ToString().ToLower() == "ios";564565 Dictionary<string,dynamic> jsonFabrics = new Dictionary< string, dynamic >();566567 dynamic JSON = new568 {569 productid = GetValue("Ecom:Product.ID"),570 variantoptions = new List< dynamic >(),571 variantcombinations = new List< dynamic >()572 };573574 @* Global Image modal variable used in part image carousel *@575 string carouselClassList = "";576 bool showImageCarouselNavigation = GetLoop( "Details" ).Any();577 {578 //carouselClassList = "d-none";579 }580581 string vimeoPrimary = GetString("Ecom:Product:Field.Video.Value");582 string vimeoImage = GetString("Ecom:Product:Field.VideoImage.Value.Clean");583584 @* Global Image modal variable used in image carousel horizontal and vertical *@585 string isActive = string.Empty;586 string baseSKU = GetString("Ecom:Product:Field.BaseSKU.Value");587 string id = GetString("Ecom:Product.ID");588 string legFinish = GetString( "Ecom:Product:Field.FeatureGroup1.Value" );589 string fallbackImage = string.IsNullOrEmpty( GetString( "Ecom:Product.ImageDefault.Clean" ) ) == false ? string.Format( "//{0}{1}", GetGlobalValue( "Global:Area.Primarydomain" ), ImageService.Instance.GetImageURL( GetString( "Ecom:Product.ImageDefault.Clean" ), 1800, 1800, 5 ) ) : string.Empty;590 string primaryImage = fallbackImage;591592593 string overviewIllustration = GetString( "Ecom:Product.CategoryField.FinalProduct.MeasurementIcon.Value.Clean" );594595 string positions = string.IsNullOrEmpty(GetString("Ecom:Product:Field.Positions.Value")) == false ? GetString("Ecom:Product:Field.Positions.Value") : "1";596 string[] positionArray = positions.Split( ',' );597 string position = positionArray[ 0 ];598 string fabric = GetString( "DefaultTextile" );599 bool includePIMPacks = GetString( "Ecom:Product.CategoryField.FinalProduct.IncludePIMPacks.Value.Clean" ) == "True";600601 string fabricOverview = Espresso.Area.Item.DetailedFabricOverview;602603 string videoSrc = string.Empty;604 string videoThumb = string.Empty;605 string videoProvider = string.Empty;606 string ARfile = string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.FinalProduct.AR.Value.Clean" ) ) ? string.Empty : GetString( "Ecom:Product.CategoryField.FinalProduct.AR.Value.Clean" );607608 if ( !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.FinalProduct.ThumbVideo.Value.Clean" ) ) )609 {610 videoSrc = GetString("Ecom:Product.CategoryField.FinalProduct.ThumbVideo.Value.Clean");611 if ( !string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.FinalProduct.ThumbVideoStill.Value.Clean" ) ) )612 {613 videoThumb = string.Format("//{0}{1}", GetGlobalValue( "Global:Area.Primarydomain" ), ImageService.Instance.GetImageURL(GetString( "Ecom:Product.CategoryField.FinalProduct.ThumbVideoStill.Value.Clean" ), 200, 200, 5 ));614 }615616 videoProvider = "direct";617618 if ( videoSrc.IndexOf("vimeo") > -1 )619 {620 videoProvider = "vimeo";621 }622623 if ( videoSrc.IndexOf("youtube") > -1 )624 {625 videoProvider = "youtube";626 }627 }628629 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService();630 //Product product = dwProductService.GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), true);631 Product product = dwProductService.GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), Dynamicweb.Ecommerce.Common.Context.LanguageID, false);632 ProductDeliveryInfo productDeliveryInfo = Co3.IL.Dw.Services.ProductService.Instance.GetProductDeliveryInfo(product);633634 List< Product > production = new List< Product >();635 List< Product > inStock = new List< Product >();636637 if ( productDeliveryInfo != null )638 {639 production = productDeliveryInfo.Production.Any() ? productDeliveryInfo.Production : null;640 inStock = productDeliveryInfo.InStock.Any() ? productDeliveryInfo.InStock : null;641 if ( production != null )642 {643 production = production.Where( p => p.Active ).ToList();644 }645646 if ( inStock != null )647 {648 inStock = inStock.Where( p => p.Active ).ToList();649 }650 }651652653 string bomProduct = string.Empty;654655 IEnumerable<Product> productPartItems = Co3.IL.Dw.Services.ProductService.Instance.GetProductPartItems(product);656657 string eComProductCanonical = string.Empty;658 string globalValueUrl = GetGlobalValue( "Global:Pageview.Url" );659 if ( GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) > -1 )660 {661 globalValueUrl = GetGlobalValue( "Global:Pageview.Url" ).Substring( 0, GetGlobalValue( "Global:Pageview.Url" ).IndexOf( "?" ) );662 eComProductCanonical = String.Format( "{0}", globalValueUrl );663 Pageview.Meta.AddTag( "customCan", string.Format( "<link rel=\"canonical\" href=\"{0}\" />", eComProductCanonical ) );664 }665 }666667 @sectionEnd()668669 @sectionStart(sectionClasses: "e-section pb-0 d-lg-none")670 <div class="col-12">671 <div class="row">672 <div class="col-12">673674 <h4 class="mb-1 mt-0 text-muted">@GetString( "Ecom:Product.CategoryField.FinalProduct.ProductType.OptionLabel" )</h4>675 <h1 class="e-product-name mb-0 mt-0 position-relative">676 @ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )677 </h1>678 @if ( GetString( "Ecom:Product.CategoryField.FinalProduct.ProductName2.Value.Clean" ) != "" )679 {680 <h2 class="mt-0 mb-0">@GetString( "Ecom:Product.CategoryField.FinalProduct.ProductName2.Value.Clean" )</h2>681 }682 <span class="mt-1 d-block">&nbsp;</span>683 <hr class="il-custom-short-hr"/>684 <p class="il-enlarged-text">@GetString( "Ecom:Product.CategoryField.FinalProduct.TeaserDescription.Value" ).StripHtml().</p>685 <span class="text-muted">Design by @GetString( "DesignByInText.Clean" )</span>686 <p><strong class="d-block mt-2 mb-0"><a class="arrow-right js-scroll-to-description" href="#attributes-group-5" data-target="#collapse-attributes-5">@Translate( "eCom Product - Description - Link", "View product description" )</a></strong></p>687 </div>688 </div>689 </div>690 @sectionEnd()691692 <div class="e-product js-product-cylindo">693 @sectionStart(sectionClasses: "e-section pb-0")694 <div class="col-12">695 <div class="row">696 <div class="col-12 col-lg-6">697 <span class="d-none d-lg-block">698 <div class="position-relative">699 <i data-toggle="collapse" data-target="#multicollapse-basic-information" aria-expanded="false" aria-controls="multicollapse-basic-information" class="material-icons il-custom-collapse-toggle-icon">expand_more</i>700 </div>701 <h4 class="mb-1 mt-0 text-muted">@GetString( "Ecom:Product.CategoryField.FinalProduct.ProductType.OptionLabel" )</h4>702 <h1 class="e-product-name mb-0 mt-0 position-relative">703 @ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )704 </h1>705 @if ( GetString( "Ecom:Product.CategoryField.FinalProduct.ProductName2.Value.Clean" ) != "" )706 {707 <h2 class="mt-0 mb-0">@GetString( "Ecom:Product.CategoryField.FinalProduct.ProductName2.Value.Clean" )</h2>708 }709 <span class="mt-1 d-block">&nbsp;</span>710 <div id="multicollapse-basic-information" class="collapse multi-collapse il-custom-product-details-collapse show">711 <hr class="il-custom-short-hr"/>712 <p class="il-enlarged-text">@GetString( "Ecom:Product.CategoryField.FinalProduct.TeaserDescription.Value" )</p>713 <span class="text-muted">Design by @GetString( "DesignByInText.Clean" )</span>714 <p><strong class="d-block mt-2 mb-0"><a class="arrow-right js-scroll-to-description" href="#attributes-group-5" data-target="#collapse-attributes-5">@Translate( "eCom Product - Description - Link", "View product description" )</a></strong></p>715 </div>716 </span>717718 @if ( ( inStock != null || production != null ) && productDeliveryInfo != null )719 {720 <hr/>721 <div class="position-relative">722 <i data-toggle="collapse" data-target="#multicollapse-textiles" aria-expanded="false" aria-controls="multicollapse-textiles" class="material-icons il-custom-collapse-toggle-icon">expand_more</i>723 </div>724 <div>725 <h4 class="mr-6 text-muted">726 @Translate( "eCom Product - Choosefabric - Heading", "Choose fabric" )727 <span class="disclaimer-button">728 <a data-target="#disclaimerModal" data-toggle="modal" href="/">?</a>729 </span>730 <a href="#">731 <span class="chosen-variant">&nbsp;</span>732 </a>733 </h4>734 </div>735736737 <div id="multicollapse-textiles" class="mt-2 collapse multi-collapse il-custom-product-details-collapse show">738 <div class="il-custom-fabric-selector variant-color">739 @if ( productDeliveryInfo != null )740 {741 if ( inStock != null )742 {743 string deliveryTimeOnStock = GetString( "Ecom:Product.CategoryField.FinalProduct.DeliveryTimeDaysOnStock.OptionLabel" );744 string countryCode2 = Context.Language.Code2;745 string[] useDeliveryTimeWeeksCountries = { "GB", "DK", "DE" };746 if ( useDeliveryTimeWeeksCountries.Any( countryCode2.Contains ) )747 {748 deliveryTimeOnStock = GetString( "Ecom:Product.CategoryField.FinalProduct.DeliveryTimeWeeksOnStock.OptionLabel" );749 }750751 <p class="mr-1 m-0 pb-0 text-muted mb-half"><strong class="float-left">@Translate( "eCom Product - inStockText - Text", "In stock / short delivery time /" )</strong> &nbsp;@string.Format("({0})", deliveryTimeOnStock)752 <span class="delivery-button">753 <a data-target="#deliveryStandardModal" data-toggle="modal" href="/">?</a>754 </span>755 </p>756 @getProductionStockAndProduction( inStock, productCategory, jsonFabrics, GetLoop( "FieldDisplayGroups" ) )757 }758759 if ( production != null )760 {761 <p class="mr-1 m-0 pb-0 pt-1 text-muted mb-half"><strong class="float-left">@Translate( "eCom Product - outOfStockText - Text", "DIY / Longer delivery time /" )</strong> &nbsp;@string.Format("({0})", GetString( "Ecom:Product.CategoryField.FinalProduct.DeliveryTimeWeeksNotOnStock.OptionLabel" ))762 <span class="delivery-button">763 <a data-target="#deliveryMadeToOrderModal" data-toggle="modal" href="/">?</a>764 </span>765 </p>766 @getProductionStockAndProduction( production, productCategory, jsonFabrics, GetLoop( "FieldDisplayGroups" ) )767 }768769 <p>770 <strong class="d-block mr-1 m-0 mt-2 mb-3">771 <a href="@fabricOverview" class="arrow-right">@Translate( "eCom Product - DetailedOverview - Link", "Go to detailed fabric overview" )</a>772 <span class="d-block font-weight-normal pt-1 px-0 text-muted">@Translate( "eCom Product - Color disclamer - Text", "We can't guarantee that the colour on your screen accurately portray the true fabric colour." )</span>773 </strong>774 </p>775 }776 <script>777 var jsonFabrics = @JsonService.Instance.ToJson( jsonFabrics );778 </script>779 </div>780 </div>781 }782783784 <hr/>785786787 @if ( isUserAuthenticated && false )788 {789 <div class="e-product-delivery mb-2">790 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product:Stock.ID" ) ) == false )791 {792 <ul class="material-icons-ul list-condensed mb-0 text-heading font-weight-bold">793 @if ( GetInteger( "Ecom:Product.Stock" ) > 0 )794 {795 <li class="d-none">796 <i class="material-icons text-primary">check</i>@GetString( "Ecom:Product:Stock.Text" )</li>797 }798 else799 {800 <li class="d-none">801 <i class="material-icons text-danger">close</i>@GetString( "Ecom:Product:Stock.Text" )</li>802 }803 <li>804 <i class="material-icons text-primary">check</i>@GetString( "Ecom:Product:Stock.DeliveryText" )</li>805 <li>806 <i class="material-icons text-primary">check</i>@Translate( "eCom Product - Delivery Policy - Text", "Free delivery" )</li>807 <li>808 <i class="material-icons text-primary">check</i>@Translate( "eCom Product - Return Policy - Text", "Free returns" )</li>809 </ul>810 }811812813 </div>814 <p class="e-product-price h2 mb-1 mt-0">815 @*@ProductService.Instance.GetPrice( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )816817 @if ( GetDouble( "Ecom:Product:Field.BeforePrice" ) != 0 )818 {819 <span class="e-product-price-before small text-muted">820 @PriceService.Instance.FormatPrice( GetDouble( "Ecom:Product:Field.BeforePrice" ) )821 </span>822 }823 *@824825 </p>826 <form action="/system/data/cart" class="e-product-form js-e-product-form js-e-product-form-addtocart py-1" method="post">827 <input name="CartCmd" type="hidden" value="Add">828 <input name="ProductID" type="hidden" value="@GetString( "Ecom:Product.ID" )">829 <input name="VariantID" type="hidden" value="">830 <input name="Quantity" type="hidden" value="1">831 <input name="Redirect" type="hidden" value="">832 <input name="Name" type="hidden" value="@ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )">833 <input name="Number" type="hidden" value="@GetString( "Ecom:Product.Number" )">834 <input name="Price" type="hidden" value="0">@*@ProductService.Instance.GetPrice( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).Price.ToJavaScript()*@835 <input name="CurrencyCode" type="hidden" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code">836 <button class="btn btn-success" type="submit">@Translate( "eCom Product - Add To Cart - Button", "Add to cart" )</button>837 </form>838839 }840 else841 {842 <div class="col-12 mb-1 pt-1">843 <div class="row">844845846 <div class="col-12 p-0 small">847 @if ( string.IsNullOrEmpty(Espresso.Area.Item.ProductPageFormular) == false )848 {849 <a data-toggle="collapse" data-target="#multicollapse-email-form" aria-expanded="false" aria-controls="multicollapse-email-form" class="h4 p-0 d-inline float-right mb-0 mt-0 small" style="text-decoration: none"><i class="material-icons mr-1">email</i>@Translate( "eCom Product - Send as email - Text", "Send as e-mail" )</a>850 // Input values used in the ProductPageFormular by JS, rendered from the chosen form in Website Settings851 <input type="hidden" name="ProductName" value="@product.Name">852 <input type="hidden" name="ProductNumber" value="@product.Number">853854 }855 @if ( string.IsNullOrEmpty( Espresso.Area.Item.EcommerceAlternativeCallToAction ) == false )856 {857 @Espresso.Area.Item.EcommerceAlternativeCallToAction858 }859 </div>860861862 </div>863 </div>864865 <div id="multicollapse-email-form" class="collapse multi-collapse bg-light border js-il-product-page-email-form">866 <div class="p-2 p-lg-4">867 @RenderParagraphContent(int.Parse(Espresso.Area.Item.ProductPageFormular))868 </div>869 </div>870871 }872 </div>873874 <div class="col-12 col-lg-6 order-first">875 @using Dynamicweb.Core876 <div class="js-cylindo-viewer-container collapse-product-images">877 <div class="js-cylindo-viewer cylindo-viewer border" id="cylindo_viewer_detail_@id" data-sku="@baseSKU" data-use-pim-packs="@includePIMPacks" data-leg-finish="@legFinish" data-position="@position" data-fabric="@fabric" data-fallback-image="@fallbackImage" data-video-src="@videoSrc" data-video-thumb="@videoThumb" data-video-provider="@videoProvider"></div>878 @foreach ( var pos in positionArray )879 {880 <div class="js-cylindo-thumbs cylindo-thumbs border" data-position="@pos.ToString()"></div>881 }882 @if ( !string.IsNullOrEmpty( videoProvider ) )883 {884 <div class="js-cylindo-thumbs js-cylindo-thumb-video cylindo-thumbs cylindo-viewer-video border" style="background-image: url('@videoThumb');" data-position="video"></div>885 }886 @if ( !string.IsNullOrEmpty( ARfile ) && isIOSDevice )887 {888 <a href="" data-link="@ARfile" target="_blank" class="cylindo-thumbs innovation-ar-icon js-href-replace border" data-position="AR"></a>889 }890 </div>891892 <div class="e-product-image-container js-e-product-image-container collapse-product-images">893 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel">894 <div class="e-product-image-wrapper border">895 <div class="carousel-inner">896 @{897 string carouselImage = string.IsNullOrEmpty( GetString( "Ecom:Product.ImageDefault.Default.Clean" ) ) == false ? string.Format( "//{0}{1}", GetGlobalValue( "Global:Area.Primarydomain" ), ImageService.Instance.GetImageURL( GetString( "Ecom:Product.ImageDefault.Default.Clean" ), 1800, 1800, 5 ) ) : string.Empty;898 int currentIndex = 0;899 }900901902 <div class="carousel-item js-il-carousel-item active" data-image="@carouselImage" data-target="#js-e-product-image-modal" data-toggle="modal">903 <img src="/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=600&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="0">904 </div>905906 @foreach ( LoopItem imageCategory in GetLoop( "ImageCategories" ) )907 {908 if ( imageCategory.GetString( "Category.SystemName" ) == "PIMPackshots" )909 {910 foreach ( ElementWithIndex< LoopItem > image in imageCategory.GetLoop( "Category.Images" ).WithIndex() )911 {912 int imageIndex = image.Index + 1;913 currentIndex = imageIndex;914 string cssClassActive = imageIndex == 0 ? "active" : string.Empty;915 carouselImage = string.IsNullOrEmpty( image.Element.GetString( "Ecom:Product:Detail.Image.Clean" ) ) == false ? string.Format( "//{0}{1}", GetGlobalValue( "Global:Area.Primarydomain" ), ImageService.Instance.GetImageURL( image.Element.GetString( "Ecom:Product:Detail.Image.Clean" ), 1800, 1800, 5 ) ) : string.Empty;916917 <div class="carousel-item js-il-carousel-item @cssClassActive" data-image="@carouselImage" data-target="#js-e-product-image-modal" data-toggle="modal">918 <img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=600&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel" data-slide-to="@imageIndex">919 </div>920 }921 }922 }923924 @if ( videoProvider == "vimeo" )925 {926 string[] videoSrcArray = videoSrc.Split( '/' );927 string vimeoVideoId = videoSrcArray[ (videoSrcArray.Length-1) ];928 <div class="carousel-item" data-target="#js-e-product-image-modal" data-toggle="modal">929 <iframe src="https://player.vimeo.com/video/@vimeoVideoId?api=1" id="carousel-vimeo-video" frameborder="0" class="il-custom-vimeo-iframe" allow="autoplay; fullscreen" allowfullscreen data-target="#js-e-product-image-modal-carousel" data-slide-to="@(currentIndex + 1)"></iframe>930 </div>931 }932933 <a class="carousel-control-prev @carouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a>934 <a class="carousel-control-next @carouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a>935 </div>936 </div>937938 @{939 currentIndex = 0;940 }941942 <ol class="carousel-indicators @carouselClassList">943944 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0">945 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span>946 </li>947 @foreach ( LoopItem imageCategory in GetLoop( "ImageCategories" ) )948 {949 if ( imageCategory.GetString( "Category.SystemName" ) == "PIMPackshots" )950 {951 foreach ( ElementWithIndex< LoopItem > image in imageCategory.GetLoop( "Category.Images" ).WithIndex() )952 {953 int imageIndex = image.Index + 1;954 currentIndex = imageIndex;955 string cssClassActive = imageIndex == 0 ? "active" : string.Empty;956 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex">957 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span>958 </li>959 }960 }961 }962963 @if ( videoProvider == "vimeo" )964 {965 <li class="il-custom-vimeo-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@(currentIndex+1)">966 <span style="background-image: url(@videoThumb)"></span>967 </li>968 }969 </ol>970 </div>971 </div>972973 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal" data-backdrop="false" data-keyboard="true">974 <div class="modal-dialog">975 <div class="modal-content">976 <div class="modal-body">977978 <button type="button" class="close" data-dismiss="modal">979 <i class="material-icons">close</i>980 </button>981982 <div id="js-e-product-image-modal-carousel" class="carousel slide" data-keyboard="true" data-interval="false">983 <div class="carousel-inner">984 <div class="carousel-item active" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=&Height=1800&Quality=90)"></div>985 @foreach ( LoopItem imageCategory in GetLoop( "ImageCategories" ) )986 {987 if ( imageCategory.GetString( "Category.SystemName" ) == "PIMPackshots" )988 {989 foreach ( ElementWithIndex< LoopItem > image in imageCategory.GetLoop( "Category.Images" ).WithIndex() )990 {991 int imageIndex = image.Index + 1;992 string cssClassActive = imageIndex == 0 ? "active" : string.Empty;993 <div class="carousel-item @cssClassActive" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=&Height=1800&Quality=90)">994 </div>995 }996 }997 }998 </div>9991000 <ol class="carousel-indicators @carouselClassList">1001 <li class="active" data-target="#js-e-product-image-modal-carousel" data-slide-to="0">1002 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span>1003 </li>1004 @foreach ( LoopItem imageCategory in GetLoop( "ImageCategories" ) )1005 {1006 if ( imageCategory.GetString( "Category.SystemName" ) == "PIMPackshots" )1007 {1008 foreach ( ElementWithIndex< LoopItem > image in imageCategory.GetLoop( "Category.Images" ).WithIndex() )1009 {1010 int imageIndex = image.Index + 1;1011 string cssClassActive = imageIndex == 0 ? "active" : string.Empty;1012 <li class="@cssClassActive" data-target="#js-e-product-image-modal-carousel" data-slide-to="@imageIndex">1013 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span>1014 </li>1015 }1016 }1017 }1018 </ol>10191020 <a class="carousel-control-prev @carouselClassList" data-target="#js-e-product-image-modal-carousel" data-slide="prev"></a>1021 <a class="carousel-control-next @carouselClassList" data-target="#js-e-product-image-modal-carousel" data-slide="next"></a>10221023 </div>1024 </div>1025 </div>1026 </div>1027 </div>10281029 </div>10301031 </div>1032 </div>10331034 @sectionEnd()1035 @using Co3.Espresso.Website.Services1036 @using Dynamicweb.Core1037 @sectionStart(sectionClasses: "e-section pb-1")10381039 @{1040 // GroupID's excluded to be used in another template.1041 List< string > specificationDisplayGroupIds = new List< string >();1042 specificationDisplayGroupIds.Add("12"); // General products1043 specificationDisplayGroupIds.Add("5"); // Specifications1044 specificationDisplayGroupIds.Add("6"); // Matress / Comfort1045 specificationDisplayGroupIds.Add("7"); // Fabric1046 specificationDisplayGroupIds.Add("8"); // The Designers1047 specificationDisplayGroupIds.Add("9"); // Care guide1048 specificationDisplayGroupIds.Add("10"); // Assembly guide1049 specificationDisplayGroupIds.Add("11"); // Download1050 List< LoopItem > specificationDisplayGroupList = new List< LoopItem >();1051 }10521053 <div class="col-12">1054 <div class="row">1055 <div class="col-12">1056 <hr />10571058 <div class="container il-custom-attributes-wrapper pt-3">1059 <div class="row">10601061 @{1062 string displayTypes = GetString( "DisplayTypes.Clean" );1063 }10641065 @foreach ( LoopItem groupItem in GetLoop( "FieldDisplayGroups" ) )1066 {1067 if ( groupItem.GetLoop( "Fields" ).Count > 0 )1068 {1069 if ( specificationDisplayGroupIds.Contains( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) ) )1070 {1071 specificationDisplayGroupList.Add( groupItem );1072 }1073 else1074 {1075 if ( groupItem.GetLoop( "Fields" ).All( f => string.IsNullOrEmpty( f.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) ) != true )1076 {1077 if ( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) == "2" && displayTypes.Contains("Feature")) // Key Features1078 {1079 <div class="il-custom-attributes-container">1080 <div class="d-flex flex-column">1081 <h4 class="text-muted"><img alt="" src="/Files/Templates/Designs/innovationliving/_assets/img/innovation_living_icon_keyfeatures.svg"/>@groupItem.GetString( "Ecom:FieldDisplayGroup.Name" ) </h4>1082 <table class="il-custom-attribute-data-table">1083 @foreach ( LoopItem fieldItem in groupItem.GetLoop( "Fields" ) )1084 {1085 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1086 string optionLabel = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );10871088 if ( string.IsNullOrEmpty( optionLabel ) )1089 {1090 optionLabel = bomProduct;1091 }1092 else1093 {1094 optionLabel = Regex.Replace( optionLabel, ",", ", " );1095 }1096 if ( !string.IsNullOrEmpty( optionLabel ) )1097 {1098 <tr>1099 <td class="subject">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" )</td>1100 <td>@optionLabel</td>1101 </tr>1102 }1103 }1104 </table>1105 </div>1106 </div>1107 }1108 else if ( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) == "3" && displayTypes.Contains("Sofa")) // Sofa1109 {11101111 <div class="il-custom-attributes-container">1112 <div class="d-flex flex-column">1113 <h4 class="text-muted"><img src="/Files/Templates/Designs/innovationliving/_assets/img/innovation_living_icon_sofa.svg" alt=""/>@groupItem.GetString( "Ecom:FieldDisplayGroup.Name" ) </h4>1114 <table class="il-custom-attribute-data-table">1115 @foreach ( LoopItem fieldItem in groupItem.GetLoop( "Fields" ) )1116 {1117 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1118 string optionLabel = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );11191120 if ( string.IsNullOrEmpty( optionLabel ) )1121 {1122 optionLabel = bomProduct;1123 }1124 else1125 {1126 optionLabel = Regex.Replace( optionLabel, ",", ", " );1127 }1128 if ( !string.IsNullOrEmpty( optionLabel ) )1129 {1130 <tr>1131 <td class="subject">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" )</td>1132 <td>@optionLabel</td>1133 </tr>1134 }1135 }1136 </table>1137 <a class="text-link arrow-right small order-last" data-target="#overviewIllustrationModal" data-toggle="modal" href="/">@Translate( "eCom Product - Overview illustration - Heading", "Overview illustration" )</a>1138 </div>1139 </div>11401141 }1142 else if1143 ( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) == "4" && displayTypes.Contains("Bed")) // Bed1144 {11451146 <div class="il-custom-attributes-container">1147 <div class="d-flex flex-column">1148 <h4 class="text-muted"><img src="/Files/Templates/Designs/innovationliving/_assets/img/innovation_living_icon_bed.svg" alt=""/>@groupItem.GetString( "Ecom:FieldDisplayGroup.Name" ) </h4>1149 <table class="il-custom-attribute-data-table">1150 @foreach ( LoopItem fieldItem in groupItem.GetLoop( "Fields" ) )1151 {1152 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1153 string optionLabel = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );11541155 if ( string.IsNullOrEmpty( optionLabel ) )1156 {1157 optionLabel = bomProduct;1158 }1159 else1160 {1161 optionLabel = Regex.Replace( optionLabel, ",", ", " );1162 }1163 if ( !string.IsNullOrEmpty( optionLabel ) )1164 {1165 <tr>1166 <td class="subject">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" )</td>1167 <td>@optionLabel</td>1168 </tr>1169 }1170 }1171 </table>1172 <a class="text-link arrow-right small order-last" data-target="#overviewIllustrationModal" data-toggle="modal" href="/">@Translate( "eCom Product - Overview illustration - Heading", "Overview illustration" )</a>1173 </div>1174 </div>1175 }11761177 else if1178 ( groupItem.GetString( "Ecom:FieldDisplayGroup.ID" ) == "14" && displayTypes.Contains("Measurements")) // Bed1179 {1180 <div class="il-custom-attributes-container">1181 <div class="d-flex flex-column">1182 <h4 class="text-muted"><img src="/Files/Templates/Designs/innovationliving/_assets/img/innovation_living_icon_keyfeatures.svg" alt=""/>@groupItem.GetString( "Ecom:FieldDisplayGroup.Name" ) </h4>1183 <table class="il-custom-attribute-data-table">1184 @foreach ( LoopItem fieldItem in groupItem.GetLoop( "Fields" ) )1185 {1186 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1187 string optionLabel = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );1188 string typeName = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" );11891190 if ( string.IsNullOrEmpty( optionLabel ) )1191 {1192 optionLabel = bomProduct;1193 }1194 else1195 {1196 optionLabel = Regex.Replace( optionLabel, ",", ", " );1197 }11981199 if (typeName == "Filemanager")1200 {1201 optionLabel = optionLabel?.Replace( "..", "/Files" );1202 if ( !string.IsNullOrEmpty( optionLabel ) )1203 {1204 <tr>1205 <td colspan="2">1206 <div aria-hidden="true" aria-labelledby="exampleModalCenterTitle" class="fade modal" id="measurementImageModal" role="dialog" tabindex="-1"><div class="modal-dialog modal-dialog-centered" role="document"><div class="modal-content"><div class="modal-header"><p class="modal-title" id="exampleModalLongTitle">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" )</p><button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button></div><div class="modal-body"><img src="@optionLabel" class="w-100" /></div></div></div></div>1207 <a class="text-link arrow-right small order-last" data-target="#measurementImageModal" data-toggle="modal" href="/">@Translate( "ecom Product Specifications -Measurement Icon - Heading", "Measurement Icon" )</a>1208 </td>1209 </tr>1210 }12111212 }1213 else1214 {1215 if ( !string.IsNullOrEmpty( optionLabel ) )1216 {1217 <tr>1218 <td class="subject">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" )</td>1219 <td>@optionLabel</td>1220 </tr>1221 }1222 }1223 }1224 </table>1225 </div>1226 </div>1227 }1228 }1229 }1230 }1231 }1232 </div>1233 </div>1234 </div>1235 </div>1236 </div>1237 @sectionEnd()12381239 @*@if (vimeoPrimary !="" && vimeoImage !=""){12401241 <section class="e-section pr-0 pl-0 pb-2">12421243 <div onclick="play();" id="vidwrap" style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%; background: url('@vimeoImage') no-repeat center; cursor: pointer;">1244 <script type="text/javascript">1245 function play(){1246 document.getElementById('vidwrap').innerHTML = '<iframe id="ytplayer" type="text/html" width="1440" height="810" style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: #222;" src="//player.vimeo.com/video/@vimeoPrimary?api=1" frameborder="0" allowfullscreen></iframe>';1247 }1248 </script>1249 </div>12501251 </section>12521253 }*@125412551256 @if (vimeoPrimary !="" && vimeoImage !=""){1257 <section class="e-section pr-0 pl-0 pb-2">1258 <div id="vidwrap" style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%;">1259 <iframe id="ytplayer" type="text/html" width="1440" height="810" style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: #222;" src="//player.vimeo.com/video/@vimeoPrimary?api=1" frameborder="0" allowfullscreen></iframe>1260 </div>1261 </section>1262 }12631264 @using Dynamicweb.SystemTools12651266 @foreach ( LoopItem group in GetLoop("ProductRelatedGroups") )1267 {1268 if ( group.GetString( "Ecom:Product:RelatedGroup.GroupID" ) == "RELGRP5" )1269 {12701271 @ProductRelatedComfortProducts(1272 sectionClasses: "e-section bg-light py-3",1273 heading: @Translate("eCom ProductRelatedgroups - Comfort - Heading", "Comfort"),1274 introduction: @Translate("eCom ProductRelatedgroups - Comfort - Text", "This is the group description"),1275 productLoop: group.GetLoop("RelatedProducts").Take(3),1276 mainProduct: product1277 )1278 }1279 }12801281 @if ( !string.IsNullOrEmpty( @GetString( "Ecom:Product.CategoryField.FinalProduct.LegOptionsParagraphID.Value.Clean" ) ) )1282 {1283 @RenderParagraphContent( int.Parse( @GetString( "Ecom:Product.CategoryField.FinalProduct.LegOptionsParagraphID.Value.Clean" ) ) )1284 }12851286 @using Co3.Espresso.Website.Services1287 @sectionStart(sectionClasses: "e-section pb-3")12881289 @*@foreach (Product partItem in productPartItems )1290 {1291 var name = partItem.Name;1292 var number = partItem.Number;1293 @name<br/>1294 @number<br/>1295 }*@12961297 <div class="col-12">1298 <div class="row">1299 <div class="col-12 col-lg-8 offset-lg-2">1300 <div class="accordion il-specification-accordion" id="accordionSpecifications">13011302 @foreach ( LoopItem specificationGroupItem in specificationDisplayGroupList )1303 {1304 string groupName = specificationGroupItem.GetString("Ecom:FieldDisplayGroup.Name");1305 string groupID = specificationGroupItem.GetString("Ecom:FieldDisplayGroup.ID");13061307 bool hasValues = false;13081309 foreach ( LoopItem fieldItem in specificationGroupItem.GetLoop("Fields") )1310 {1311 if ( !string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) )1312 {1313 hasValues = true;1314 }1315 else1316 {1317 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1318 if ( !string.IsNullOrEmpty( bomProduct ) )1319 {1320 hasValues = true;1321 }1322 }1323 }13241325 // specificationDisplayGroupList ID's is coming from the foreach in il-part-attributes.cshtml13261327 if ( groupID == "7" ) // Fabric1328 {1329 <div id="attributes-group-@groupID" style="margin-bottom: 1em;">1330 <button class="btn-block collapsed il-custom-accordion-button-stripped m-0 p-0 pb-3 pt-2 text-center togglebar" type="button" data-toggle="collapse" data-target="#collapse-attributes-@groupID" aria-expanded="false" aria-controls="collapse-attributes-@groupID">1331 <h4 class="mb-0">@groupName</h4>1332 </button>1333 </div>13341335 <div id="collapse-attributes-@groupID" class="collapse il-top-toggle" aria-labelledby="@groupName" data-parent="#accordionSpecifications">1336 <div class="js-product-detail-fabric-container">1337 <script id="js-e-handlebars-tmpl-product-detail-fabric" type="text/x-handlebars-template">1338 <table class="il-custom-attribute-data-table mb-4">1339 {{#each displayFields}}1340 <tr>1341 <td class="subject">{{label}}</td>1342 <td>1343 {{#compare type '===' 'Link'}}1344 <a href="{{value}}">Read More</a>1345 {{else}}1346 {{#compare type '===' 'Filemanager'}}1347 <img src="{{value}}" />1348 {{else}}1349 {{value}}1350 {{/compare}}1351 {{/compare}}1352 </td>1353 </tr>1354 {{/each}}1355 </table>1356 </script>1357 </div>1358 </div>1359 }136013611362 if ( hasValues == true || !string.IsNullOrEmpty(bomProduct) )1363 {13641365 if ( specificationGroupItem.GetLoop("Fields").Count > 0 )1366 {13671368 if ( groupID != "12" && groupID !="11" && groupID !="7" ) { // General products & Downloads & fabrics13691370 <div id="attributes-group-@groupID" style="margin-bottom: 1em;">1371 <button class="btn-block collapsed il-custom-accordion-button-stripped m-0 p-0 pt-2 pb-3 text-center togglebar" type="button" data-toggle="collapse" data-target="#collapse-attributes-@groupID" aria-expanded="false" aria-controls="collapse-attributes-@groupID">1372 <h4 class="mb-0">@groupName</h4>1373 </button>1374 </div>13751376 <div id="collapse-attributes-@groupID" class="collapse il-top-toggle" aria-labelledby="@groupName" data-parent="#accordionSpecifications">13771378 @if ( groupID == "8" ) // The Designers1379 {1380 string designerImage = GetString("DesignerImage");1381 string designerImageURL = "/admin/public/getimage.ashx?Crop=0&Image=" + designerImage + "&Format=jpg&Quality=90&Width=400&Height=400";138213831384 <div class="container-fluid">1385 <div class="row">1386 <div class="col-8">1387 <h4 class="mb-0">1388 <strong>1389 <span class="text-muted">Design by @GetString("DesignByInText.Clean")</span>1390 </strong><br /><span class="small">@GetString("DesignedIn.Clean")</span>1391 </h4>1392 <p>@GetString("DesignerDesc.Clean")</p>1393 </div>1394 <div class="col-4">1395 <img class="p-img p-img-circle" src="@designerImageURL" alt="@GetString("DesignByInText.Clean")" />1396 </div>1397 @if ( @GetString("DesignerQuotes.Clean") != "" )1398 {1399 <div class="col-12 col-md-10 offset-md-1 d-block mt-3 mb-3 text-left">1400 <blockquote class="il-designer-quote text-muted">@GetString("DesignerQuotes.Clean")</blockquote>1401 </div>1402 }1403 else1404 {1405 <div class="mb-1">&nbsp;</div>1406 }1407 </div>1408 </div>1409 }14101411 else if ( groupID == "11" ) // Download1412 {1413 <table class="il-custom-attribute-data-table">14141415 @foreach ( LoopItem fieldItem in specificationGroupItem.GetLoop( "Fields" ) ) {1416 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false )1417 {1418 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentName1" ) {1419 @:<tr>1420 <td>@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</td>142114221423 }1424 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentFile1" ) {1425 <td>1426 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download>1427 @Translate( "eCom Product = Download General - Link", "Download" )1428 </a>1429 </td>1430 @:</tr>1431 }14321433 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentName2" ) {1434 @:<tr>1435 <td>@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</td>14361437 }1438 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentFile2" ) {1439 <td>1440 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download>1441 @Translate( "eCom Product = Download General - Link", "Download" )1442 </a>1443 </td>1444 @:</tr>1445 }14461447 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentName3" ) {1448 @:<tr>1449 <td>@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</td>14501451 }1452 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TemplateTag" ) == "DocumentFile3" ) {1453 <td>1454 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download>1455 @Translate( "eCom Product = Download General - Link", "Download" )1456 </a>1457 </td>1458 @:</tr>1459 }1460 }1461 }1462 </table>1463 }1464 else if ( groupID == "6" ) // Comfort / Mattress1465 {1466 string comfortImage = product.GetCategoryValue( "FinalProduct", "RelComfortImage" )?.ToString();1467 bool hasComfortImage = !string.IsNullOrEmpty( comfortImage );1468 string cssContentRow = hasComfortImage ? "col-8" : "col-12";14691470 <div class="row">1471 <div class="@cssContentRow">1472 <table class="il-custom-attribute-data-table mb-4 COMFORT">1473 @foreach ( LoopItem fieldItem in specificationGroupItem.GetLoop( "Fields" ) )1474 {1475 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1476 string fieldDisplayGroupOptionLabelRaw = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );1477 if ( string.IsNullOrEmpty( fieldDisplayGroupOptionLabelRaw ) )1478 {1479 fieldDisplayGroupOptionLabelRaw = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name");1480 }1481 string fieldDisplayGroupOptionLabelTranslated = Translate( String.Format( "ecom Product Specifications -" + fieldDisplayGroupOptionLabelRaw + " - Heading", fieldDisplayGroupOptionLabelRaw ), fieldDisplayGroupOptionLabelRaw );1482 string fieldDisplayGroupFieldNameRaw = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" );1483 string fieldDisplayGroupFieldNameTranslated = Translate( String.Format( "ecom Product Specifications -" + fieldDisplayGroupFieldNameRaw + " - Heading", fieldDisplayGroupFieldNameRaw ), fieldDisplayGroupFieldNameRaw );14841485 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false )1486 {1487 <tr>1488 <td class="subject">@fieldDisplayGroupFieldNameTranslated</td>1489 <td>1490 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Images" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".jpg" ) || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".png" ) )1491 {1492 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1493 }1494 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".jpg" ) )1495 {1496 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1497 }1498 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".png" ) )1499 {1500 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1501 }1502 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".pdf" ) )1503 {1504 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Replace( "../", "/Files/" )">1505 @Translate( "eCom Product = Download PDF - Link", "Download pdf here" )1506 </a>1507 }1508 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Link" )1509 {1510 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )">1511 @Translate( "eCom Product - View more - Text", "View more" )1512 </a>1513 }1514 else1515 {1516 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.IsList" ) == "True" )1517 {1518 @fieldDisplayGroupOptionLabelTranslated<br/>1519 }1520 else1521 {1522 @fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )<br/>1523 }1524 }1525 </td>1526 </tr>1527 }1528 else if ( !string.IsNullOrEmpty( bomProduct ) )1529 {1530 <tr>1531 <td class="subject">@fieldDisplayGroupOptionLabelTranslated</td>1532 <td>@bomProduct</td>1533 </tr>1534 }1535 }1536 </table>1537 </div>1538 @if ( hasComfortImage )1539 {1540 <div class="col-4">1541 <img src="@ImageService.Instance.GetImageURL("/Files/Images/" + comfortImage, 400, 400, 1)" alt="" class="p-img mb-2"/>1542 </div>1543 }1544 </div>1545 }1546 else1547 {1548 <table class="il-custom-attribute-data-table mb-4">1549 @foreach ( LoopItem fieldItem in specificationGroupItem.GetLoop( "Fields" ) )1550 {1551 bomProduct = Co3.IL.Dw.Services.ProductService.Instance.GetCategoryValueByBOMProduct( product, fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) );1552 string fieldDisplayGroupOptionLabelRaw = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" );1553 if ( string.IsNullOrEmpty( fieldDisplayGroupOptionLabelRaw ) )1554 {1555 fieldDisplayGroupOptionLabelRaw = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name");1556 }1557 string fieldDisplayGroupOptionLabelTranslated = Translate( String.Format( "ecom Product Specifications -" + fieldDisplayGroupOptionLabelRaw + " - Heading", fieldDisplayGroupOptionLabelRaw ), fieldDisplayGroupOptionLabelRaw );1558 string fieldDisplayGroupFieldNameRaw = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" );1559 string fieldDisplayGroupFieldNameTranslated = Translate( String.Format( "ecom Product Specifications -" + fieldDisplayGroupFieldNameRaw + " - Heading", fieldDisplayGroupFieldNameRaw ), fieldDisplayGroupFieldNameRaw );15601561 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false )1562 {1563 <tr>1564 <td class="subject">@fieldDisplayGroupFieldNameTranslated</td>1565 <td>1566 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Images" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".jpg" ) || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".png" ) )1567 {1568 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1569 }1570 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".jpg" ) )1571 {1572 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1573 }1574 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".png" ) )1575 {1576 <img class="col-12 col-md-6" src="@ImageService.Instance.GetImageURL( "/Files/Images/" + fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 500, 0, 0 )"/>1577 }1578 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Filemanager" && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Contains( ".pdf" ) )1579 {1580 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ).Replace( "../", "/Files/" )">1581 @Translate( "eCom Product = Download PDF - Link", "Download pdf here" )1582 </a>1583 }1584 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.TypeName" ) == "Link" )1585 {1586 <a href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )">1587 @Translate( "eCom Product - View more - Text", "View more" )1588 </a>1589 }1590 else1591 {1592 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.IsList" ) == "True" )1593 {1594 @fieldDisplayGroupOptionLabelTranslated<br/>1595 }1596 else1597 {1598 @fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )<br/>1599 }1600 }1601 </td>1602 </tr>1603 }1604 else if ( !string.IsNullOrEmpty( bomProduct ) )1605 {1606 <tr>1607 <td class="subject">@fieldDisplayGroupOptionLabelTranslated</td>1608 <td>@bomProduct</td>1609 </tr>1610 }1611 }1612 </table>1613 }1614 </div>1615 }1616 }1617 }1618 }16191620 </div>16211622 </div>1623 </div>1624 </div>1625 @sectionEnd()16261627 @{1628 string portraitCarouselClassList = "d-none";1629 string carouselPortraitContainer = "d-none";16301631 bool showPortraitCarousel = GetLoop( "ImageCategories" ).Any( cp=>cp.GetString("Category.SystemName") == "BannerPortrait" );16321633 if (showPortraitCarousel == true) {1634 carouselPortraitContainer = "d-block";1635 }1636 }16371638 @sectionStart(1639 sectionClasses: "e-section pb-1",1640 contentClasses:"col-12 col-md-8 mx-auto")1641 <div class="col-12 col-md-8 offset-md-2 @carouselPortraitContainer">1642 <div class="row">1643 <div class="col-12">1644 <div class="e-product-image-container">1645 <div class="carousel slide il-product-image-carousel-portrait" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-portrait">1646 <div class="border e-product-image-wrapper format-portrait">1647 <div class="carousel-inner">16481649 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") )1650 {1651 if ( imageCategories.GetString("Category.SystemName") == "BannerPortrait" )1652 {1653 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() )1654 {1655 if ( image.Element.Index == 1 )1656 {1657 isActive = "active";1658 }1659 else1660 {1661 isActive = "";1662 }1663 if ( image.Index != 0 )1664 {1665 portraitCarouselClassList = "d-flex";1666 }1667 <div style="background: url('/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=1500&Height=&Quality=90'); background-size:cover" class="carousel-item @isActive" data-toggle="modal">1668 @*<img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=1500&Height=&Quality=90" alt="" class="e-product-image" data-slide-to="@(image.Index)">*@1669 </div>1670 }1671 }1672 }16731674 <a class="carousel-control-prev @portraitCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-portrait"></a>1675 <a class="carousel-control-next @portraitCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-portrait"></a>16761677 </div>1678 </div>1679 <ol class="carousel-indicators custom-thumbs-none @portraitCarouselClassList">1680 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") )1681 {1682 if ( imageCategories.GetString("Category.SystemName") == "BannerPortrait" )1683 {1684 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() )1685 {1686 if ( image.Element.Index == 1 )1687 {1688 isActive = "active";1689 }1690 else1691 {1692 isActive = "";1693 }1694 <li class="@isActive" data-target="#js-e-product-image-carousel-portrait" data-slide-to="@(image.Index)">1695 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=50&Height=&Quality=75)"></span>1696 </li>1697 }1698 }1699 }1700 </ol>1701 </div>1702 </div>1703 </div>1704 </div>1705 </div>1706 @sectionEnd()17071708 @{1709 string landscapeCarouselClassList = "d-none";1710 string carouselLandscapeContainer = "d-none";17111712 bool showLandscapeCarousel = GetLoop( "ImageCategories" ).Any( cl=>cl.GetString("Category.SystemName") == "BannerLandscape" );17131714 if (showLandscapeCarousel == true) {1715 carouselLandscapeContainer = "d-block";1716 }1717 }17181719 @sectionStart(1720 sectionClasses: "e-section pb-1",1721 contentClasses:"col-12 col-md-10 mx-auto")1722 <div class="col-12 @carouselLandscapeContainer">1723 <div class="row">1724 <div class="col-12">1725 <div class="e-product-image-container">1726 <div class="carousel slide il-product-image-carousel-landscape" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-landscape">1727 <div class="border e-product-image-wrapper format-landscape">1728 <div class="carousel-inner">17291730 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") )1731 {1732 if ( imageCategories.GetString("Category.SystemName") == "BannerLandscape" )1733 {1734 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() )1735 {1736 if ( image.Element.Index == 1 )1737 {1738 isActive = "active";1739 }1740 else1741 {1742 isActive = "";1743 }1744 if ( image.Index != 0 )1745 {1746 landscapeCarouselClassList = "d-flex";1747 }1748 <div style="background: url('/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=1500&Height=&Quality=90'); background-size:cover" class="carousel-item @isActive" data-toggle="modal">1749 @*<img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=1500&Height=&Quality=90" alt="" class="e-product-image" data-slide-to="@(image.Index)">*@1750 </div>1751 }1752 }1753 }17541755 <a class="carousel-control-prev @landscapeCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-landscape"></a>1756 <a class="carousel-control-next @landscapeCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-landscape"></a>17571758 </div>1759 </div>1760 <ol class="carousel-indicators custom-thumbs-none @landscapeCarouselClassList">1761 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") )1762 {1763 if ( imageCategories.GetString("Category.SystemName") == "BannerLandscape" )1764 {1765 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() )1766 {1767 if ( image.Element.Index == 1 )1768 {1769 isActive = "active";1770 }1771 else1772 {1773 isActive = "";1774 }1775 <li class="@isActive" data-target="#js-e-product-image-carousel-landscape" data-slide-to="@(image.Index)">1776 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=50&Height=&Quality=75)"></span>1777 </li>1778 }1779 }1780 }1781 </ol>1782 </div>1783 </div>1784 </div>1785 </div>1786 </div>1787 @sectionEnd()17881789 </div>17901791 @foreach ( LoopItem group in GetLoop("ProductRelatedGroups") )1792 {1793 if ( group.GetString( "Ecom:Product:RelatedGroup.GroupID" ) != "RELGRP5" )1794 {1795 @ProductRelatedProducts(1796 sectionClasses: "e-section bg-light py-3 js-productlist-cylindo",1797 heading: group.GetString("Ecom:Product:RelatedGroup.Name"),1798 productLoop: group.GetLoop("RelatedProducts").Take(4)1799 )1800 }1801 }18021803 <script type="application/ld+json">1804 {1805 "@@context" : "http://schema.org",1806 "@@type" : "Product",1807 "description" : "@GetString( "Ecom:Product.CategoryField.FinalProduct.TeaserDescription.Value" ).StripHtml()",1808 "sku" : "@GetString("Ecom:Product.Number").StripHtml()",1809 "name" : "@ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).StripHtml()",1810 "image" : "@primaryImage",1811 "offers" : {1812 "@@type" : "Offer",1813 "availability" : "http://schema.org/InStock",1814 "price" : "0", @*@ProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()*@1815 "priceCurrency" : "@EcomContext.Currency.Code",1816 "priceValidUntil" : "2040-12-01",1817 "url" : "@HttpContext.Current.Request.Url.Scheme://@HttpContext.Current.Request.Url.Host@SearchEngineFriendlyURLs.GetFriendlyUrl( ProductService.Instance.GetProductLink( GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ) )"1818 },1819 "brand" : "Innovation Living",1820 "gtin8" : "@GetString("Ecom:Product.Number").StripHtml()"18211822 }1823 </script>18241825 <script>1826 dataLayer.push({1827 "ecommerce": {1828 "detail": {1829 "products": [{1830 "name": "@ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )",1831 "id": "@GetString("Ecom:Product.Number")",1832 "price": "0"@*@ProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()*@1833 }]1834 }1835 }1836 });1837 </script>1838183918401841 <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>18421843 @sectionStart()18441845 @* MODALS *@1846 @{1847 int fabricDisclamerparagraphID = 0;1848 int madeToOrderDisclamerparagraphID = 0;1849 int standardDisclamerparagraphID = 0;1850 string standardDisclamerparagraph = Espresso.Area.Item.StandardDeliveryDisclamerParagraph;1851 string madeToOrderDeliveryDisclamerParagraph = Espresso.Area.Item.MadeToOrderDeliveryDisclamerParagraph;1852 string fabricDisclamerParagraph = Espresso.Area.Item.FabricDisclamerParagraph;1853 if ( !string.IsNullOrEmpty( standardDisclamerparagraph ) )1854 {1855 int.TryParse(standardDisclamerparagraph.Split( '#' )[ 1 ], out standardDisclamerparagraphID);1856 }1857 if ( !string.IsNullOrEmpty( madeToOrderDeliveryDisclamerParagraph ) )1858 {1859 int.TryParse(madeToOrderDeliveryDisclamerParagraph.Split( '#' )[ 1 ], out madeToOrderDisclamerparagraphID);1860 }1861 if ( !string.IsNullOrEmpty( fabricDisclamerParagraph ) )1862 {1863 int.TryParse(fabricDisclamerParagraph.Split( '#' )[ 1 ], out fabricDisclamerparagraphID);1864 }1865 }1866 <div aria-hidden="true" aria-labelledby="exampleModalCenterTitle" class="fade modal" id="disclaimerModal" role="dialog" tabindex="-1">1867 <div class="modal-dialog modal-dialog-centered" role="document">1868 <div class="modal-content">1869 <div class="modal-header">1870 <h4 class="modal-title" id="exampleModalLongTitle">@Translate("eCom Product - Disclaimer - Heading", "Fabric disclaimer")</h4>1871 <button aria-label="Close" class="close" data-dismiss="modal" type="button">1872 <span aria-hidden="true">&times;</span>1873 </button>1874 </div>1875 <div class="modal-body">1876 @if ( fabricDisclamerparagraphID > 0 )1877 {1878 @RenderParagraphContent( fabricDisclamerparagraphID )1879 }1880 </div>1881 </div>1882 </div>1883 </div>18841885 <div aria-hidden="true" aria-labelledby="exampleModalCenterTitle" class="fade modal" id="deliveryStandardModal" role="dialog" tabindex="-1">1886 <div class="modal-dialog modal-dialog-centered" role="document">1887 <div class="modal-content">1888 <div class="modal-header">1889 <h4 class="modal-title" id="exampleModalLongTitle">@Translate("eCom Product - DeliveryInfo - Heading", "Delivery info")</h4>1890 <button aria-label="Close" class="close" data-dismiss="modal" type="button">1891 <span aria-hidden="true">&times;</span>1892 </button>1893 </div>1894 <div class="modal-body">1895 @if ( standardDisclamerparagraphID > 0 )1896 {1897 @RenderParagraphContent( standardDisclamerparagraphID )1898 }1899 </div>1900 </div>1901 </div>1902 </div>19031904 <div aria-hidden="true" aria-labelledby="exampleModalCenterTitle" class="fade modal" id="deliveryMadeToOrderModal" role="dialog" tabindex="-1">1905 <div class="modal-dialog modal-dialog-centered" role="document">1906 <div class="modal-content">1907 <div class="modal-header">1908 <h4 class="modal-title" id="exampleModalLongTitle">@Translate("eCom Product - DeliveryInfo - Heading", "Delivery info")</h4>1909 <button aria-label="Close" class="close" data-dismiss="modal" type="button">1910 <span aria-hidden="true">&times;</span>1911 </button>1912 </div>1913 <div class="modal-body">1914 @if ( madeToOrderDisclamerparagraphID > 0 )1915 {1916 @RenderParagraphContent( madeToOrderDisclamerparagraphID )1917 }1918 </div>1919 </div>1920 </div>1921 </div>19221923 <div aria-hidden="true" aria-labelledby="exampleModalCenterTitle" class="fade modal" id="overviewIllustrationModal" role="dialog" tabindex="-1">1924 <div class="modal-dialog modal-dialog-centered" role="document">1925 <div class="modal-content">1926 <div class="modal-header">1927 <h4 class="modal-title" id="exampleModalLongTitle">@Translate("eCom Product - Overview illustration - Heading", "Overview illustration")</h4>1928 <button aria-label="Close" class="close" data-dismiss="modal" type="button">1929 <span aria-hidden="true">&times;</span>1930 </button>1931 </div>1932 <div class="modal-body text-center">1933 <img src="@overviewIllustration" alt="" class="p-img"/>1934 </div>1935 </div>1936 </div>1937 </div>19381939 @{1940 string ogImageContent = string.Format( "{0}://{1}{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, GetString( "Ecom:Product.ImageDefault.Clean" ) );1941 string ogDescriptionContent = Regex.Replace(Regex.Replace( GetString( "Ecom:Product.CategoryField.FinalProduct.TeaserDescription.Value" ), "<.*?>", String.Empty ), "&nbsp;", string.Empty );1942 }19431944 @SnippetStart("productSpecificData")1945 <meta property="og:type" content="product">1946 <meta property="og:title" content="@ProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )">1947 <meta property="og:description" content="@ogDescriptionContent">1948 <meta property="og:image" content="@ogImageContent">1949 @SnippetEnd("productSpecificData")1950
keyboard_arrow_up