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_f031f0592a9f44968611e9533484a444.Execute() in E:\Dynamicweb.NET\Solutions\bloomingville.espresso4.dk\Files\Templates\Designs\bloomingville\eCom\Product\espresso.cshtml:line 533at 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 else102 {103 brandLogo = "/Files/Templates/Designs/bloomingville/_assets/img/logo.svg";104 brandPersonName = Espresso.Area.Item.Bloomingville_Name;105 brandPersonTitle = Espresso.Area.Item.Bloomingville_Title;106 brandPersonImage = Espresso.Area.Item.Bloomingville_Image;107 brandPersonText = Espresso.Area.Item.Bloomingville_Text;108 brandPersonHeading = Espresso.Area.Item.Bloomingville_Heading;109110 if (string.IsNullOrEmpty(espressoProduct.ImageLifeStyle.Large) == true)111 {112 imageLifeStyle = Espresso.Area.Item.Bloomingville_Image_LifeStyle_Alternative;113 }114 }115116 // Canonical117118 string eComProductCanonical = string.Empty;119120 string globalValueUrl = GetGlobalValue("Global:Pageview.Url");121122 if (GetGlobalValue("Global:Pageview.Url").IndexOf("?") > -1)123 {124 globalValueUrl = GetGlobalValue("Global:Pageview.Url").Substring(0, GetGlobalValue("Global:Pageview.Url").IndexOf("?"));125 }126127 if (string.IsNullOrEmpty(GetString("Ecom:Product.Canonical")) == false)128 {129 eComProductCanonical = String.Format("{0}{1}", baseUrl, GetString("Ecom:Product.Canonical"));130 }131 else132 {133 eComProductCanonical = String.Format("{0}{1}", baseUrl, globalValueUrl);134 }135136 // SALESTEXT137138 string langCulture = PageView.Current().Area.CultureInfo.Name;139140 string salesText = "";141 // string salesTextDefault = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText.Value.Clean");142 string salesTextDefault = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText.Value.Clean");143 string salesTextDA = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextDA.Value.Clean");144 string salesTextDE = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextDE.Value.Clean");145 string salesTextFR = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.SalesTextFR.Value.Clean");146147148 if (langCulture.Contains("da"))149 {150 salesText = !string.IsNullOrEmpty(salesTextDA) ? salesTextDA : salesTextDefault;151 }152153 else if (langCulture.Contains("de"))154 {155 salesText = !string.IsNullOrEmpty(salesTextDE) ? salesTextDE : salesTextDefault;156 }157158 else if (langCulture.Contains("fr"))159 {160 salesText = !string.IsNullOrEmpty(salesTextFR) ? salesTextFR : salesTextDefault;161 }162 else163 {164 salesText = salesTextDefault;165 }166167 // MAIN MATERIAL168169 string mainMaterial = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.MainMaterial.Value.Clean");170 string customOekotex = GetString("Ecom:Product.CategoryField.ImportedCategoryFields.STANDARD100byOEKOTEX.Value.Clean");171172 }173174 @SnippetStart("OpenGraphProductSnippet")175 <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">176 <meta property="og:title" content="@espressoProduct.Name">177 <meta property="og:description" content="@espressoProduct.DescriptionShort">178 @SnippetEnd("OpenGraphProductSnippet")179180 @RenderingService.Instance.SectionEnd()181182 @if (espressoProduct.B2CActive == "No" && isUserAuthenticated == false)183 {184 }185 else186 {187 @SnippetStart("eComCanonical")@eComProductCanonical@SnippetEnd("eComCanonical")188 <div class="e-product js-e-product" data-product-id="@espressoProduct.Id" data-has-variants="@espressoProduct.HasVariants.ToString().ToLower()" data-variant-id="@espressoProduct.VariantId">189190 @RenderingService.Instance.SectionStart(new SectionSettings191 {192 Classes = new ClassList("e-section pb-2")193 })194 <div class="col-12">195 <div class="row">196 <div class="col-12 col-md-4 col-lg-3 offset-md-1 pb-4">197 <div class="e-product-text-container">198199 <img class="my-4 text-muted brand-logo" style="height: 28px;" src="@brandLogo"/>200201 <p class="h4 mb-1">202 @espressoProduct.Number203 </p>204205 <h1 class="e-product-name mb-1 mt-0 h2">206 @espressoProduct.Name207 </h1>208209210 @if (isUserAuthenticated)211 {212 <p class="e-product-price h3 mb-2 mt-0">213 <span class="mr-1">214 @espressoProduct.Price.Format()215 </span>216 @if (espressoProduct.SuggestedRetailPrice.Value > espressoProduct.Price.Value)217 {218 <span class="text-muted" style="text-decoration: line-through;">219 @espressoProduct.SuggestedRetailPrice.Format()220 </span>221 }222 </p>223 }224225226 @if (!string.IsNullOrEmpty(salesText))227 {228 <p class="mb-1">@salesText</p>229 }230231 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("fsc"))232 {233 <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">234 @Translate("eCom Product - FSC Heading Default - Heading", "This product is FSC") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>235 </a>236237 <div class="collapse" id="collapseFSC">238 <p class="mt-1 mb-0">@Translate("eCom Product - FSC Text Default - Text", "This product is FSC® certified.")</p>239 <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>240 <p class="my-0">@Translate("eCom Product - FSC Text3 Default - Text", "Bloomingville is certified under certificate code") @espressoProduct.FSC.</p>241 </div>242 }243244 @if (!string.IsNullOrEmpty(customOekotex) && customOekotex.ToLower() == "yes")245 {246 <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">247 @Translate("eCom Product - OekoTex Heading Default - Heading", "This product is Oekotex") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>248 </a>249250 <div class="collapse" id="collapseOekoTex">251 <p class="mt-1 mb-0">@Translate("eCom Product - OekoTex Text Default - Text", "This is an Oekotex subline or text 1")</p>252 <p class="my-0">@Translate("eCom Product - OekoTex Text2 Default - Text", "This is an Oekotex text 2.")</p>253 <p class="my-0">@Translate("eCom Product - OekoTex Text3 Default - Text", "This is an Oekotex text 3.")</p>254 </div>255 }256257 @if (!string.IsNullOrEmpty(espressoProduct.Found) && espressoProduct.Found.ToLower() == "yes")258 {259 <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">260 @Translate("eCom Product - Found Heading Default - Heading", "This product is Found") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>261 </a>262263 <div class="collapse" id="collapseFound">264 <p class="mt-1 mb-0">@Translate("eCom Product - Found Text Default - Text", "This is an Found subline or text 1")</p>265 <p class="my-0">@Translate("eCom Product - Found Text2 Default - Text", "This is an Found text 2.")</p>266 <p class="my-0">@Translate("eCom Product - Found Text3 Default - Text", "This is an Found text 3.")</p>267 </div>268 }269270 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled glass"))271 {272 <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">273 @Translate("eCom Product - RecycledGlass Heading Default - Heading", "This product is RecycledGlass") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>274 </a>275276 <div class="collapse" id="collapseRecycledGlass">277 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledGlass Text Default - Text", "This is a RecycledGlass subline or text 1")</p>278 <p class="my-0">@Translate("eCom Product - RecycledGlass Text2 Default - Text", "This is a RecycledGlass text 2.")</p>279 <p class="my-0">@Translate("eCom Product - RecycledGlass Text3 Default - Text", "This is a RecycledGlass text 3.")</p>280 </div>281 }282283 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled cotton"))284 {285 <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">286 @Translate("eCom Product - RecycledCotton Heading Default - Heading", "This product is RecycledCotton") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>287 </a>288289 <div class="collapse" id="collapseRecycledCotton">290 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledCotton Text Default - Text", "This is a RecycledCotton subline or text 1")</p>291 <p class="my-0">@Translate("eCom Product - RecycledCotton Text2 Default - Text", "This is a RecycledCotton text 2.")</p>292 <p class="my-0">@Translate("eCom Product - RecycledCotton Text3 Default - Text", "This is a RecycledCotton text 3.")</p>293 </div>294 }295296 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("recycled wood"))297 {298 <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">299 @Translate("eCom Product - RecycledWood Heading Default - Heading", "This product is RecycledWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>300 </a>301302 <div class="collapse" id="collapseRecycledWood">303 <p class="mt-1 mb-0">@Translate("eCom Product - RecycledWood Text Default - Text", "This is a RecycledWood subline or text 1")</p>304 <p class="my-0">@Translate("eCom Product - RecycledWood Text2 Default - Text", "This is a RecycledWood text 2.")</p>305 <p class="my-0">@Translate("eCom Product - RecycledWood Text3 Default - Text", "This is a RecycledWood text 3.")</p>306 </div>307 }308309 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("reclaimed wood"))310 {311 <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">312 @Translate("eCom Product - ReclaimedWood Heading Default - Heading", "This product is ReclaimedWood") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>313 </a>314315 <div class="collapse" id="collapseReclaimedWood">316 <p class="mt-1 mb-0">@Translate("eCom Product - ReclaimedWood Text Default - Text", "This is a ReclaimedWood subline or text 1")</p>317 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text2 Default - Text", "This is a ReclaimedWood text 2.")</p>318 <p class="my-0">@Translate("eCom Product - ReclaimedWood Text3 Default - Text", "This is a ReclaimedWood text 3.")</p>319 </div>320 }321322 @if (!string.IsNullOrEmpty(mainMaterial) && mainMaterial.ToLower().Contains("paper mache"))323 {324 <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">325 @Translate("eCom Product - PaperMache Heading Default - Heading", "This product is PaperMache") <i class="material-icons e-nav-pageicon-dropdown">keyboard_arrow_down</i>326 </a>327328 <div class="collapse" id="collapsePaperMache">329 <p class="mt-1 mb-0">@Translate("eCom Product - PaperMache Text Default - Text", "This is a PaperMache subline or text 1")</p>330 <p class="my-0">@Translate("eCom Product - PaperMache Text2 Default - Text", "This is a PaperMache text 2.")</p>331 <p class="my-0">@Translate("eCom Product - PaperMache Text3 Default - Text", "This is a PaperMache text 3.")</p>332 </div>333 }334335 @if (GetString("Ecom:Product:Field.Description2.Value.Clean") != "")336 {337 <p class="h4 mt-2 mb-2" style="text-transform: none">@GetString("Ecom:Product:Field.Description2.Value.Clean")</p>338 }339340341 <h4>@Translate("eCom Product - Vejl. udsalgspris - Text", "Vejl. udsalgspris")</h4>342 <p class="e-product-price mb-2 mt-0">343 @espressoProduct.WholesalePrice.Format()344 </p>345346 @if (isUserAuthenticated)347 {348 <div class="small">349 @RenderingService.Instance.PartialView("ecom/product/partials/delivery-info.cshtml", espressoProduct)350 </div>351 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-cart.cshtml", espressoProduct)352 <br/>353 }354 else355 {356 @Espresso.Area.Item.EcommerceAlternativeCallToAction357 <p class="small pr-4">358 <span class="small">@Translate("eCom Product - We cannot garantee - Text", "*Vi kan ikke garantere, at hele sortimentet forefindes hos alle forhandlere.")</span>359 </p>360 }361362 </div>363 </div>364 <div class="col-12 col-md-7 col-lg-8 order-first">365366 @RenderingService.Instance.PartialView("ecom/product/partials/images.cshtml", espressoProduct)367 @if (isUserAuthenticated)368 {369 IEnumerable<CustomerProductList> userFavoriteLists = CustomerProductList.GetAllProductLists(PageView.Current().User.ID);370 string isInAnyList = userFavoriteLists.Any(fl => espressoProduct.IsInFavoriteList(fl.ID)) == true ? "isInAnyList" : "";371 <div class="bloomingville-addtolist-wrapper js-bloomingville-addtolist-wrapper @isInAnyList">372 <div class="dropdown js-e-productlist-favorite-list-container" data-product-id="@espressoProduct.Id" data-variant-id="@espressoProduct.VariantId">373 <span class="dropdown-toggle" data-toggle="dropdown">374 <span class="bloomingville-productlist-addtolist label-favorite"></span>375 </span>376 <div class="dropdown-menu dropdown-menu-left pt-0">377 @RenderingService.Instance.PartialView("ecom/productlist/partials/add-to-favorites.cshtml", espressoProduct)378 </div>379 </div>380 </div>381 }382383 </div>384 </div>385 </div>386 @RenderingService.Instance.SectionEnd()387388389 @RenderingService.Instance.SectionStart(new SectionSettings390 {391 Classes = new ClassList("e-section pb-2"),392 ContentClasses = new ClassList("col-12 is-lg col-md-7 col-lg-6 col-lg-8 col-xl-8 mr-auto is-lg"),393 Collapsible = false394 })395 <div class="col-12">396 <div class="p-accordion-container border-dark mb-2">397 @if (!string.IsNullOrEmpty(espressoProduct.DescriptionShort))398 {399 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 border-bottom-0">400 <div class="p-accordion-toggle">401 <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">402 <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>403 </p>404 </div>405 <div id="e-accordion-12574-185" class="fade collapse" style="">406 <div class="pb-4 pt-1 pr-2 p-accordion-content">407 <div class="p-txt-container small">408 @espressoProduct.DescriptionShort409 </div>410 </div>411 </div>412 </div>413 }414 <div class="p-accordion-item border border-right-0 border-left-0 border-dark e-theme-light mb-0 ">415 <div class="p-accordion-toggle">416 <p data-toggle="collapse" data-target="#e-accordion-specifications" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">417 <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>418 </p>419 </div>420 <div id="e-accordion-specifications" class="collapse fade">421 <div class="pb-4 pt-1 p-accordion-content">422 <div class="p-txt-container">423 <table class="table table-sm table-striped">424 @{425 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName;426 string getSalesTextCurrentLanguage = string.Format("Ecom:Product.CategoryField.ImportedCategoryFields.SalesText{0}.Value", globalAreaLang.ToUpper());427 }428429 @foreach (LoopItem FieldDisplayGroups in GetLoop("FieldDisplayGroups"))430 {431 if (FieldDisplayGroups.GetString("Ecom:FieldDisplayGroup.Name") == "Produktspecifikationer")432 {433 foreach (LoopItem field in FieldDisplayGroups.GetLoop("Fields"))434 {435 if (field.GetString("Ecom:FieldDisplayGroup.Field.Id") == "ProductCategory|ImportedCategoryFields|SalesText" && globalAreaLang != "en")436 {437 <tr>438 <th class="pl-2" style="width: 50%">439 @Translate(string.Format("eCom Product - Specifications - {0} - Label", field.GetString("Ecom:FieldDisplayGroup.Field.Id")), field.GetString("Ecom:FieldDisplayGroup.Field.Name"))440 </th>441 <td>442443 @if (!string.IsNullOrEmpty(GetString(getSalesTextCurrentLanguage)))444 {445 @GetString(getSalesTextCurrentLanguage)446 }447 else448 {449 @field.GetString("Ecom:FieldDisplayGroup.Field.Value")450 }451 </td>452 </tr>453 }454 else if (field.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("SalesText") && globalAreaLang != "en")455 {456 @* Removes Sales Texts because they are manually handled right above here *@457 }458 else if (!string.IsNullOrEmpty(field.GetString("Ecom:FieldDisplayGroup.Field.Value")))459 {460 <tr>461 <th class="pl-2" style="width: 50%">462 @Translate(string.Format("eCom Product - Specifications - {0} - Label", field.GetString("Ecom:FieldDisplayGroup.Field.Id")), field.GetString("Ecom:FieldDisplayGroup.Field.Name"))463 </th>464 <td>465 @field.GetString("Ecom:FieldDisplayGroup.Field.Value")466 </td>467 </tr>468 }469 }470 }471 }472 </table>473 </div>474 </div>475 </div>476 </div>477 <div class="p-accordion-item border border-right-0 border-left-0 border-top-0 border-dark e-theme-light mb-0 ">478 <div class="p-accordion-toggle">479 <p data-toggle="collapse" data-target="#e-accordion-images" class="py-1 d-flex align-items-center m-0 collapsed justify-content-between">480 <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>481 </p>482 </div>483 <div id="e-accordion-images" class="collapse fade">484 <div class="pb-4 pt-1 p-accordion-content">485 <div class="p-txt-container">486 @RenderingService.Instance.PartialView("ecom/product/partials/images-download.cshtml", espressoProduct)487 </div>488 </div>489 </div>490 </div>491 </div>492 </div>493 @RenderingService.Instance.SectionEnd()494495 @{496 List<string> productIds = new List<string>();497 if (Context.Cart != null && Context.Cart.OrderLines.Any())498 {499 OrderLineCollection orderLines = Context.Cart.OrderLines;500 productIds = orderLines.Select(ol => ol.ProductId).ToList();501 }502 productIds.Add(espressoProduct.Id);503504 HandlebarsProductListTemplate handlebarsProductListTemplate = HandlebarsService.Instance.GetProductListTemplate(new HandlebarsProductListTemplateSettings()505 {506 Classes = new ClassList("e-productlist js-e-productlist js-e-require"),507 HeaderClasses = new ClassList("col-12 border-bottom"),508 MainClasses = new ClassList("col-12 js-clerk-content"),509 AsideClasses = new ClassList("col-12"),510 FooterClasses = new ClassList("col-12 col-lg-3 col-xl-3"),511 PageSize = string.IsNullOrEmpty(HttpContext.Current.Request["PageSize"]) ? GetInteger("Ecom:ProductList.PageSize").ToString() : HttpContext.Current.Request["PageSize"],512 PageNumber = string.IsNullOrEmpty(HttpContext.Current.Request["PageNum"]) ? GetInteger("Ecom:ProductList.CurrentPage").ToString() : HttpContext.Current.Request["PageNum"],513 SortBy = ProductListService.Instance.GetSortingParameterName(string.IsNullOrEmpty(HttpContext.Current.Request["SortBy"]) ? "" : HttpContext.Current.Request["SortBy"]),514 SortOrder = string.IsNullOrEmpty(HttpContext.Current.Request["SortOrder"]) ? GetString("Ecom:ProductList.SortOrder") : HttpContext.Current.Request["SortOrder"],515 ShowFilters = false,516 Heading = Espresso.Item.HeadingShow == "True" ? Espresso.Item.Name : string.Empty517 });518519 List<EspressoPagingPage> productListPaging = new List<EspressoPagingPage>();520 if (GetLoop("Ecom:ProductList.Pages").Count > 0)521 {522 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages"))523 {524 productListPaging.Add(new EspressoPagingPage()525 {526 Url = page.GetString("Ecom:ProductList.Pages.Page.Url"),527 Number = page.GetString("Ecom:ProductList.Pages.Page.Number")528 });529 }530 }531532533 EspressoProductList substituting = APIWrapper.Instance.IGetSubstitutingProducts(espressoProduct.Id, "SubstitutingProducts");534 if (substituting.Products.Any())535 {536 List<EspressoProduct> substitutingProducts = substituting.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();537 @RenderingService.Instance.SectionStart(new SectionSettings538 {539 Classes = new ClassList("e-section pb-2 bg-light")540 })541 <div class="e-productlist-header col-12">542 <p class="h1">@Translate("eCom Product - Related group - SubstitutingProducts - Heading", "Gode alternativer til dette")</p>543 </div>544 <div class="@handlebarsProductListTemplate.MainClasses">545 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(546 new ProductListSettings()547 {548 Products = substitutingProducts.Take(4).ToList(),549 Paging = productListPaging,550 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),551 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)552 }553 ))554 </div>555 @RenderingService.Instance.SectionEnd()556 }557558559 EspressoProductList complimentary = APIWrapper.Instance.IGetComplimentaryProducts(espressoProduct.Id, "ComplimentaryProducts");560 if (complimentary.Products.Any())561 {562 List<EspressoProduct> complimentaryProducts = complimentary.Products.Where(cwp => !productIds.Contains(cwp.Id)).ToList();563 @RenderingService.Instance.SectionStart(new SectionSettings564 {565 Classes = new ClassList("e-section pb-2 bg-light")566 })567 <div class="e-productlist-header col-12">568 <p class="h1">@Translate("eCom Product - Related group - ComplimentaryProducts - Heading", "Andre kunder købte også")</p>569 </div>570 <div class="@handlebarsProductListTemplate.MainClasses">571 @RenderingService.Instance.PartialView("ecom/productlist/partials/products.cshtml", ProductListService.Instance.GetProductList(572 new ProductListSettings()573 {574 Products = complimentaryProducts.Take(4).ToList(),575 Paging = productListPaging,576 PageSize = Convert.ToInt32(handlebarsProductListTemplate.PageSize),577 CurrentPage = Convert.ToInt32(handlebarsProductListTemplate.PageNumber)578 }579 ))580 </div>581 @RenderingService.Instance.SectionEnd()582 }583 }584585 @RenderingService.Instance.PartialView("ecom/product/partials/metadata.cshtml", espressoProduct)586 @RenderingService.Instance.PartialView("ecom/product/partials/gtm-tracking.cshtml", espressoProduct)587588 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode(espressoProduct.Name)" data-link="@HttpUtility.HtmlAttributeEncode(espressoProduct.Link)"></code>589590591 <script>592 e4.data.set('@espressoProduct.Id',593 JSON.parse('@HttpUtility.JavaScriptStringEncode(JsonService.Instance.ToJson(espressoProduct))'))594 </script>595596 </div>597 @RenderingService.Instance.SectionStart(new SectionSettings())598599 <script id="js-e-handlebars-tmpl-favorite-list" type="text/x-handlebars-template">600 {{#each lists as | list |}}601 <div class="dropdown-item">602 <label class="custom-checkbox custom-control m-0">603 <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}}}">604 <span class="custom-control-indicator"></span>605 <span class="custom-control-description">{{list.name}}</span>606 </label>607 </div>608 {{/each}}609 </script>610 }
keyboard_arrow_up