Error executing template "Designs/bloomingville/eCom/Product/espresso.cshtml"Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.at Newtonsoft.Json.JsonTextReader.ParseValue()at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)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 0at Co3.Espresso4.Addons.ClerkIOIntegration.ClerkIOAPI.APIWrapper.IGetSubstitutingProducts(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 203at CompiledRazorTemplates.Dynamic.RazorEngine_ff11fddc08b94786a4a683cbf3368df4.Execute() in E:\Dynamicweb.NET\Solutions\bloomingville.espresso4.dk\Files\Templates\Designs\bloomingville\eCom\Product\espresso.cshtml:line 551at 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 }187188 @SnippetStart("OpenGraphProductSnippet")189 <meta property="og:image" 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">190 <meta property="og:title" content="@espressoProduct.Name">191 <meta property="og:description" content="@espressoProduct.DescriptionShort">192 @SnippetEnd("OpenGraphProductSnippet")193194 @RenderingService.Instance.SectionEnd()195196 @if (espressoProduct.B2CActive == "No" && isUserAuthenticated == false)197 {198 }199 else200 {201 @SnippetStart("eComCanonical")@eComProductCanonical@SnippetEnd("eComCanonical")202 <div class="e-product js-e-product" data-product-id="@espressoProduct.Id" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-variant-id="@espressoProduct.VariantId">203204 @RenderingService.Instance.SectionStart(new SectionSettings205 {206 Classes = new ClassList("e-section pb-2")207 })208 <div class="col-12">209 <div class="row">210 <div class="col-12 col-md-4 col-lg-3 offset-md-1 pb-4">211 <div class="e-product-text-container">212213 <img class="my-4 text-muted brand-logo" style="height: 28px;" src="@brandLogo"/>214215 <p class="h4 mb-1">216 @espressoProduct.Number217 </p>218219 <h1 class="e-product-name mb-1 mt-0 h2">220 @espressoProduct.Name221 </h1>222223224 @if (isUserAuthenticated)225 {226 <p class="e-product-price h3 mb-2 mt-0">227 <span class="mr-1">228 @espressoProduct.Price.Format()229 </span>230 @if (espressoProduct.SuggestedRetailPrice.Value > espressoProduct.Price.Value)231 {232 <span class="text-muted" style="text-decoration: line-through;">233 @espressoProduct.SuggestedRetailPrice.Format()234 </span>235 }236 </p>237 }238239240 @if (!string.IsNullOrEmpty(salesText))241 {242 <p class="mb-1">@salesText</p>243 }244245 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("fsc"))246 {247 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseFSC" role="button" aria-expanded="false" aria-controls="collapseFSC">248 @Translate("eCom Product - FSC Heading Default - Heading", "This product is FSC") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>249 </a>250251 <div class="collapse" id="collapseFSC">252 <p class="mt-1 mb-0">@Translate("eCom Product - FSC Text Default - Text", "This product is FSC® certified.")</p>253 <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>254 <p class="my-0">@Translate("eCom Product - FSC Text3 Default - Text", "Bloomingville is certified under certificate code") @espressoProduct.FSC.</p>255 </div>256 }257258 @if (!string.IsNullOrEmpty(customOekotex) && customOekotex.ToLower() == "yes")259 {260 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseOekoTex" role="button" aria-expanded="false" aria-controls="collapseOekotex">261 @Translate("eCom Product - OekoTex Heading Default - Heading", "This product is Oekotex") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>262 </a>263264 <div class="collapse" id="collapseOekoTex">265 <p class="mt-1 mb-0">@Translate("eCom Product - OekoTex Text Default - Text", "This is an Oekotex subline or text 1")</p>266 <p class="my-0">@Translate("eCom Product - OekoTex Text2 Default - Text", "This is an Oekotex text 2.")</p>267 <p class="my-0">@Translate("eCom Product - OekoTex Text3 Default - Text", "This is an Oekotex text 3.")</p>268 </div>269 }270271 @if (!string.IsNullOrEmpty(espressoProduct.Found) && espressoProduct.Found.ToLower() == "yes")272 {273 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseFound" role="button" aria-expanded="false" aria-controls="collapseFound">274 @Translate("eCom Product - Found Heading Default - Heading", "This product is Found") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>275 </a>276277 <div class="collapse" id="collapseFound">278 <p class="mt-1 mb-0">@Translate("eCom Product - Found Text Default - Text", "This is an Found subline or text 1")</p>279 <p class="my-0">@Translate("eCom Product - Found Text2 Default - Text", "This is an Found text 2.")</p>280 <p class="my-0">@Translate("eCom Product - Found Text3 Default - Text", "This is an Found text 3.")</p>281 </div>282 }283284 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled glass"))285 {286 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseRecycledGlass" role="button" aria-expanded="false" aria-controls="collapseRecycledGlass">287 @Translate("eCom Product - RecycledGlass Heading Default - Heading", "This product is RecycledGlass") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>288 </a>289290 <div class="collapse" id="collapseRecycledGlass">291 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledGlass Text Default - Text", "This is a RecycledGlass subline or text 1")</p>292 <p class="my-0">@Translate("eCom Product - RecycledGlass Text2 Default - Text", "This is a RecycledGlass text 2.")</p>293 <p class="my-0">@Translate("eCom Product - RecycledGlass Text3 Default - Text", "This is a RecycledGlass text 3.")</p>294 </div>295 }296297 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled cotton"))298 {299 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseRecycledCotton" role="button" aria-expanded="false" aria-controls="collapseRecycledCotton">300 @Translate("eCom Product - RecycledCotton Heading Default - Heading", "This product is RecycledCotton") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>301 </a>302303 <div class="collapse" id="collapseRecycledCotton">304 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledCotton Text Default - Text", "This is a RecycledCotton subline or text 1")</p>305 <p class="my-0">@Translate("eCom Product - RecycledCotton Text2 Default - Text", "This is a RecycledCotton text 2.")</p>306 <p class="my-0">@Translate("eCom Product - RecycledCotton Text3 Default - Text", "This is a RecycledCotton text 3.")</p>307 </div>308 }309310 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled wood"))311 {312 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseRecycledWood" role="button" aria-expanded="false" aria-controls="collapseRecycledWood">313 @Translate("eCom Product - RecycledWood Heading Default - Heading", "This product is RecycledWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>314 </a>315316 <div class="collapse" id="collapseRecycledWood">317 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledWood Text Default - Text", "This is a RecycledWood subline or text 1")</p>318 <p class="my-0">@Translate("eCom Product - RecycledWood Text2 Default - Text", "This is a RecycledWood text 2.")</p>319 <p class="my-0">@Translate("eCom Product - RecycledWood Text3 Default - Text", "This is a RecycledWood text 3.")</p>320 </div>321 }322323 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("reclaimed wood"))324 {325 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapseReclaimedWood" role="button" aria-expanded="false" aria-controls="collapseReclaimedWood">326 @Translate("eCom Product - ReclaimedWood Heading Default - Heading", "This product is ReclaimedWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>327 </a>328329 <div class="collapse" id="collapseReclaimedWood">330 <p class="mt-1 mb-0">@Translate("eCom Product - ReclaimedWood Text Default - Text", "This is a ReclaimedWood subline or text 1")</p>331 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text2 Default - Text", "This is a ReclaimedWood text 2.")</p>332 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text3 Default - Text", "This is a ReclaimedWood text 3.")</p>333 </div>334 }335336 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("paper mache"))337 {338 <a class="mb-0 mt-1 text-decoration-none d-flex align-items-center bv-custom-collapse collapsed" data-toggle="collapse" href="#collapsePaperMache" role="button" aria-expanded="false" aria-controls="collapsePaperMache">339 @Translate("eCom Product - PaperMache Heading Default - Heading", "This product is PaperMache") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>340 </a>341342 <div class="collapse" id="collapsePaperMache">343 <p class="mt-1 mb-0">@Translate("eCom Product - PaperMache Text Default - Text", "This is a PaperMache subline or text 1")</p>344 <p class="my-0">@Translate("eCom Product - PaperMache Text2 Default - Text", "This is a PaperMache text 2.")</p>345 <p class="my-0">@Translate("eCom Product - PaperMache Text3 Default - Text", "This is a PaperMache text 3.")</p>346 </div>347 }348349 @if (GetString("Ecom:Product:Field.Description2.Value.Clean") != "")350 {351 <p class="h4 mt-2 mb-2" style="text-transform: none">@GetString("Ecom:Product:Field.Description2.Value.Clean")</p>352 }353354355 <h4>@Translate("eCom Product - Vejl. udsalgspris - Text", "Vejl. udsalgspris")</h4>356 <p class="e-product-price mb-2 mt-0">357 @espressoProduct.WholesalePrice.Format()358 </p>359360 @if (isUserAuthenticated)361 {362 <div class="small">363 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct)364 </div>365 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct)366 <br/>367 }368 else369 {370 @Espresso.Area.Item.EcommerceAlternativeCallToAction371 <p class="small pr-4">372 <span class="small">@Translate("eCom Product - We cannot garantee - Text", "*Vi kan ikke garantere, at hele sortimentet forefindes hos alle forhandlere.")</span>373 </p>374 }375376 </div>377 </div>378 <div class="col-12 col-md-7 col-lg-8 order-first">379380 @RenderingService.Instance.PartialView("ecom/product/partials/images.cshtml", espressoProduct)381 @if (isUserAuthenticated)382 {383 IEnumerable<CustomerProductList> userFavoriteLists = CustomerProductList.GetAllProductLists(PageView.Current().User.ID);384 string isInAnyList = userFavoriteLists.Any(fl => espressoProduct.IsInFavoriteList(fl.ID)) == true ? "isInAnyList" : "";385 <div class="bloomingville-addtolist-wrapper js-bloomingville-addtolist-wrapper @isInAnyList">386 <div class="dropdown js-e-productlist-favorite-list-container" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId">387 <span class="dropdown-toggle" data-toggle="dropdown">388 <span class="bloomingville-productlist-addtolist label-favorite"></span>389 </span>390 <div class="dropdown-menu dropdown-menu-left pt-0">391 @RenderingService.Instance.PartialView("ecom/productlist/partials/add-to-favorites.cshtml", espressoProduct)392 </div>393 </div>394 </div>395 }396397 </div>398 </div>399 </div>400 @RenderingService.Instance.SectionEnd()401402403 @RenderingService.Instance.SectionStart(new SectionSettings404 {405 Classes = new ClassList("e-section pb-2"),406 ContentClasses = new ClassList("col-12 is-lg col-md-7 col-lg-6 col-lg-8 col-xl-8 mr-auto is-lg"),407 Collapsible = false408 })409 <div class="col-12">410 <div class="p-accordion-container border-dark mb-2">411 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))412 {413 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">414 <div class="p-accordion-toggle">415 <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">416 <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>417 </p>418 </div>419 <div id="e-accordion-12574-185" class="fade collapse" style="">420 <div class="pb-4 pt-1 pr-2 p-accordion-content">421 <div class="p-txt-container small">422 @espressoProduct.DescriptionShort423 </div>424 </div>425 </div>426 </div>427 }428 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">429 <div class="p-accordion-toggle">430 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">431 <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>432 </p>433 </div>434 <div id="e-accordion-specifications" class="collapse fade">435 <div class="pb-4 pt-1 p-accordion-content">436 <div class="p-txt-container">437 <table class="table table-sm table-striped">438 @{439 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName;440 string getSalesTextCurrentLanguage = string.Format("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText{0}.Value", globalAreaLang.ToUpper());441 }442443 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))444 {445 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")446 {447 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))448 {449 string fieldValue = field.GetString("Ecom:FieldDisplayGroup.Field.Value"),450 fieldId = field.GetString("Ecom:FieldDisplayGroup.Field.Id"),451 fieldName = field.GetString("Ecom:FieldDisplayGroup.Field.Name"),452 fieldLink = fieldValue.Contains("http") ? "<a href='" + fieldValue + "' target='_blank'>" + fieldValue + "</a>" : fieldValue;453454 if (fieldId == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")455 {456 <tr>457 <th class="pl-2" style="width: 50%">458 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)459 </th>460 <td>461 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))462 {463 @GetString(getSalesTextCurrentLanguage)464 }465 else466 {467 @fieldLink468 }469 </td>470 </tr>471 }472 else if (fieldId.Contains("SalesText") && globalAreaLang != "en")473 {474 @* Removes Sales Texts because they are manually handled right above here *@475 }476 else if (!string.IsNullOrEmpty(fieldValue))477 {478 <tr>479 <th class="pl-2" style="width: 50%">480 @Translate(string.Format("eCom Product - Specifications - {0} - Label", fieldId), fieldName)481 </th>482 <td>483 @fieldLink484 </td>485 </tr>486 }487 }488 }489 }490 </table>491 </div>492 </div>493 </div>494 </div>495 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">496 <div class="p-accordion-toggle">497 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">498 <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>499 </p>500 </div>501 <div id="e-accordion-images" class="collapse fade">502 <div class="pb-4 pt-1 p-accordion-content">503 <div class="p-txt-container">504 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)505 </div>506 </div>507 </div>508 </div>509 </div>510 </div>511 @RenderingService.Instance.SectionEnd()512513 @{514 List<string> productIds = new List<string>();515 if (Context.Cart != null && Context.Cart.OrderLines.Any())516 {517 OrderLineCollection orderLines = Context.Cart.OrderLines;518 productIds = orderLines.Select(ol => ol.ProductId).ToList();519 }520 productIds.Add(espressoProduct.Id);521522 HandlebarsProductListTemplate handlebarsProductListTemplate = HandlebarsService.Instance.GetProductListTemplate(new HandlebarsProductListTemplateSettings()523 {524 Classes = new ClassList("e-productlist js-e-productlist js-e-require"),525 HeaderClasses = new ClassList("col-12 border-bottom"),526 MainClasses = new ClassList("col-12 js-clerk-content"),527 AsideClasses = new ClassList("col-12"),528 FooterClasses = new ClassList("col-12 col-lg-3 col-xl-3"),529 PageSize = string.IsNullOrEmpty(HttpContext.Current.Request["PageSize"]) ? GetInteger("Ecom:ProductList.PageSize").ToString() : HttpContext.Current.Request["PageSize"],530 PageNumber = string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]) ? GetInteger("Ecom:ProductList.CurrentPage").ToString() : HttpContext.Current.Request["PageNum"],531 SortBy = ProductListService.Instance.GetSortingParameterName(string.IsNullOrEmpty(HttpContext.Current.Request["SortBy"]) ? "" : HttpContext.Current.Request["SortBy"]),532 SortOrder = string.IsNullOrEmpty(HttpContext.Current.Request["SortOrder"]) ? GetString("Ecom:ProductList.SortOrder") : HttpContext.Current.Request["SortOrder"],533 ShowFilters = false,534 Heading = Espresso.Item.HeadingShow == "True" ? Espresso.Item.Name : string.Empty535 });536537 List<EspressoPagingPage> productListPaging = new List<EspressoPagingPage>();538 if (GetLoop("Ecom:ProductList.Pages").Count > 0)539 {540 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages"))541 {542 productListPaging.Add(new EspressoPagingPage()543 {544 Url = page.GetString("Ecom:ProductList.Pages.Page.Url"),545 Number = page.GetString("Ecom:ProductList.Pages.Page.Number")546 });547 }548 }549550551 EspressoProductList substituting = APIWrapper.Instance.IGetSubstitutingProducts(espressoProduct.Id, "SubstitutingProducts");552 if (substituting.Products.Any())553 {554 List<EspressoProduct> substitutingProducts = substituting.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();555 @RenderingService.Instance.SectionStart(new SectionSettings556 {557 Classes = new ClassList("e-section pb-2 bg-light")558 })559 <div class="e-productlist-header col-12">560 <p class="h1">@Translate("eCom Product - Related group - SubstitutingProducts - Heading", "Gode alternativer til dette")</p>561 </div>562 <div class="@handlebarsProductListTemplate.MainClasses">563 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(564 new ProductListSettings()565 {566 Products = substitutingProducts.Take(4).ToList(),567 Paging = productListPaging,568 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),569 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)570 }571 ))572 </div>573 @RenderingService.Instance.SectionEnd()574 }575576577 EspressoProductList complimentary = APIWrapper.Instance.IGetComplimentaryProducts(espressoProduct.Id, "ComplimentaryProducts");578 if (complimentary.Products.Any())579 {580 List<EspressoProduct> complimentaryProducts = complimentary.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();581 @RenderingService.Instance.SectionStart(new SectionSettings582 {583 Classes = new ClassList("e-section pb-2 bg-light")584 })585 <div class="e-productlist-header col-12">586 <p class="h1">@Translate("eCom Product - Related group - ComplimentaryProducts - Heading", "Andre kunder købte også")</p>587 </div>588 <div class="@handlebarsProductListTemplate.MainClasses">589 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(590 new ProductListSettings()591 {592 Products = complimentaryProducts.Take(4).ToList(),593 Paging = productListPaging,594 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),595 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)596 }597 ))598 </div>599 @RenderingService.Instance.SectionEnd()600 }601 }602603 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct)604 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct)605606 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)" data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)"></code>607608609 <script>610 e4.data.set('@espressoProduct.Id',611 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct))'))612 </script>613614 </div>615 @RenderingService.Instance.SectionStart(new SectionSettings())616617 <script id="js-e-handlebars-tmpl-favorite-list" type="text/x-handlebars-template">618 {{#each lists as | list |}}619 <div class="dropdown-item">620 <label class="custom-checkbox custom-control m-0">621 <input type="checkbox" class="custom-control-input js-e-favorite-list" id="js-e-favorite-list-{{list.id}}" name="favorite-list-{{list.id}}" {{#if list.isInFavoriteList}}checked{{/if}} data-url-add="{{{list.addUrl}}}" data-url-remove="{{{list.removeUrl}}}">622 <span class="custom-control-indicator"></span>623 <span class="custom-control-description">{{list.name}}</span>624 </label>625 </div>626 {{/each}}627 </script>628 }
keyboard_arrow_up