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_e8540830272f4e16871492bb3a874650.Execute() in E:\Dynamicweb.NET\Solutions\bloomingville.espresso4.dk\Files\Templates\Designs\bloomingville\eCom\Product\espresso.cshtml:line 757at 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 if (lifestyles.Any() && lifestyles[0] != null)205 {206 primaryLifestyleImage = lifestyles[0];207 lifestyles.RemoveAt(0);208 }209 if (lifestyles.Any() && lifestyles[0] != null)210 {211 secondaryLifestyleImage = lifestyles[0];212 lifestyles.RemoveAt(0);213 }214215 dynamic desktopImagesSectionJson = new216 {217 packshots = packshots,218 packshots_col = primaryLifestyleImage == null && secondaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",219 primaryLifestyleImage = primaryLifestyleImage,220 primaryLifestyleImage_col = packshots.Count == 0 && secondaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",221 secondaryLifestyleImage = secondaryLifestyleImage,222 secondaryLifestyleImage_col = packshots.Count == 0 && primaryLifestyleImage == null && lifestyles.Count == 0 ? "col-8" : "col-6",223 lifestyles = lifestyles,224 lifestyles_col = packshots.Count == 0 && primaryLifestyleImage == null && secondaryLifestyleImage == null ? "col-8" : "col-6"225 };226 }227228 @SnippetStart("OpenGraphProductSnippet")229 <meta property="og:image"230 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">231 <meta property="og:title" content="@espressoProduct.Name">232 <meta property="og:description" content="@espressoProduct.DescriptionShort">233 @SnippetEnd("OpenGraphProductSnippet")234235 @RenderingService.Instance.SectionEnd()236237 @if (espressoProduct.B2CActive == "No" && isUserAuthenticated == false)238 {239 }240 else241 {242 @SnippetStart("eComCanonical")@eComProductCanonical@SnippetEnd("eComCanonical")243244 <div class="e-product js-e-product" data-product-id="@espressoProduct.Id"245 data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()"246 data-variant-id="@espressoProduct.VariantId">247248 @RenderingService.Instance.SectionStart(new SectionSettings249 {250 Classes = new ClassList("e-section pb-2")251 })252 <div class="col-12">253 <img class="mb-2 text-muted" style="height: 28px;" src="@brandLogo"/>254 </div>255 <div class="col-12">256 <div class="row">257 <div class="col-12 col-md-8">258 <div class="d-block d-md-none">259 @RenderingService.Instance.PartialView("ecom/product/partials/images.cshtml", espressoProduct)260 </div>261 @RenderingService.Instance.PartialView("ecom/product/partials/image-section-desktop.cshtml", espressoProduct)262263 @if (isUserAuthenticated)264 {265 IEnumerable<CustomerProductList> userFavoriteLists = CustomerProductList.GetAllProductLists(PageView.Current().User.ID);266 string isInAnyList = userFavoriteLists.Any(fl => espressoProduct.IsInFavoriteList(fl.ID)) == true ? "isInAnyList" : "";267 <div class="bloomingville-addtolist-wrapper js-bloomingville-addtolist-wrapper @isInAnyList">268 <div class="dropdown js-e-productlist-favorite-list-container"269 data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId">270 <span class="dropdown-toggle" data-toggle="dropdown">271 <span class="bloomingville-productlist-addtolist label-favorite"></span>272 </span>273 <div class="dropdown-menu dropdown-menu-left pt-0">274 @RenderingService.Instance.PartialView("ecom/productlist/partials/add-to-favorites.cshtml", espressoProduct)275 </div>276 </div>277 </div>278 }279280 <div class="d-none d-md-block w-100 mt-4">281 <div class="col-12">282 <div class="p-accordion-container border-dark mb-2">283 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))284 {285 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">286 <div class="p-accordion-toggle">287 <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">288 <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>289 </p>290 </div>291 <div id="e-accordion-12574-185" class="fade collapse" style="">292 <div class="pb-4 pt-1 pr-2 p-accordion-content">293 <div class="p-txt-container small">294 @espressoProduct.DescriptionShort295 </div>296 </div>297 </div>298 </div>299 }300 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">301 <div class="p-accordion-toggle">302 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">303 <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>304 </p>305 </div>306 <div id="e-accordion-specifications" class="collapse fade">307 <div class="pb-4 pt-1 p-accordion-content">308 <div class="p-txt-container">309 <table class="table table-sm table-striped">310 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))311 {312 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")313 {314 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))315 {316 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value");317 string fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id");318 string fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name");319320 string fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;321322 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")323 {324 <tr>325 <th class="pl-2" style="width: 50%">326 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)327 </th>328 <td>329 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))330 {331 @GetString(getSalesTextCurrentLanguage)332 }333 else334 {335 @fieldLink336 }337 </td>338 </tr>339 }340 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")341 {342 @* Removes Sales Texts because they are manually handled right above here *@343 }344 else if (!string.IsNullOrEmpty(fieldValue))345 {346 <tr>347 <th class="pl-2" style="width: 50%">348 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)349 </th>350 <td>351 @fieldLink352 </td>353 </tr>354 }355 }356 }357 }358 </table>359 </div>360 </div>361 </div>362 </div>363 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">364 <div class="p-accordion-toggle">365 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">366 <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>367 </p>368 </div>369 <div id="e-accordion-images" class="collapse fade">370 <div class="pb-4 pt-1 p-accordion-content">371 <div class="p-txt-container">372 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)373 </div>374 </div>375 </div>376 </div>377 </div>378 </div>379 </div>380381 </div>382 <div class="col-12 col-md-4">383384 <p class="h4 mb-1">385 @espressoProduct.Number386 </p>387388 <h1 class="e-product-name mb-1 mt-0 h2">389 @espressoProduct.Name390 </h1>391392 @if (GetString("Ecom:Product:Field.Description2.Value.Clean") != "")393 {394 <p class="h4 mt-2 mb-2" style="text-transform: none">@GetString("Ecom:Product:Field.Description2.Value.Clean")</p>395 }396397 @if (isUserAuthenticated)398 {399 <p class="e-product-price h3 mb-2 mt-0">400 <span class="mr-1">401 @espressoProduct.Price.Format()402 </span>403 @if (espressoProduct.SuggestedRetailPrice.Value > espressoProduct.Price.Value)404 {405 <span class="text-muted" style="text-decoration: line-through;">406 @espressoProduct.SuggestedRetailPrice.Format()407 </span>408 }409 </p>410 }411412 <h4>@Translate("eCom Product - Vejl. udsalgspris - Text", "Vejl. udsalgspris")</h4>413 <p class="e-product-price mb-2 mt-0">414 @espressoProduct.WholesalePrice.Format()415 </p>416417 @if (variants != null && variants.Products.Any())418 {419 @RenderingService.Instance.PartialView("ecom/product/partials/relatedproducts-thumb-list.cshtml", variants)420 }421422423 @if (isUserAuthenticated)424 {425 <div class="small">426 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct)427 </div>428 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct)429 <br/>430 }431 else432 {433 @Espresso.Area.Item.EcommerceAlternativeCallToAction434 <p class="small pr-4">435 <span class="small">@Translate("eCom Product - We cannot garantee - Text", "*Vi kan ikke garantere, at hele sortimentet forefindes hos alle forhandlere.")</span>436 </p>437 }438439 @if (!string.IsNullOrEmpty(salesText))440 {441 <p class="mb-2">@salesText</p>442 }443444 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("fsc"))445 {446 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"447 data-toggle="collapse" href="#collapseFSC" role="button" aria-expanded="false"448 aria-controls="collapseFSC">449 @Translate("eCom Product - FSC Heading Default - Heading", "This product is FSC") <i450 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>451 </a>452453 <div class="collapse" id="collapseFSC">454 <p class="mt-1 mb-0">@Translate("eCom Product - FSC Text Default - Text", "This product is FSC® certified.")</p>455 <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>456 <p class="my-0">@Translate("eCom Product - FSC Text3 Default - Text", "Bloomingville is certified under certificate code") @espressoProduct.FSC.</p>457 </div>458 }459460 @if (!string.IsNullOrEmpty(customOekotex) && customOekotex.ToLower() == "yes")461 {462 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"463 data-toggle="collapse" href="#collapseOekoTex" role="button" aria-expanded="false"464 aria-controls="collapseOekotex">465 @Translate("eCom Product - OekoTex Heading Default - Heading", "This product is Oekotex") <i466 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>467 </a>468469 <div class="collapse" id="collapseOekoTex">470 <p class="mt-1 mb-0">@Translate("eCom Product - OekoTex Text Default - Text", "This is an Oekotex subline or text 1")</p>471 <p class="my-0">@Translate("eCom Product - OekoTex Text2 Default - Text", "This is an Oekotex text 2.")</p>472 <p class="my-0">@Translate("eCom Product - OekoTex Text3 Default - Text", "This is an Oekotex text 3.")</p>473 </div>474 }475476 @if (!string.IsNullOrEmpty(espressoProduct.Found) && espressoProduct.Found.ToLower() == "yes")477 {478 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"479 data-toggle="collapse" href="#collapseFound" role="button" aria-expanded="false"480 aria-controls="collapseFound">481 @Translate("eCom Product - Found Heading Default - Heading", "This product is Found") <i482 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>483 </a>484485 <div class="collapse" id="collapseFound">486 <p class="mt-1 mb-0">@Translate("eCom Product - Found Text Default - Text", "This is an Found subline or text 1")</p>487 <p class="my-0">@Translate("eCom Product - Found Text2 Default - Text", "This is an Found text 2.")</p>488 <p class="my-0">@Translate("eCom Product - Found Text3 Default - Text", "This is an Found text 3.")</p>489 </div>490 }491492 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled glass"))493 {494 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"495 data-toggle="collapse" href="#collapseRecycledGlass" role="button" aria-expanded="false"496 aria-controls="collapseRecycledGlass">497 @Translate("eCom Product - RecycledGlass Heading Default - Heading", "This product is RecycledGlass") <i498 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") <i514 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>515 </a>516517 <div class="collapse" id="collapseRecycledCotton">518 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledCotton Text Default - Text", "This is a RecycledCotton subline or text 1")</p>519 <p class="my-0">@Translate("eCom Product - RecycledCotton Text2 Default - Text", "This is a RecycledCotton text 2.")</p>520 <p class="my-0">@Translate("eCom Product - RecycledCotton Text3 Default - Text", "This is a RecycledCotton text 3.")</p>521 </div>522 }523524 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled wood"))525 {526 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"527 data-toggle="collapse" href="#collapseRecycledWood" role="button" aria-expanded="false"528 aria-controls="collapseRecycledWood">529 @Translate("eCom Product - RecycledWood Heading Default - Heading", "This product is RecycledWood") <i530 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>531 </a>532533 <div class="collapse" id="collapseRecycledWood">534 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledWood Text Default - Text", "This is a RecycledWood subline or text 1")</p>535 <p class="my-0">@Translate("eCom Product - RecycledWood Text2 Default - Text", "This is a RecycledWood text 2.")</p>536 <p class="my-0">@Translate("eCom Product - RecycledWood Text3 Default - Text", "This is a RecycledWood text 3.")</p>537 </div>538 }539540 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("reclaimed wood"))541 {542 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"543 data-toggle="collapse" href="#collapseReclaimedWood" role="button" aria-expanded="false"544 aria-controls="collapseReclaimedWood">545 @Translate("eCom Product - ReclaimedWood Heading Default - Heading", "This product is ReclaimedWood") <i546 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>547 </a>548549 <div class="collapse" id="collapseReclaimedWood">550 <p class="mt-1 mb-0">@Translate("eCom Product - ReclaimedWood Text Default - Text", "This is a ReclaimedWood subline or text 1")</p>551 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text2 Default - Text", "This is a ReclaimedWood text 2.")</p>552 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text3 Default - Text", "This is a ReclaimedWood text 3.")</p>553 </div>554 }555556 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("paper mache"))557 {558 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"559 data-toggle="collapse" href="#collapsePaperMache" role="button" aria-expanded="false"560 aria-controls="collapsePaperMache">561 @Translate("eCom Product - PaperMache Heading Default - Heading", "This product is PaperMache") <i562 class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>563 </a>564565 <div class="collapse" id="collapsePaperMache">566 <p class="mt-1 mb-0">@Translate("eCom Product - PaperMache Text Default - Text", "This is a PaperMache subline or text 1")</p>567 <p class="my-0">@Translate("eCom Product - PaperMache Text2 Default - Text", "This is a PaperMache text 2.")</p>568 <p class="my-0">@Translate("eCom Product - PaperMache Text3 Default - Text", "This is a PaperMache text 3.")</p>569 </div>570 }571572 @if (collection != null && collection.Products.Any())573 {574 @RenderingService.Instance.PartialView("ecom/product/partials/relatedproducts-thumb-list.cshtml", collection)575 }576577 </div>578 </div>579 </div>580 @RenderingService.Instance.SectionEnd()581582 @RenderingService.Instance.SectionStart(new SectionSettings583 {584 Classes = new ClassList("e-section pb-2 d-block d-md-none"),585 ContentClasses = new ClassList("col-12 is-lg col-md-7 col-lg-6 col-lg-8 col-xl-8 mr-auto is-lg"),586 Collapsible = false587 })588589 <div class="d-block w-100">590 <div class="col-12">591 <div class="p-accordion-container border-dark mb-2">592 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))593 {594 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">595 <div class="p-accordion-toggle">596 <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">597 <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>598 </p>599 </div>600 <div id="e-accordion-12574-185" class="fade collapse" style="">601 <div class="pb-4 pt-1 pr-2 p-accordion-content">602 <div class="p-txt-container small">603 @espressoProduct.DescriptionShort604 </div>605 </div>606 </div>607 </div>608 }609 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">610 <div class="p-accordion-toggle">611 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">612 <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>613 </p>614 </div>615 <div id="e-accordion-specifications" class="collapse fade">616 <div class="pb-4 pt-1 p-accordion-content">617 <div class="p-txt-container">618 <table class="table table-sm table-striped">619 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))620 {621 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")622 {623 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))624 {625 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value");626 string fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id");627 string fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name");628629 string fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;630631 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")632 {633 <tr>634 <th class="pl-2" style="width: 50%">635 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)636 </th>637 <td>638 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))639 {640 @GetString(getSalesTextCurrentLanguage)641 }642 else643 {644 @fieldLink645 }646 </td>647 </tr>648 }649 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")650 {651 @* Removes Sales Texts because they are manually handled right above here *@652 }653 else if (!string.IsNullOrEmpty(fieldValue))654 {655 <tr>656 <th class="pl-2" style="width: 50%">657 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)658 </th>659 <td>660 @fieldLink661 </td>662 </tr>663 }664 }665 }666 }667 </table>668 </div>669 </div>670 </div>671 </div>672 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">673 <div class="p-accordion-toggle">674 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">675 <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>676 </p>677 </div>678 <div id="e-accordion-images" class="collapse fade">679 <div class="pb-4 pt-1 p-accordion-content">680 <div class="p-txt-container">681 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)682 </div>683 </div>684 </div>685 </div>686 </div>687 </div>688 </div>689 @RenderingService.Instance.SectionEnd()690691692 @{693 List<string> productIds = new List<string>();694 if (Context.Cart != null && Context.Cart.OrderLines.Any())695 {696 OrderLineCollection orderLines = Context.Cart.OrderLines;697 productIds = orderLines.Select(ol => ol.ProductId).ToList();698 }699700 productIds.Add(espressoProduct.Id);701702 HandlebarsProductListTemplate handlebarsProductListTemplate = HandlebarsService.Instance.GetProductListTemplate(new HandlebarsProductListTemplateSettings()703 {704 Classes = new ClassList("e-productlist js-e-productlist js-e-require"),705 HeaderClasses = new ClassList("col-12 border-bottom"),706 MainClasses = new ClassList("col-12 js-clerk-content"),707 AsideClasses = new ClassList("col-12"),708 FooterClasses = new ClassList("col-12 col-lg-3 col-xl-3"),709 PageSize = string.IsNullOrEmpty(HttpContext.Current.Request["PageSize"]) ? GetInteger("Ecom:ProductList.PageSize").ToString() : HttpContext.Current.Request["PageSize"],710 PageNumber = string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]) ? GetInteger("Ecom:ProductList.CurrentPage").ToString() : HttpContext.Current.Request["PageNum"],711 SortBy = ProductListService.Instance.GetSortingParameterName(string.IsNullOrEmpty(HttpContext.Current.Request["SortBy"]) ? "" : HttpContext.Current.Request["SortBy"]),712 SortOrder = string.IsNullOrEmpty(HttpContext.Current.Request["SortOrder"]) ? GetString("Ecom:ProductList.SortOrder") : HttpContext.Current.Request["SortOrder"],713 ShowFilters = false,714 Heading = Espresso.Item.HeadingShow == "True" ? Espresso.Item.Name : string.Empty715 });716717 List<EspressoPagingPage> productListPaging = new List<EspressoPagingPage>();718 if (GetLoop("Ecom:ProductList.Pages").Count > 0)719 {720 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages"))721 {722 productListPaging.Add(new EspressoPagingPage()723 {724 Url = page.GetString("Ecom:ProductList.Pages.Page.Url"),725 Number = page.GetString("Ecom:ProductList.Pages.Page.Number")726 });727 }728 }729730731 EspressoProductList substituting = APIWrapper.Instance.IGetSubstitutingProducts(espressoProduct.Id, "SubstitutingProducts");732 if (substituting.Products.Any())733 {734 List<EspressoProduct> substitutingProducts = substituting.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();735 @RenderingService.Instance.SectionStart(new SectionSettings736 {737 Classes = new ClassList("e-section pb-2 bg-light")738 })739 <div class="e-productlist-header col-12">740 <p class="h1">@Translate("eCom Product - Related group - SubstitutingProducts - Heading", "Gode alternativer til dette")</p>741 </div>742 <div class="@handlebarsProductListTemplate.MainClasses">743 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(744 new ProductListSettings()745 {746 Products = substitutingProducts.Take(4).ToList(),747 Paging = productListPaging,748 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),749 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)750 }751 ))752 </div>753 @RenderingService.Instance.SectionEnd()754 }755756757 EspressoProductList complimentary = APIWrapper.Instance.IGetComplimentaryProducts(espressoProduct.Id, "ComplimentaryProducts");758 if (complimentary.Products.Any())759 {760 List<EspressoProduct> complimentaryProducts = complimentary.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();761 @RenderingService.Instance.SectionStart(new SectionSettings762 {763 Classes = new ClassList("e-section pb-2 bg-light")764 })765 <div class="e-productlist-header col-12">766 <p class="h1">@Translate("eCom Product - Related group - ComplimentaryProducts - Heading", "Andre kunder købte også")</p>767 </div>768 <div class="@handlebarsProductListTemplate.MainClasses">769 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(770 new ProductListSettings()771 {772 Products = complimentaryProducts.Take(4).ToList(),773 Paging = productListPaging,774 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),775 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)776 }777 ))778 </div>779 @RenderingService.Instance.SectionEnd()780 }781 }782783 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct)784 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct)785786 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)"787 data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)"></code>788789790 <script>791 e4.data.set('@espressoProduct.Id',792 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct))'));793794 e4.data.set('@(espressoProduct.Id)_desktop',795 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(desktopImagesSectionJson))'));796 </script>797798 </div>799 @RenderingService.Instance.SectionStart(new SectionSettings())800801 <script id="js-e-handlebars-tmpl-favorite-list" type="text/x-handlebars-template">802 {{#each lists as | list |}}803 <div class="dropdown-item">804 <label class="custom-checkbox custom-control m-0">805 <input type="checkbox" class="custom-control-input js-e-favorite-list"806 id="js-e-favorite-list-{{list.id}}" name="favorite-list-{{list.id}}"807 {{#if list.isInFavoriteList}}checked{{/if}} data-url-add="{{{list.addUrl}}}"808 data-url-remove="{{{list.removeUrl}}}">809 <span class="custom-control-indicator"></span>810 <span class="custom-control-description">{{list.name}}</span>811 </label>812 </div>813 {{/each}}814 </script>815 }