Error executing template "Designs/bloomingville/eCom/Product/espresso.cshtml"System.ArgumentNullException: Value cannot be null.Parameter name: sourceat System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)at Co3.Espresso4.Addons.ClerkIOIntegration.ClerkIOAPI.APIWrapper.GetProductsFromClerkIOResult(String ClerkIOResponse, String productListName) in C:\projects\co3\co3-espresso-v4-addons\Co3.Espresso4.Addons.ClerkIOIntegration\Co3.Espresso4.Addons.ClerkIOIntegration\ClerkIOAPI\APIWrapper.cs:line 514at Co3.Espresso4.Addons.ClerkIOIntegration.ClerkIOAPI.APIWrapper.IGetComplimentaryProducts(String ids, String labels, Int32 limit) in C:\projects\co3\co3-espresso-v4-addons\Co3.Espresso4.Addons.ClerkIOIntegration\Co3.Espresso4.Addons.ClerkIOIntegration\ClerkIOAPI\APIWrapper.cs:line 160at CompiledRazorTemplates.Dynamic.RazorEngine_5686485ae6d547268023f8203678552f.Execute() in E:\Dynamicweb.NET\Solutions\bloomingville.espresso4.dk\Files\Templates\Designs\bloomingville\eCom\Product\espresso.cshtml:line 753at 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.b__0(TextWriter writer)at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @*DB: cherry pick Clerk IO to Live*@ 2 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 3 4 @using System.Dynamic 5 @using System.Web 6 @using Co3.Bloomingville.Integration.ClerkIOIntegration 7 @using Co3.Bloomingville.Website.Models.Frontend.Ecommerce 8 @using Co3.Espresso.Addons.ClerkIOIntegration 9 @using Co3.Espresso.Website.Services 10 @using Co3.Espresso.Website.Models.FrontEnd 11 @using Co3.Espresso.Website.Models.FrontEnd.Settings 12 @using Co3.Espresso.Website.Models.FrontEnd.Ecommerce 13 @using Co3.Espresso.Website.Models.FrontEnd.Handlebars 14 @using Dynamicweb.Content 15 @using Dynamicweb.Content.Items 16 @using Dynamicweb.Ecommerce.CustomerCenter 17 @using Dynamicweb.Ecommerce.Products 18 @using Dynamicweb.Frontend 19 @using Dynamicweb.Security.UserManagement 20 @using ProductService = Co3.Espresso.Website.Services.ProductService 21 @using Co3.Espresso4.Addons.ClerkIOIntegration.ClerkIOAPI 22 @using Dynamicweb.Ecommerce.Common 23 @using Dynamicweb.Ecommerce.Orders 24 @using Dynamicweb.Rendering 25 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 26 27 @{ 28 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 29 BloomingvilleProduct espressoProduct = (BloomingvilleProduct)ProductService.Instance.GetEspressoProduct( 30 new ProductSettings() 31 { 32 Id = GetString("Ecom:Product.ID"), 33 VariantId = GetString("Ecom:Product.VariantID"), 34 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID") 35 } 36 ); 37 38 // Add auto generated relation groups fra Dynamicweb to RelatedGroups dictionary, in order to access them the same way, as the custom related product groups. 39 40 // Related product groups are rendered in this order. 41 string[] relatedGroupIds = 42 { 43 "SimilarProducts", 44 "HotRightNow", 45 "DesignersFavorite" 46 }; 47 48 string imageLifeStyle = espressoProduct.ImageLifeStyle.Large; 49 string brandLogo = string.Empty; 50 string brandText = Translate(string.Format("eCom Product - Brand {0} - Text", espressoProduct.Brand), "Modo lorem pythagoras quid quae abducas habent potius quem singulos pullum quicquid memini.An expetendum si memini est quem modo quo ut."); 51 string brandPersonName = string.Empty; 52 string brandPersonTitle = string.Empty; 53 string brandPersonImage = string.Empty; 54 string brandPersonText = string.Empty; 55 string brandPersonHeading = string.Empty; 56 string baseUrl = String.Format("{0}://{1}", GetGlobalValue("Global:Request.Scheme"), GetGlobalValue("Global:Request.Host")); 57 58 59 if (espressoProduct.Brand == "CREATIVE COLLECTION") 60 { 61 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/Creative-Collection-logo_black.svg"; 62 brandPersonName = Espresso.Area.Item.CreativeCollection_Name; 63 brandPersonTitle = Espresso.Area.Item.CreativeCollection_Title; 64 brandPersonImage = Espresso.Area.Item.CreativeCollection_Image; 65 brandPersonText = Espresso.Area.Item.CreativeCollection_Text; 66 brandPersonHeading = Espresso.Area.Item.CreativeCollection_Heading; 67 68 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true) 69 { 70 imageLifeStyle = Espresso.Area.Item.CreativeCollection_Image_LifeStyle_Alternative; 71 } 72 } 73 else if (espressoProduct.Brand == "ILLUME X BLOOMINGVILLE") 74 { 75 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/illumexbloomingville-logo-ECH-long.svg"; 76 brandPersonName = Espresso.Area.Item.Illume_Name; 77 brandPersonTitle = Espresso.Area.Item.Illume_Title; 78 brandPersonImage = Espresso.Area.Item.Illume_Image; 79 brandPersonText = Espresso.Area.Item.Illume_Text; 80 brandPersonHeading = Espresso.Area.Item.Illume_Heading; 81 82 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true) 83 { 84 imageLifeStyle = Espresso.Area.Item.Illume_Image_LifeStyle_Alternative; 85 } 86 } 87 else if (espressoProduct.Brand == "BLOOMINGVILLE MINI") 88 { 89 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/Bloomingville-mini.svg"; 90 brandPersonName = Espresso.Area.Item.BloomingvilleKids_Name; 91 brandPersonTitle = Espresso.Area.Item.BloomingvilleKids_Title; 92 brandPersonImage = Espresso.Area.Item.BloomingvilleKids_Image; 93 brandPersonText = Espresso.Area.Item.BloomingvilleKids_Text; 94 brandPersonHeading = Espresso.Area.Item.BloomingvilleKids_Heading; 95 96 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true) 97 { 98 imageLifeStyle = Espresso.Area.Item.BloomingvilleKids_Image_LifeStyle_Alternative; 99 }100 }101 else if (espressoProduct.Brand == "ILLUME")102 {103 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/illume_logo.svg";104 brandPersonName = Espresso.Area.Item.Illume_brand_Name;105 brandPersonTitle = Espresso.Area.Item.Illume_brand_Title;106 brandPersonImage = Espresso.Area.Item.Illume_brand_Image;107 brandPersonText = Espresso.Area.Item.Illume_brand_Text;108 brandPersonHeading = Espresso.Area.Item.Illume_brand_Heading;109110 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true)111 {112 imageLifeStyle = Espresso.Area.Item.BloomingvilleKids_Image_LifeStyle_Alternative;113 }114 }115 else116 {117 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/logo.svg";118 brandPersonName = Espresso.Area.Item.Bloomingville_Name;119 brandPersonTitle = Espresso.Area.Item.Bloomingville_Title;120 brandPersonImage = Espresso.Area.Item.Bloomingville_Image;121 brandPersonText = Espresso.Area.Item.Bloomingville_Text;122 brandPersonHeading = Espresso.Area.Item.Bloomingville_Heading;123124 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true)125 {126 imageLifeStyle = Espresso.Area.Item.Bloomingville_Image_LifeStyle_Alternative;127 }128 }129130 // Canonical131132 string eComProductCanonical = string.Empty;133134 string globalValueUrl = GetGlobalValue("Global:Pageview.Url");135136 if (GetGlobalValue("Global:Pageview.Url").IndexOf("?") > -1)137 {138 globalValueUrl = GetGlobalValue("Global:Pageview.Url").Substring(0, GetGlobalValue("Global:Pageview.Url").IndexOf("?"));139 }140141 if (string.IsNullOrEmpty(GetString("Ecom:Product.Canonical")) == false)142 {143 eComProductCanonical = String.Format("{0}{1}", baseUrl, GetString("Ecom:Product.Canonical"));144 }145 else146 {147 eComProductCanonical = String.Format("{0}{1}", baseUrl, globalValueUrl);148 }149150 // SALESTEXT151152 string langCulture = PageView.Current().Area.CultureInfo.Name;153154 string salesText = "";155 // string salesTextDefault = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText.Value.Clean");156 string salesTextDefault = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText.Value.Clean");157 string salesTextDA = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextDA.Value.Clean");158 string salesTextDE = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextDE.Value.Clean");159 string salesTextFR = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextFR.Value.Clean");160161162 if (langCulture.Contains("da"))163 {164 salesText = !string.IsNullOrEmpty(salesTextDA) ? salesTextDA : salesTextDefault;165 }166167 else if (langCulture.Contains("de"))168 {169 salesText = !string.IsNullOrEmpty(salesTextDE) ? salesTextDE : salesTextDefault;170 }171172 else if (langCulture.Contains("fr"))173 {174 salesText = !string.IsNullOrEmpty(salesTextFR) ? salesTextFR : salesTextDefault;175 }176 else177 {178 salesText = salesTextDefault;179 }180181 // MAIN MATERIAL182183 string mainMaterial = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.MainMaterial.Value.Clean");184 string customOekotex = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.STANDARD100byOEKOTEX.Value.Clean");185186 EspressoProductList variants = new EspressoProductList();187 espressoProduct.RelatedGroups.TryGetValue("Variants", out variants);188 EspressoProductList collection = new EspressoProductList();189 espressoProduct.RelatedGroups.TryGetValue("Collection", out collection);190191 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName;192 string getSalesTextCurrentLanguage = string.Format("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText{0}.Value", globalAreaLang.ToUpper());193194 List<EspressoProductImageUrl> packshots = new List<EspressoProductImageUrl>();195 EspressoProductImageUrl primaryLifestyleImage = null;196 EspressoProductImageUrl secondaryLifestyleImage = null;197 List<EspressoProductImageUrl> lifestyles = espressoProduct.LifeStyleImages;198 if (string.IsNullOrEmpty(espressoProduct.ImagePrimary.Original) == false)199 {200 packshots.Add(espressoProduct.ImagePrimary);201 }202 packshots.AddRange(espressoProduct.ImageDetails);203204 List<EspressoProductImageUrl> downloads = new List<EspressoProductImageUrl>();205 downloads.AddRange(packshots);206 downloads.AddRange(lifestyles);207208 if (lifestyles.Any() && lifestyles[0] != null)209 {210 primaryLifestyleImage = lifestyles[0];211 lifestyles.RemoveAt(0);212 }213 if (lifestyles.Any() && lifestyles[0] != null)214 {215 secondaryLifestyleImage = lifestyles[0];216 lifestyles.RemoveAt(0);217 }218219 dynamic desktopImagesSectionJson = new220 {221 packshots = packshots,222 packshots_col = primaryLifestyleImage == null && secondaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",223 primaryLifestyleImage = primaryLifestyleImage,224 primaryLifestyleImage_col = packshots.Count == 0 && secondaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",225 secondaryLifestyleImage = secondaryLifestyleImage,226 secondaryLifestyleImage_col = packshots.Count == 0 && primaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",227 lifestyles = lifestyles,228 lifestyles_col = packshots.Count == 0 && primaryLifestyleImage == null && secondaryLifestyleImage == null ? "col-8" : "col-6"229 };230 }231232 @SnippetStart("OpenGraphProductSnippet")233 <meta property="og:image"234 content="@baseUrl/admin/public/getimage.ashx?Image=@GetString("Ecom:Product.PrimaryImage")&Format=jpg&Width=1200&Height=630&Quality=75&Crop=5&fillcanvas=true&background=white">235 <meta property="og:title" content="@espressoProduct.Name">236 <meta property="og:description" content="@espressoProduct.DescriptionShort">237 @SnippetEnd("OpenGraphProductSnippet")238239 @RenderingService.Instance.SectionEnd()240241 @if (espressoProduct.B2CActive == "No" && isUserAuthenticated == false)242 {243 }244 else245 {246 @SnippetStart("eComCanonical")@eComProductCanonical@SnippetEnd("eComCanonical")247248 <div class="e-product js-e-product" data-product-id="@espressoProduct.Id"249 data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()"250 data-variant-id="@espressoProduct.VariantId">251252 @RenderingService.Instance.SectionStart(new SectionSettings253 {254 Classes = new ClassList("e-section pb-2")255 })256 <div class="col-12">257 <img class="mb-2 text-muted" style="height: 28px;" src="@brandLogo"/>258 </div>259 <div class="col-12">260 <div class="row">261 <div class="col-12 col-md-8">262 <div class="d-block d-md-none">263 @RenderingService.Instance.PartialView("ecom/product/partials/images.cshtml", espressoProduct)264 </div>265 @RenderingService.Instance.PartialView("ecom/product/partials/image-section-desktop.cshtml", espressoProduct)266267 @if (isUserAuthenticated)268 {269 IEnumerable<CustomerProductList> userFavoriteLists = CustomerProductList.GetAllProductLists(PageView.Current().User.ID);270 string isInAnyList = userFavoriteLists.Any(fl => espressoProduct.IsInFavoriteList(fl.ID)) == true ? "isInAnyList" : "";271 <div class="bloomingville-addtolist-wrapper js-bloomingville-addtolist-wrapper @isInAnyList">272 <div class="dropdown js-e-productlist-favorite-list-container"273 data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId">274 <span class="dropdown-toggle" data-toggle="dropdown">275 <span class="bloomingville-productlist-addtolist label-favorite"></span>276 </span>277 <div class="dropdown-menu dropdown-menu-left pt-0">278 @RenderingService.Instance.PartialView("ecom/productlist/partials/add-to-favorites.cshtml", espressoProduct)279 </div>280 </div>281 </div>282 }283284 <div class="d-none d-md-block w-100 mt-4">285 <div class="col-12">286 <div class="p-accordion-container border-dark mb-2">287 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))288 {289 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">290 <div class="p-accordion-toggle">291 <p data-toggle="collapse" data-target="#e-accordion-12574-185" class="py-1 d-flex align-items-center m-0 justify-content-between collapsed" aria-expanded="false">292 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Produktbeskrivelse - Heading", "Produktbeskrivelse")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>293 </p>294 </div>295 <div id="e-accordion-12574-185" class="fade collapse" style="">296 <div class="pb-4 pt-1 pr-2 p-accordion-content">297 <div class="p-txt-container small">298 @espressoProduct.DescriptionShort299 </div>300 </div>301 </div>302 </div>303 }304 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">305 <div class="p-accordion-toggle">306 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">307 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Produktspecifikationer - Heading", "Produktspecifikationer")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>308 </p>309 </div>310 <div id="e-accordion-specifications" class="collapse fade">311 <div class="pb-4 pt-1 p-accordion-content">312 <div class="p-txt-container">313 <table class="table table-sm table-striped">314 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))315 {316 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")317 {318 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))319 {320 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value");321 string fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id");322 string fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name");323324 string fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;325326 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")327 {328 <tr>329 <th class="pl-2" style="width: 50%">330 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)331 </th>332 <td>333 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))334 {335 @GetString(getSalesTextCurrentLanguage)336 }337 else338 {339 @fieldLink340 }341 </td>342 </tr>343 }344 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")345 {346 @* Removes Sales Texts because they are manually handled right above here *@347 }348 else if (!string.IsNullOrEmpty(fieldValue))349 {350 <tr>351 <th class="pl-2" style="width: 50%">352 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)353 </th>354 <td>355 @fieldLink356 </td>357 </tr>358 }359 }360 }361 }362 </table>363 </div>364 </div>365 </div>366 </div>367 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">368 <div class="p-accordion-toggle">369 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">370 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Billeder - Heading", "Billeder")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>371 </p>372 </div>373 <div id="e-accordion-images" class="collapse fade">374 <div class="pb-4 pt-1 p-accordion-content">375 <div class="p-txt-container">376 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)377 </div>378 </div>379 </div>380 </div>381 </div>382 </div>383 </div>384385 </div>386 <div class="col-12 col-md-4">387388 <p class="h4 mb-1">389 @espressoProduct.Number390 </p>391392 <h1 class="e-product-name mb-1 mt-0 h2">393 @espressoProduct.Name394 </h1>395396 @if (GetString("Ecom:Product:Field.Description2.Value.Clean") != "")397 {398 <p class="h4 mt-2 mb-2" style="text-transform: none">@GetString("Ecom:Product:Field.Description2.Value.Clean")</p>399 }400401 @if (isUserAuthenticated)402 {403 <p class="e-product-price h3 mb-2 mt-0">404 <span class="mr-1">405 @espressoProduct.Price.Format()406 </span>407 @if (espressoProduct.SuggestedRetailPrice.Value > espressoProduct.Price.Value)408 {409 <span class="text-muted" style="text-decoration: line-through;">410 @espressoProduct.SuggestedRetailPrice.Format()411 </span>412 }413 </p>414 }415416 <h4>@Translate("eCom Product - Vejl. udsalgspris - Text", "Vejl. udsalgspris")</h4>417 <p class="e-product-price mb-2 mt-0">418 @espressoProduct.WholesalePrice.Format()419 </p>420421 @if (variants != null && variants.Products.Any())422 {423 @RenderingService.Instance.PartialView("ecom/product/partials/relatedproducts-thumb-list.cshtml", variants)424 }425426427 @if (isUserAuthenticated)428 {429 <div class="small">430 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct)431 </div>432 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct)433 <br/>434 }435 else436 {437 @Espresso.Area.Item.EcommerceAlternativeCallToAction438 <p class="small pr-4">439 <span class="small">@Translate("eCom Product - We cannot garantee - Text", "*Vi kan ikke garantere, at hele sortimentet forefindes hos alle forhandlere.")</span>440 </p>441 }442443 @if (!string.IsNullOrEmpty(salesText))444 {445 <p class="mb-2">@salesText</p>446 }447448 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("fsc"))449 {450 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"451 data-toggle="collapse" href="#collapseFSC" role="button" aria-expanded="false"452 aria-controls="collapseFSC">453 @Translate("eCom Product - FSC Heading Default - Heading", "This product is FSC") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>454 </a>455456 <div class="collapse" id="collapseFSC">457 <p class="mt-1 mb-0">@Translate("eCom Product - FSC Text Default - Text", "This product is FSC® certified.")</p>458 <p class="my-0">@Translate("eCom Product - FSC Text2 Default - Text", "The Forest Stewardship Council (FSC) is an international, non-governmental organisation dedicated to promoting responsible management of the world’s forests. Since its foundation in 1994, FSC has grown to become the world’s most respected and widespread forest certification system. FSC's pioneering certification system enables businesses and consumers to choose wood, paper and other forest products made with materials that support responsible forestry.")</p>459 <p class="my-0">@Translate("eCom Product - FSC Text3 Default - Text", "Bloomingville is certified under certificate code") @espressoProduct.FSC.</p>460 </div>461 }462463 @if (!string.IsNullOrEmpty(customOekotex) && customOekotex.ToLower() == "yes")464 {465 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"466 data-toggle="collapse" href="#collapseOekoTex" role="button" aria-expanded="false"467 aria-controls="collapseOekotex">468 @Translate("eCom Product - OekoTex Heading Default - Heading", "This product is Oekotex") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>469 </a>470471 <div class="collapse" id="collapseOekoTex">472 <p class="mt-1 mb-0">@Translate("eCom Product - OekoTex Text Default - Text", "This is an Oekotex subline or text 1")</p>473 <p class="my-0">@Translate("eCom Product - OekoTex Text2 Default - Text", "This is an Oekotex text 2.")</p>474 <p class="my-0">@Translate("eCom Product - OekoTex Text3 Default - Text", "This is an Oekotex text 3.")</p>475 </div>476 }477478 @if (!string.IsNullOrEmpty(espressoProduct.Found) && espressoProduct.Found.ToLower() == "yes")479 {480 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"481 data-toggle="collapse" href="#collapseFound" role="button" aria-expanded="false"482 aria-controls="collapseFound">483 @Translate("eCom Product - Found Heading Default - Heading", "This product is Found") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>484 </a>485486 <div class="collapse" id="collapseFound">487 <p class="mt-1 mb-0">@Translate("eCom Product - Found Text Default - Text", "This is an Found subline or text 1")</p>488 <p class="my-0">@Translate("eCom Product - Found Text2 Default - Text", "This is an Found text 2.")</p>489 <p class="my-0">@Translate("eCom Product - Found Text3 Default - Text", "This is an Found text 3.")</p>490 </div>491 }492493 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled glass"))494 {495 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"496 data-toggle="collapse" href="#collapseRecycledGlass" role="button" aria-expanded="false"497 aria-controls="collapseRecycledGlass">498 @Translate("eCom Product - RecycledGlass Heading Default - Heading", "This product is RecycledGlass") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>499 </a>500501 <div class="collapse" id="collapseRecycledGlass">502 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledGlass Text Default - Text", "This is a RecycledGlass subline or text 1")</p>503 <p class="my-0">@Translate("eCom Product - RecycledGlass Text2 Default - Text", "This is a RecycledGlass text 2.")</p>504 <p class="my-0">@Translate("eCom Product - RecycledGlass Text3 Default - Text", "This is a RecycledGlass text 3.")</p>505 </div>506 }507508 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled cotton"))509 {510 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"511 data-toggle="collapse" href="#collapseRecycledCotton" role="button"512 aria-expanded="false" aria-controls="collapseRecycledCotton">513 @Translate("eCom Product - RecycledCotton Heading Default - Heading", "This product is RecycledCotton") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>514 </a>515516 <div class="collapse" id="collapseRecycledCotton">517 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledCotton Text Default - Text", "This is a RecycledCotton subline or text 1")</p>518 <p class="my-0">@Translate("eCom Product - RecycledCotton Text2 Default - Text", "This is a RecycledCotton text 2.")</p>519 <p class="my-0">@Translate("eCom Product - RecycledCotton Text3 Default - Text", "This is a RecycledCotton text 3.")</p>520 </div>521 }522523 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled wood"))524 {525 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"526 data-toggle="collapse" href="#collapseRecycledWood" role="button" aria-expanded="false"527 aria-controls="collapseRecycledWood">528 @Translate("eCom Product - RecycledWood Heading Default - Heading", "This product is RecycledWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>529 </a>530531 <div class="collapse" id="collapseRecycledWood">532 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledWood Text Default - Text", "This is a RecycledWood subline or text 1")</p>533 <p class="my-0">@Translate("eCom Product - RecycledWood Text2 Default - Text", "This is a RecycledWood text 2.")</p>534 <p class="my-0">@Translate("eCom Product - RecycledWood Text3 Default - Text", "This is a RecycledWood text 3.")</p>535 </div>536 }537538 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("reclaimed wood"))539 {540 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"541 data-toggle="collapse" href="#collapseReclaimedWood" role="button" aria-expanded="false"542 aria-controls="collapseReclaimedWood">543 @Translate("eCom Product - ReclaimedWood Heading Default - Heading", "This product is ReclaimedWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>544 </a>545546 <div class="collapse" id="collapseReclaimedWood">547 <p class="mt-1 mb-0">@Translate("eCom Product - ReclaimedWood Text Default - Text", "This is a ReclaimedWood subline or text 1")</p>548 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text2 Default - Text", "This is a ReclaimedWood text 2.")</p>549 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text3 Default - Text", "This is a ReclaimedWood text 3.")</p>550 </div>551 }552553 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("paper mache"))554 {555 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"556 data-toggle="collapse" href="#collapsePaperMache" role="button" aria-expanded="false"557 aria-controls="collapsePaperMache">558 @Translate("eCom Product - PaperMache Heading Default - Heading", "This product is PaperMache") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>559 </a>560561 <div class="collapse" id="collapsePaperMache">562 <p class="mt-1 mb-0">@Translate("eCom Product - PaperMache Text Default - Text", "This is a PaperMache subline or text 1")</p>563 <p class="my-0">@Translate("eCom Product - PaperMache Text2 Default - Text", "This is a PaperMache text 2.")</p>564 <p class="my-0">@Translate("eCom Product - PaperMache Text3 Default - Text", "This is a PaperMache text 3.")</p>565 </div>566 }567568 @if (collection != null && collection.Products.Any())569 {570 @RenderingService.Instance.PartialView("ecom/product/partials/relatedproducts-thumb-list.cshtml", collection)571 }572573 </div>574 </div>575 </div>576 @RenderingService.Instance.SectionEnd()577578 @RenderingService.Instance.SectionStart(new SectionSettings579 {580 Classes = new ClassList("e-section pb-2 d-block d-md-none"),581 ContentClasses = new ClassList("col-12 is-lg col-md-7 col-lg-6 col-lg-8 col-xl-8 mr-auto is-lg"),582 Collapsible = false583 })584585 <div class="d-block w-100">586 <div class="col-12">587 <div class="p-accordion-container border-dark mb-2">588 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))589 {590 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">591 <div class="p-accordion-toggle">592 <p data-toggle="collapse" data-target="#e-accordion-12574-185" class="py-1 d-flex align-items-center m-0 justify-content-between collapsed" aria-expanded="false">593 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Produktbeskrivelse - Heading", "Produktbeskrivelse")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>594 </p>595 </div>596 <div id="e-accordion-12574-185" class="fade collapse" style="">597 <div class="pb-4 pt-1 pr-2 p-accordion-content">598 <div class="p-txt-container small">599 @espressoProduct.DescriptionShort600 </div>601 </div>602 </div>603 </div>604 }605 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">606 <div class="p-accordion-toggle">607 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">608 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Produktspecifikationer - Heading", "Produktspecifikationer")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>609 </p>610 </div>611 <div id="e-accordion-specifications" class="collapse fade">612 <div class="pb-4 pt-1 p-accordion-content">613 <div class="p-txt-container">614 <table class="table table-sm table-striped">615 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))616 {617 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")618 {619 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))620 {621 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value");622 string fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id");623 string fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name");624625 string fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;626627 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")628 {629 <tr>630 <th class="pl-2" style="width: 50%">631 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)632 </th>633 <td>634 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))635 {636 @GetString(getSalesTextCurrentLanguage)637 }638 else639 {640 @fieldLink641 }642 </td>643 </tr>644 }645 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")646 {647 @* Removes Sales Texts because they are manually handled right above here *@648 }649 else if (!string.IsNullOrEmpty(fieldValue))650 {651 <tr>652 <th class="pl-2" style="width: 50%">653 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)654 </th>655 <td>656 @fieldLink657 </td>658 </tr>659 }660 }661 }662 }663 </table>664 </div>665 </div>666 </div>667 </div>668 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">669 <div class="p-accordion-toggle">670 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">671 <span class="p-accordion-toggle-text line-height-sm h4 my-0">@Translate("eCom Product - Billeder - Heading", "Billeder")</span><i class="material-icons p-accordion-toggle-icon text-dark ml-1 order-last">keyboard_arrow_down</i>672 </p>673 </div>674 <div id="e-accordion-images" class="collapse fade">675 <div class="pb-4 pt-1 p-accordion-content">676 <div class="p-txt-container">677 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)678 </div>679 </div>680 </div>681 </div>682 </div>683 </div>684 </div>685 @RenderingService.Instance.SectionEnd()686687688 @{689 List<string> productIds = new List<string>();690 if (Context.Cart != null && Context.Cart.OrderLines.Any())691 {692 OrderLineCollection orderLines = Context.Cart.OrderLines;693 productIds = orderLines.Select(ol => ol.ProductId).ToList();694 }695696 productIds.Add(espressoProduct.Id);697698 HandlebarsProductListTemplate handlebarsProductListTemplate = HandlebarsService.Instance.GetProductListTemplate(new HandlebarsProductListTemplateSettings()699 {700 Classes = new ClassList("e-productlist js-e-productlist js-e-require"),701 HeaderClasses = new ClassList("col-12 border-bottom"),702 MainClasses = new ClassList("col-12 js-clerk-content"),703 AsideClasses = new ClassList("col-12"),704 FooterClasses = new ClassList("col-12 col-lg-3 col-xl-3"),705 PageSize = string.IsNullOrEmpty(HttpContext.Current.Request["PageSize"]) ? GetInteger("Ecom:ProductList.PageSize").ToString() : HttpContext.Current.Request["PageSize"],706 PageNumber = string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]) ? GetInteger("Ecom:ProductList.CurrentPage").ToString() : HttpContext.Current.Request["PageNum"],707 SortBy = ProductListService.Instance.GetSortingParameterName(string.IsNullOrEmpty(HttpContext.Current.Request["SortBy"]) ? "" : HttpContext.Current.Request["SortBy"]),708 SortOrder = string.IsNullOrEmpty(HttpContext.Current.Request["SortOrder"]) ? GetString("Ecom:ProductList.SortOrder") : HttpContext.Current.Request["SortOrder"],709 ShowFilters = false,710 Heading = Espresso.Item.HeadingShow == "True" ? Espresso.Item.Name : string.Empty711 });712713 List<EspressoPagingPage> productListPaging = new List<EspressoPagingPage>();714 if (GetLoop("Ecom:ProductList.Pages").Count > 0)715 {716 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages"))717 {718 productListPaging.Add(new EspressoPagingPage()719 {720 Url = page.GetString("Ecom:ProductList.Pages.Page.Url"),721 Number = page.GetString("Ecom:ProductList.Pages.Page.Number")722 });723 }724 }725726727 EspressoProductList substituting = APIWrapper.Instance.IGetSubstitutingProducts(espressoProduct.Id, "SubstitutingProducts");728 if (substituting.Products.Any())729 {730 List<EspressoProduct> substitutingProducts = substituting.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();731 @RenderingService.Instance.SectionStart(new SectionSettings732 {733 Classes = new ClassList("e-section pb-2 bg-light")734 })735 <div class="e-productlist-header col-12">736 <p class="h1">@Translate("eCom Product - Related group - SubstitutingProducts - Heading", "Gode alternativer til dette")</p>737 </div>738 <div class="@handlebarsProductListTemplate.MainClasses">739 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(740 new ProductListSettings()741 {742 Products = substitutingProducts.Take(4).ToList(),743 Paging = productListPaging,744 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),745 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)746 }747 ))748 </div>749 @RenderingService.Instance.SectionEnd()750 }751752753 EspressoProductList complimentary = APIWrapper.Instance.IGetComplimentaryProducts(espressoProduct.Id, "ComplimentaryProducts");754 if (complimentary.Products.Any())755 {756 List<EspressoProduct> complimentaryProducts = complimentary.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();757 @RenderingService.Instance.SectionStart(new SectionSettings758 {759 Classes = new ClassList("e-section pb-2 bg-light")760 })761 <div class="e-productlist-header col-12">762 <p class="h1">@Translate("eCom Product - Related group - ComplimentaryProducts - Heading", "Andre kunder købte også")</p>763 </div>764 <div class="@handlebarsProductListTemplate.MainClasses">765 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(766 new ProductListSettings()767 {768 Products = complimentaryProducts.Take(4).ToList(),769 Paging = productListPaging,770 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),771 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)772 }773 ))774 </div>775 @RenderingService.Instance.SectionEnd()776 }777 }778779 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct)780 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct)781782 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)"783 data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)"></code>784785786 <script>787 const product = JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct))');788 product.downloads = JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(downloads))');789 e4.data.set('@espressoProduct.Id', product);790791 e4.data.set('@(espressoProduct.Id)_desktop',792 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(desktopImagesSectionJson))'));793 </script>794795 </div>796 @RenderingService.Instance.SectionStart(new SectionSettings())797798 <script id="js-e-handlebars-tmpl-favorite-list" type="text/x-handlebars-template">799 {{#each lists as | list |}}800 <div class="dropdown-item">801 <label class="custom-checkbox custom-control m-0">802 <input type="checkbox" class="custom-control-input js-e-favorite-list"803 id="js-e-favorite-list-{{list.id}}" name="favorite-list-{{list.id}}"804 {{#if list.isInFavoriteList}}checked{{/if}} data-url-add="{{{list.addUrl}}}"805 data-url-remove="{{{list.removeUrl}}}">806 <span class="custom-control-indicator"></span>807 <span class="custom-control-description">{{list.name}}</span>808 </label>809 </div>810 {{/each}}811 </script>812 }