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_c1be44e917294ff38bcb805feb6932b8.Execute() in E:\Dynamicweb.NET\Solutions\bloomingville.espresso4.dk\Files\Templates\Designs\bloomingville\eCom\Product\espresso.cshtml:line 749at 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") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>450 </a>451452 <div class="collapse" id="collapseFSC">453 <p class="mt-1 mb-0">@Translate("eCom Product - FSC Text Default - Text", "This product is FSC® certified.")</p>454 <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>455 <p class="my-0">@Translate("eCom Product - FSC Text3 Default - Text", "Bloomingville is certified under certificate code") @espressoProduct.FSC.</p>456 </div>457 }458459 @if (!string.IsNullOrEmpty(customOekotex) && customOekotex.ToLower() == "yes")460 {461 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"462 data-toggle="collapse" href="#collapseOekoTex" role="button" aria-expanded="false"463 aria-controls="collapseOekotex">464 @Translate("eCom Product - OekoTex Heading Default - Heading", "This product is Oekotex") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>465 </a>466467 <div class="collapse" id="collapseOekoTex">468 <p class="mt-1 mb-0">@Translate("eCom Product - OekoTex Text Default - Text", "This is an Oekotex subline or text 1")</p>469 <p class="my-0">@Translate("eCom Product - OekoTex Text2 Default - Text", "This is an Oekotex text 2.")</p>470 <p class="my-0">@Translate("eCom Product - OekoTex Text3 Default - Text", "This is an Oekotex text 3.")</p>471 </div>472 }473474 @if (!string.IsNullOrEmpty(espressoProduct.Found) && espressoProduct.Found.ToLower() == "yes")475 {476 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"477 data-toggle="collapse" href="#collapseFound" role="button" aria-expanded="false"478 aria-controls="collapseFound">479 @Translate("eCom Product - Found Heading Default - Heading", "This product is Found") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>480 </a>481482 <div class="collapse" id="collapseFound">483 <p class="mt-1 mb-0">@Translate("eCom Product - Found Text Default - Text", "This is an Found subline or text 1")</p>484 <p class="my-0">@Translate("eCom Product - Found Text2 Default - Text", "This is an Found text 2.")</p>485 <p class="my-0">@Translate("eCom Product - Found Text3 Default - Text", "This is an Found text 3.")</p>486 </div>487 }488489 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled glass"))490 {491 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"492 data-toggle="collapse" href="#collapseRecycledGlass" role="button" aria-expanded="false"493 aria-controls="collapseRecycledGlass">494 @Translate("eCom Product - RecycledGlass Heading Default - Heading", "This product is RecycledGlass") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>495 </a>496497 <div class="collapse" id="collapseRecycledGlass">498 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledGlass Text Default - Text", "This is a RecycledGlass subline or text 1")</p>499 <p class="my-0">@Translate("eCom Product - RecycledGlass Text2 Default - Text", "This is a RecycledGlass text 2.")</p>500 <p class="my-0">@Translate("eCom Product - RecycledGlass Text3 Default - Text", "This is a RecycledGlass text 3.")</p>501 </div>502 }503504 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled cotton"))505 {506 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"507 data-toggle="collapse" href="#collapseRecycledCotton" role="button"508 aria-expanded="false" aria-controls="collapseRecycledCotton">509 @Translate("eCom Product - RecycledCotton Heading Default - Heading", "This product is RecycledCotton") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>510 </a>511512 <div class="collapse" id="collapseRecycledCotton">513 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledCotton Text Default - Text", "This is a RecycledCotton subline or text 1")</p>514 <p class="my-0">@Translate("eCom Product - RecycledCotton Text2 Default - Text", "This is a RecycledCotton text 2.")</p>515 <p class="my-0">@Translate("eCom Product - RecycledCotton Text3 Default - Text", "This is a RecycledCotton text 3.")</p>516 </div>517 }518519 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled wood"))520 {521 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"522 data-toggle="collapse" href="#collapseRecycledWood" role="button" aria-expanded="false"523 aria-controls="collapseRecycledWood">524 @Translate("eCom Product - RecycledWood Heading Default - Heading", "This product is RecycledWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>525 </a>526527 <div class="collapse" id="collapseRecycledWood">528 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledWood Text Default - Text", "This is a RecycledWood subline or text 1")</p>529 <p class="my-0">@Translate("eCom Product - RecycledWood Text2 Default - Text", "This is a RecycledWood text 2.")</p>530 <p class="my-0">@Translate("eCom Product - RecycledWood Text3 Default - Text", "This is a RecycledWood text 3.")</p>531 </div>532 }533534 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("reclaimed wood"))535 {536 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"537 data-toggle="collapse" href="#collapseReclaimedWood" role="button" aria-expanded="false"538 aria-controls="collapseReclaimedWood">539 @Translate("eCom Product - ReclaimedWood Heading Default - Heading", "This product is ReclaimedWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>540 </a>541542 <div class="collapse" id="collapseReclaimedWood">543 <p class="mt-1 mb-0">@Translate("eCom Product - ReclaimedWood Text Default - Text", "This is a ReclaimedWood subline or text 1")</p>544 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text2 Default - Text", "This is a ReclaimedWood text 2.")</p>545 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text3 Default - Text", "This is a ReclaimedWood text 3.")</p>546 </div>547 }548549 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("paper mache"))550 {551 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed"552 data-toggle="collapse" href="#collapsePaperMache" role="button" aria-expanded="false"553 aria-controls="collapsePaperMache">554 @Translate("eCom Product - PaperMache Heading Default - Heading", "This product is PaperMache") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>555 </a>556557 <div class="collapse" id="collapsePaperMache">558 <p class="mt-1 mb-0">@Translate("eCom Product - PaperMache Text Default - Text", "This is a PaperMache subline or text 1")</p>559 <p class="my-0">@Translate("eCom Product - PaperMache Text2 Default - Text", "This is a PaperMache text 2.")</p>560 <p class="my-0">@Translate("eCom Product - PaperMache Text3 Default - Text", "This is a PaperMache text 3.")</p>561 </div>562 }563564 @if (collection != null && collection.Products.Any())565 {566 @RenderingService.Instance.PartialView("ecom/product/partials/relatedproducts-thumb-list.cshtml", collection)567 }568569 </div>570 </div>571 </div>572 @RenderingService.Instance.SectionEnd()573574 @RenderingService.Instance.SectionStart(new SectionSettings575 {576 Classes = new ClassList("e-section pb-2 d-block d-md-none"),577 ContentClasses = new ClassList("col-12 is-lg col-md-7 col-lg-6 col-lg-8 col-xl-8 mr-auto is-lg"),578 Collapsible = false579 })580581 <div class="d-block w-100">582 <div class="col-12">583 <div class="p-accordion-container border-dark mb-2">584 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))585 {586 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">587 <div class="p-accordion-toggle">588 <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">589 <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>590 </p>591 </div>592 <div id="e-accordion-12574-185" class="fade collapse" style="">593 <div class="pb-4 pt-1 pr-2 p-accordion-content">594 <div class="p-txt-container small">595 @espressoProduct.DescriptionShort596 </div>597 </div>598 </div>599 </div>600 }601 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">602 <div class="p-accordion-toggle">603 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">604 <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>605 </p>606 </div>607 <div id="e-accordion-specifications" class="collapse fade">608 <div class="pb-4 pt-1 p-accordion-content">609 <div class="p-txt-container">610 <table class="table table-sm table-striped">611 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))612 {613 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")614 {615 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))616 {617 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value");618 string fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id");619 string fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name");620621 string fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;622623 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")624 {625 <tr>626 <th class="pl-2" style="width: 50%">627 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)628 </th>629 <td>630 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))631 {632 @GetString(getSalesTextCurrentLanguage)633 }634 else635 {636 @fieldLink637 }638 </td>639 </tr>640 }641 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")642 {643 @* Removes Sales Texts because they are manually handled right above here *@644 }645 else if (!string.IsNullOrEmpty(fieldValue))646 {647 <tr>648 <th class="pl-2" style="width: 50%">649 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)650 </th>651 <td>652 @fieldLink653 </td>654 </tr>655 }656 }657 }658 }659 </table>660 </div>661 </div>662 </div>663 </div>664 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">665 <div class="p-accordion-toggle">666 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">667 <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>668 </p>669 </div>670 <div id="e-accordion-images" class="collapse fade">671 <div class="pb-4 pt-1 p-accordion-content">672 <div class="p-txt-container">673 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)674 </div>675 </div>676 </div>677 </div>678 </div>679 </div>680 </div>681 @RenderingService.Instance.SectionEnd()682683684 @{685 List<string> productIds = new List<string>();686 if (Context.Cart != null && Context.Cart.OrderLines.Any())687 {688 OrderLineCollection orderLines = Context.Cart.OrderLines;689 productIds = orderLines.Select(ol => ol.ProductId).ToList();690 }691692 productIds.Add(espressoProduct.Id);693694 HandlebarsProductListTemplate handlebarsProductListTemplate = HandlebarsService.Instance.GetProductListTemplate(new HandlebarsProductListTemplateSettings()695 {696 Classes = new ClassList("e-productlist js-e-productlist js-e-require"),697 HeaderClasses = new ClassList("col-12 border-bottom"),698 MainClasses = new ClassList("col-12 js-clerk-content"),699 AsideClasses = new ClassList("col-12"),700 FooterClasses = new ClassList("col-12 col-lg-3 col-xl-3"),701 PageSize = string.IsNullOrEmpty(HttpContext.Current.Request["PageSize"]) ? GetInteger("Ecom:ProductList.PageSize").ToString() : HttpContext.Current.Request["PageSize"],702 PageNumber = string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]) ? GetInteger("Ecom:ProductList.CurrentPage").ToString() : HttpContext.Current.Request["PageNum"],703 SortBy = ProductListService.Instance.GetSortingParameterName(string.IsNullOrEmpty(HttpContext.Current.Request["SortBy"]) ? "" : HttpContext.Current.Request["SortBy"]),704 SortOrder = string.IsNullOrEmpty(HttpContext.Current.Request["SortOrder"]) ? GetString("Ecom:ProductList.SortOrder") : HttpContext.Current.Request["SortOrder"],705 ShowFilters = false,706 Heading = Espresso.Item.HeadingShow == "True" ? Espresso.Item.Name : string.Empty707 });708709 List<EspressoPagingPage> productListPaging = new List<EspressoPagingPage>();710 if (GetLoop("Ecom:ProductList.Pages").Count > 0)711 {712 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages"))713 {714 productListPaging.Add(new EspressoPagingPage()715 {716 Url = page.GetString("Ecom:ProductList.Pages.Page.Url"),717 Number = page.GetString("Ecom:ProductList.Pages.Page.Number")718 });719 }720 }721722723 EspressoProductList substituting = APIWrapper.Instance.IGetSubstitutingProducts(espressoProduct.Id, "SubstitutingProducts");724 if (substituting.Products.Any())725 {726 List<EspressoProduct> substitutingProducts = substituting.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();727 @RenderingService.Instance.SectionStart(new SectionSettings728 {729 Classes = new ClassList("e-section pb-2 bg-light")730 })731 <div class="e-productlist-header col-12">732 <p class="h1">@Translate("eCom Product - Related group - SubstitutingProducts - Heading", "Gode alternativer til dette")</p>733 </div>734 <div class="@handlebarsProductListTemplate.MainClasses">735 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(736 new ProductListSettings()737 {738 Products = substitutingProducts.Take(4).ToList(),739 Paging = productListPaging,740 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),741 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)742 }743 ))744 </div>745 @RenderingService.Instance.SectionEnd()746 }747748749 EspressoProductList complimentary = APIWrapper.Instance.IGetComplimentaryProducts(espressoProduct.Id, "ComplimentaryProducts");750 if (complimentary.Products.Any())751 {752 List<EspressoProduct> complimentaryProducts = complimentary.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();753 @RenderingService.Instance.SectionStart(new SectionSettings754 {755 Classes = new ClassList("e-section pb-2 bg-light")756 })757 <div class="e-productlist-header col-12">758 <p class="h1">@Translate("eCom Product - Related group - ComplimentaryProducts - Heading", "Andre kunder købte også")</p>759 </div>760 <div class="@handlebarsProductListTemplate.MainClasses">761 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(762 new ProductListSettings()763 {764 Products = complimentaryProducts.Take(4).ToList(),765 Paging = productListPaging,766 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),767 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)768 }769 ))770 </div>771 @RenderingService.Instance.SectionEnd()772 }773 }774775 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct)776 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct)777778 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)"779 data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)"></code>780781782 <script>783 e4.data.set('@espressoProduct.Id',784 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct))'));785786 e4.data.set('@(espressoProduct.Id)_desktop',787 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(desktopImagesSectionJson))'));788 </script>789790 </div>791 @RenderingService.Instance.SectionStart(new SectionSettings())792793 <script id="js-e-handlebars-tmpl-favorite-list" type="text/x-handlebars-template">794 {{#each lists as | list |}}795 <div class="dropdown-item">796 <label class="custom-checkbox custom-control m-0">797 <input type="checkbox" class="custom-control-input js-e-favorite-list"798 id="js-e-favorite-list-{{list.id}}" name="favorite-list-{{list.id}}"799 {{#if list.isInFavoriteList}}checked{{/if}} data-url-add="{{{list.addUrl}}}"800 data-url-remove="{{{list.removeUrl}}}">801 <span class="custom-control-indicator"></span>802 <span class="custom-control-description">{{list.name}}</span>803 </label>804 </div>805 {{/each}}806 </script>807 }