Error executing template "Designs/isabella/eCom/Product/espresso.cshtml" System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Co3.Isabella.Dw.DAL.Repositories.ProductRepository.GetPrices(String[] productNumbers, String dataAreaId, String currencyCode, String countryCode, String command) in C:\git\isabella\Co3.Isabella.Dynamicweb\DAL\Repositories\ProductRepository.cs:line 192 at Co3.Isabella.Dw.Services.PriceService.GetPrices(String[] productNumbers, String dataAreaId, String currencyCode, String countryCode, String command) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 44 at Co3.Isabella.Dw.Services.PriceService.GetItemPrices(String productNumber, String dataAreaId, String currencyCode, String countryCode, String command) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 124 at Co3.Isabella.Dw.Services.PriceService.GetProductPrice(String productNumber, Double quantity, String dataAreaId, String currencyCode, String countryCode, String command) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 83 at Co3.Isabella.Dw.Services.PriceService.GetProductPrice(Product product, Double quantity, String dataAreaId, String currencyCode, String countryCode, String command) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 62 at Co3.Isabella.Dw.Providers.PriceProvider.FindPrice(Product product, Double quantity, String variantID, Currency currency, String unitID, User user) in C:\git\isabella\Co3.Isabella.Dynamicweb\Providers\PriceProvider.cs:line 45 at Dynamicweb.Ecommerce.Prices.PriceProvider.FindPrice(PriceContext context, PriceProductSelection selection) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPriceInternal(PriceProvider provider, PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPrice(PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.GetPrice(PriceContext context, Product product, String unitId, Int64 stockLocationId) at Dynamicweb.Ecommerce.Products.Product.GetPrice(PriceContext context) at Co3.Isabella.Dw.Services.ProductService.GetPrice(Product product) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 435 at Co3.Isabella.Dw.Services.ProductService.GetPrice(String productId, String variantId, String languageId) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 475 at CompiledRazorTemplates.Dynamic.RazorEngine_5b92b742e813434c9905a41e7b65d394.GetPriceByRelatedProductItem(Product item, Boolean isUserAuthenticated, Boolean allowBuyIfOutOfStock, Boolean hidePrice) in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Product\espresso.cshtml:line 1591 at CompiledRazorTemplates.Dynamic.RazorEngine_5b92b742e813434c9905a41e7b65d394.Execute() in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Product\espresso.cshtml:line 1305 at 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.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using Dynamicweb.Ecommerce.Prices 3 @using System.Text.RegularExpressions 4 @using Co3.Espresso.Website.Services 5 @using Co3.Isabella.Dw.Services; 6 @using Dynamicweb.Ecommerce.Common.eCom7 7 @using Dynamicweb.Ecommerce.Products 8 @using Dynamicweb.Rendering 9 @using System.Web 10 @using Co3.Espresso.Base.Extensions 11 @using Dynamicweb.Frontend 12 @using Co3.Espresso.Base.Models 13 @using Co3.Espresso.Website.Models.FrontEnd 14 @using Dynamicweb.Admin.dk.dynamicweb.templates 15 @using Dynamicweb.Controls 16 @using Co3.Espresso.Website.Models.FrontEnd.Paragraphs 17 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 18 @using Dynamicweb 19 @using Dynamicweb.Ecommerce.Products.Categories 20 @using Dynamicweb.Ecommerce.Products.FieldDisplayGroups 21 @using Context = Dynamicweb.Ecommerce.Common.Context 22 @using eProductService = Co3.Espresso.Website.Services.ProductService 23 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 24 25 @using System.Globalization 26 @using System.Security.Cryptography.X509Certificates 27 @using System.Web.Razor.Parser.SyntaxTree 28 @using Co3.Espresso.Base.Extensions 29 @using Co3.Espresso.Website.Models.FrontEnd 30 @using Co3.Espresso.Website.Services 31 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 32 @using Dynamicweb.Content 33 @using Dynamicweb.Ecommerce.Products 34 @using Dynamicweb.Frontend 35 @using Dynamicweb.Rendering 36 @using Dynamicweb.Rendering.Translation 37 @using Dynamicweb.SystemTools 38 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 39 @using eProductService = Co3.Espresso.Website.Services.ProductService 40 @using Page = Dynamicweb.Content.Page 41 @using PageService = Dynamicweb.Content.PageService 42 43 @functions { 44 45 public string getCountryCodeFromArea(Area area) 46 { 47 RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); 48 return regionInfo.TwoLetterISORegionName; 49 } 50 51 public string getCheckoutSetup(string shopType = "") 52 { 53 bool isB2bCheckout = PageView.Current().User != null; 54 if (isB2bCheckout) 55 { 56 return "shipping,customer,approve"; 57 } else if (shopType == "B2C") 58 { 59 return "shipping,payment,approve"; 60 } else if (shopType == "Outlet") 61 { 62 return "shipping,customer,payment,approve"; 63 } 64 65 return "customer,approve"; 66 } 67 68 public static string GetStandardCollapseToggleTextExpand() 69 { 70 return "Se mere"; 71 } 72 73 public static string GetStandardCollapseToggleTextCollapse() 74 { 75 return "Se mindre"; 76 } 77 78 public string getModelTypeLink() 79 { 80 bool isUserAuthenticated = PageView.Current().User != null; 81 string eComCountryCode = PageView.Current().Area.Item[ "EcommerceCountryCode" ] != null ? PageView.Current().Area.Item[ "EcommerceCountryCode" ].ToString() : ""; 82 string returnValue = string.Empty; 83 84 if ( isUserAuthenticated == false ) 85 { 86 if ( string.IsNullOrEmpty(eComCountryCode) == false) 87 { 88 { 89 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLink_{0}.Value", eComCountryCode ); 90 } 91 } 92 else 93 { 94 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLink.Value"; 95 } 96 } 97 else 98 { 99 if ( string.IsNullOrEmpty(eComCountryCode) == false) 100 { 101 { 102 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B_{0}.Value", eComCountryCode ); 103 } 104 } 105 else 106 { 107 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B.Value"; 108 } 109 } 110111 return returnValue; 112 } 113114 } 115116 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 117 { 118 if ( string.IsNullOrEmpty( content ) == false ) 119 { 120 ClassList headingClassList = new ClassList(); 121 headingClassList.AddClasses( "col-12" ); 122 ClassList contentClassList = new ClassList(); 123 contentClassList.AddClasses( "col-12" ); 124125 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 126127 if ( string.IsNullOrEmpty( heading ) == false ) 128 { 129 <div class="@headingClassList"> 130 <h2>@heading</h2> 131 </div> 132 } 133 <div class="@contentClassList"> 134 @content 135 </div> 136137 @sectionEnd() 138 } 139 } 140141142 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 143 { 144 if ( string.IsNullOrEmpty( videoURL ) == false ) 145 { 146 ClassList headingClassList = new ClassList(); 147 headingClassList.AddClasses( "col-12" ); 148 ClassList contentClassList = new ClassList(); 149 contentClassList.AddClasses( "col-12" ); 150151152 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 153154 if ( string.IsNullOrEmpty( heading ) == false ) 155 { 156 <div class="@headingClassList"> 157 <h2>@heading</h2> 158 </div> 159 } 160161 <div class="@contentClassList"> 162 <div class="embed-responsive embed-responsive-16by9 mb-2"> 163 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 164 <div class="cookieconsent-optout-marketing"> 165 <div> 166 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 167 @Dynamicweb.Rendering.Translation.Translation.GetTranslation("CookieBot - Video - accept marketing-cookies", PageView.Current().Area.Layout.Design) 168 </a> 169170 </div> 171 </div> 172 </div> 173 </div> 174 @sectionEnd() 175 } 176 } 177178 @helper ProductRelatedProducts(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null, 179 IEnumerable< Product > productLoop = null) 180 { 181 if ( productLoop != null && productLoop.Any() == true ) 182 { 183 ClassList headingClassList = new ClassList(); 184 headingClassList.AddClasses( "col-12" ); 185 ClassList contentClassList = new ClassList(); 186 contentClassList.AddClasses( "col-12" ); 187188 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 189190 if ( string.IsNullOrEmpty( heading ) == false ) 191 { 192 <div class="@headingClassList"> 193 <h4 class="isabella-text-bullets-left mb-3">@heading</h4> 194 </div> 195 } 196 <div class="@contentClassList"> 197 <div class="e-products mb-2"> 198 <div class="row"> 199 @{ 200 string productlistItemClassList = "col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"; 201 } 202 @foreach ( Product product in productLoop.Where(p => p.Groups.Any(g => g.ShopId.Equals("SHOP1")) && (bool) p.GetCategoryValue( "ProductsGeneral", "PIMActive" ) != false && (bool) p.ShowInProductList && p.Active) ) 203 { 204 @ProductlistItem(product, productlistItemClassList) 205 } 206 </div> 207 </div> 208 </div> 209210 @sectionEnd() 211 } 212 } 213214215 @helper ProductlistItem(Product product, string productlistItemClassList = null, string isModelProductList = null) 216 { 217 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService(); 218 string shopType = PageView.Current().Area.Item["ShopType"]?.ToString(); 219 string productLink = eProductService.Instance.GetProductLink( product.GetDefaultGroupByShopId( product.DefaultShopId ).Id, product.Id, product.VariantId ); 220221222 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( productLink ); 223224 if (shopType == "Outlet") 225 { 226 Page page = new PageService().GetPageByNavigationTag(PageView.Current().AreaID, "outletdisplaypage"); 227 if (page != null) 228 { 229 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( $"Default.aspx?ID={page.ID}&productId={product.Id}" ); 230 } 231232 } 233234 IsabellaProductImageUrl primaryImage = Co3.Isabella.Dw.Services.ProductService.Instance.GetImagePrimary(product); 235 List<IsabellaProductImageUrl> detailsImages = Co3.Isabella.Dw.Services.ProductService.Instance.GetImageDetails(product); 236 string detailsImage = detailsImages?.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Medium ?? string.Empty; 237238 //string productlistDetailImage = product.Details.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Value; 239240241242 string image = "/Files/Templates/Designs/isabella/_assets/img/NoImage.gif"; 243244 if (primaryImage != null) 245 { 246 image = primaryImage.Medium; 247 } 248249 if ( product != null ) 250 { 251 dynamic productData = new 252 { 253 id = product.Id, 254 url = productLink, 255 number = product.Number, 256 name = product.Name, 257 imageDefault = image, 258 price = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Format(), 259 priceClean = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Price, 260 productIntroText = product.GetCategoryValue( "ProductsGeneral", "ProductIntroText" )?.ToString(), 261 news = product.GetCategoryValue( "ProductsGeneral", "News" )?.ToString(), 262 productType = product.GetCategoryValue( "ProductsGeneral", "ProductType" )?.ToString(), 263 isModelProductList = isModelProductList, 264 productlistDetailImage = detailsImage, 265 shopType 266 }; 267268 <div class="@productlistItemClassList"> 269 <div class="border-1 card mb-6"> 270 <a href="@productData.url"> 271 @if ( productData.isModelProductList == "True" ) 272 { 273 <img src="@productData.productlistDetailImage" alt="@productData.name @productData.productType" class="col-12 p-0"> 274 } 275 else 276 { 277 <img src="@productData.imageDefault" alt="@productData.name @productData.productType" class="col-12 p-0"> 278 } 279 @if ( productData.news == "True" ) 280 { 281 <div class="isabella-product-item-news"> 282 @Dynamicweb.Rendering.Translation.Translation.GetTranslation( "Ecom Product - News Badge - Text" ) 283 </div> 284 } 285 </a> 286 <div class="card-body p-1 p-lg-3"> 287 <h4 class="e-products-item-name mb-0"> 288 <a href="@productData.url"> 289 @productData.name 290 </a> 291 </h4> 292293 </div> 294 </div> 295 </div> 296 } 297 } 298299300 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 301 { 302 sectionId = string.IsNullOrEmpty( sectionId ) ? Guid.NewGuid().ToString( "N" ) : sectionId; 303 ClassList sectionClassList = new ClassList(); 304 sectionClassList.AddClasses( sectionClasses ); 305 ClassList contentClassList; 306307 if ( contentClasses == null ) 308 { 309 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); 310 } 311 else 312 { 313 contentClassList = new ClassList(); 314 contentClassList.AddClasses( contentClasses ); 315 } 316317 // TODO: Split collapse logic into separate helper function. 318 string collapseId = Guid.NewGuid().ToString( "N" ); 319 ClassList collapseToggleClassList = new ClassList(); 320 if ( sectionCollapse ) 321 { 322 sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); 323 collapseToggleClassList.AddClasses( contentClasses ); 324 collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); 325 contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); 326 } 327328 @:<section class="@sectionClassList" id="@sectionId"> 329 @:<div class="container-fluid"> 330 @:<div class="row"> 331332 // TODO: Split collapse logic into separate helper function. 333 if ( sectionCollapse ) 334 { 335 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> 336 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button"> 337 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> 338 </button> 339 <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty( collapseToggleTextExpand ) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand )" data-collapse-text="@( string.IsNullOrEmpty( collapseToggleTextCollapse ) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse )"></small> 340 </div> 341 } 342343 @:<div class="@contentClassList" id="@collapseId"> 344 @:<div class="row"> 345 } 346347 @helper sectionEnd() 348 { 349 @:</div> 350 @:</div> 351 @:</div> 352 @:</div> 353 @:</section> 354 } 355356357358359360 @{ 361362 bool isUserAuthenticated = PageView.Current().User != null; 363 string globalAreaName = string.Empty; 364 string shopType = PageView.Current().Area.Item["ShopType"]?.ToString(); 365 string customWebsite = PageView.Current().Area.Item["CustomWebsite"]?.ToString(); 366 bool isOutlet = shopType == "Outlet"; 367 bool isCamplet = customWebsite == "camplet-website"; 368369370 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService(); 371 Product product = dwProductService.GetProductById( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), Context.LanguageID ); 372 bool hidePricePdf = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 373374375 string productHeadline = eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ) ); 376 double productPrice = hidePricePdf ? 0 : Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).Price; 377 string productDescription = Regex.Replace( GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ), @"<[^>]*>", String.Empty ); 378 string productImage = GetString( "Ecom:Product.ImageDefault.Clean" ); 379 string signBuilderUrlBase = PageView.Current().Area.Item["SignBuilderUrl"]?.ToString(); 380 string signBuilderUrl = $"{signBuilderUrlBase}&productSign=true&headline={HttpUtility.UrlEncode(productHeadline)}©={HttpUtility.UrlEncode(productDescription)}&price={HttpUtility.UrlEncode(productPrice.ToString("f", System.Globalization.CultureInfo.InvariantCulture))}&image={HttpUtility.UrlEncode(string.Format("/admin/public/getimage.ashx?Crop=0&Image={0}&Format=jpg&Width=1820&Height=1000&Quality=90", productImage))}¤cy={HttpUtility.UrlEncode(Context.Currency.Code)}&hidePrice={hidePricePdf}"; 381 string OrderContext = PageView.Current().Area.Item[ "ContextCart" ]?.ToString(); 382383 if ( string.IsNullOrEmpty( PageView.Current().Area.Domain ) ) 384 { 385 globalAreaName = PageView.Current().Area.Name; 386 } 387 bool noBuyB2BandB2CPdf = PageView.Current().Area.Item[ "EcommerceNoBuyB2CB2B" ] != null && ( bool ) PageView.Current().Area.Item[ "EcommerceNoBuyB2CB2B" ]; 388 bool isHybridShopPdf = noBuyB2BandB2CPdf && isUserAuthenticated && shopType == "Hybrid"; 389390 dynamic JSON = new 391 { 392 productid = GetValue( "Ecom:Product.ID" ), 393 variantoptions = new List< dynamic >(), 394 variantcombinations = new List< dynamic >(), 395 pdfData = new 396 { 397 name = productHeadline, 398 headline = productHeadline, 399 productnumber = GetString( "Ecom:Product.Number" ), 400 price = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).Price, 401 description = productDescription, 402 image = string.Format("/admin/public/getimage.ashx?Crop=0&Image={0}&Format=jpg&Width=1820&Height=1000&Quality=90",productImage ), 403 currency = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 404 logo = "Files/Images/isabella/signbuilder/signbuilder-logo.png", 405 colors = new List< dynamic >(), 406 frameMatch = new List< dynamic >(), 407 miscFrameMaterial = new List<dynamic>(), 408 frameMaterial = new List<dynamic>(), 409 materials = new List< dynamic >(), 410 measures = new List< dynamic >(), 411 isHybrid = isHybridShopPdf, 412 noBuyB2BandB2C = isHybridShopPdf ? false : (bool) Espresso.Page.Area.Item[ "EcommerceNoBuyB2CB2B" ], 413 isAccessory = GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true, 414 hidePrice = hidePricePdf, 415 translations = new { 416 relatedProductHeaderProduct = Translate( "PDF - Related Products Header - Product", "Added product" ), 417 relatedProductHeaderPrice = Translate( "PDF - Related Products Header - Price", "Price" ), 418 relatedProductTotalPrice = Translate( "PDF - Related Products Header - Total Price", "Total" ), 419 framesHeader = Translate( "PDF - Frames Header", "Stel muligheder" ), 420 materialsHeader = Translate( "PDF - Materials Header", "Materials" ), 421 measuresHeader = Translate( "PDF - Measures Header", "Measures" ) 422 } 423 } 424 }; 425426 @* Global Image modal variable used in part image carousel *@ 427 string isActive = string.Empty; 428429 IEnumerable< Product > parentProducts = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedParentProducts( product ); 430431 string eComCountryCode = Espresso.Page.Area.Item[ "EcommerceCountryCode" ] != null ? Espresso.Page.Area.Item[ "EcommerceCountryCode" ].ToString() : ""; 432 string modelTypeLink = getModelTypeLink(); 433434 string dwProductId = GetString("Ecom:Product.ID"); 435 string dwProductVariantId = GetString("Ecom:Product.VariantID"); 436437 } 438439 @sectionEnd() 440441 <div class="e-product js-e-product js-isabella-product-details-pdf" data-product-id="@dwProductId" data-product-variant-id="@dwProductVariantId" data-group-id="@product.PrimaryGroupId"> 442 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == false ) 443 { 444 <section class="align-items-center e-reveal-done e-section e-section-height-md js-e-section mb-0 p p-banner p-banner-gradient-disabled pb-auto pt-auto" id="11589"> 445 <div class="bg-center-middle p-img-container" style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=1820&Height=&Quality=90)" title=""></div> 446 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 447 <div class="isabella-product-item-news"> 448 @Translate("Ecom Product - News Badge - Text","Nyhed") 449 </div> 450 } 451 <a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link" href=""> 452 <i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i> 453 </a> 454 </section> 455 } 456457 @sectionStart( sectionClasses: "e-section py-2 isabella-camplet-dark" ) 458 <div class="col-12"> 459 <div class="row"> 460 <div class="col-12 col-md-7"> 461 <div class="e-product-text-container"> 462 <h1 class="e-product-name"> 463 @eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ) 464465 </h1> 466 <div class="e-product-text mb-3"> 467 @GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ) 468 </div> 469470471 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.Value" ) ) == false ) 472 { 473 <p class="mb-4"> 474 <a class="arrow-primary isabella-arrow" href="@GetString( modelTypeLink )"> 475 @Translate( "eCom Product - Model - Read more about - Link", "Læs mere om" ) @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" ) @Translate( "eCom Product - Model - series - Link", "serien" ) 476 </a> 477 </p> 478 } 479 </div> 480 </div> 481 <div class="col-12 col-md-5"> 482 @using Dynamicweb.Admin.dk.dynamicweb.templates 483 @using WebSupergoo.ImageGlue6 484485 @{ 486 string moodCarouselClassList = "d-none"; 487 } 488489 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true ) 490 { 491 <div class="e-product-image-container position-relative"> 492 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 493 <div class="isabella-product-item-news zi-sticky"> 494 @Translate("Ecom Product - News Badge - Text","Nyhed") 495 </div> 496 } 497 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 498 <div class="e-product-image-wrapper"> 499 <div class="carousel-inner"> 500 <div class="active carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 501 <img src="/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=600&Height=&Quality=90&AlternativeImage=/Files/Templates/Designs/isabella/_assets/img/NoImage.gif" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="0"> 502 </div> 503504 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 505 { 506 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 507 { 508 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 509 { 510 if ( image.Index != null ) 511 { 512 moodCarouselClassList = "d-flex"; 513 } 514 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 515 <img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=600&Height=&Quality=90&AlternativeImage=/Files/Templates/Designs/isabella/_assets/img/NoImage.gif" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@(image.Index + 1)"> 516 </div> 517 } 518 } 519 } 520521 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 522 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 523524 </div> 525 </div> 526527 <ol class="carousel-indicators @moodCarouselClassList"> 528 <li data-target="#js-e-product-image-carousel" class="active" data-slide-to="0"></li> 529 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 530 { 531 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 532 { 533 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 534 { 535 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 536 } 537 } 538 } 539 </ol> 540541 </div> 542 </div> 543 } 544 else 545 { 546547 <div class="e-product-image-container isabella-product-image-container-mood"> 548 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 549 <div class="e-product-image-wrapper"> 550 <div class="carousel-inner"> 551552 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 553 { 554 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 555 { 556 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 557 { 558 if ( image.Element.Index == 1 ) 559 { 560 isActive = "active"; 561 } 562 else 563 { 564 isActive = ""; 565 } 566 if ( image.Index != 0 ) 567 { 568 moodCarouselClassList = "d-flex"; 569 } 570 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 571 <img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=600&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@( image.Index )"> 572 </div> 573 } 574 } 575 } 576577 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 578 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 579580 </div> 581 </div> 582 <ol class="carousel-indicators @moodCarouselClassList"> 583 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 584 { 585 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 586 { 587 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 588 { 589 if ( image.Element.Index == 1 ) 590 { 591 isActive = "active"; 592 } 593 else 594 { 595 isActive = ""; 596 } 597598 <li class="@isActive" data-target="#js-e-product-image-carousel" data-slide-to="@( image.Index )"></li> 599 } 600 } 601 } 602 </ol> 603 </div> 604 </div> 605 } 606 @using Dynamicweb.Admin.dk.dynamicweb.templates 607 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-mood" data-backdrop="false" data-keyboard="true"> 608 <div class="modal-dialog"> 609 <div class="modal-content"> 610 <div class="modal-body"> 611612 <button type="button" class="close" data-dismiss="modal"> 613 <i class="material-icons">close</i> 614 </button> 615616 <div id="js-e-product-image-modal-carousel-mood" class="carousel slide" data-keyboard="true" data-interval="false"> 617 <div class="carousel-inner"> 618619 <div class="carousel-item active" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=&Height=1800&Quality=90&AlternativeImage=/Files/Templates/Designs/isabella/_assets/img/NoImage.gif)"> 620 </div> 621 @foreach (LoopItem imageCategories in GetLoop("ImageCategories")) 622 { 623 if (imageCategories.GetString("Category.SystemName") == "MoodImages") 624 { 625 foreach (ElementWithIndex<LoopItem> image in imageCategories.GetLoop("Category.Images").WithIndex()) 626 { 627 if (image.Element.Index == 1) 628 { 629 isActive = "active"; 630 } 631 else 632 { 633 isActive = ""; 634 } 635 <div class="carousel-item" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=&Height=1800&Quality=90)"> 636 </div> 637 } 638 } 639 } 640 </div> 641642 <ol class="carousel-indicators @moodCarouselClassList"> 643 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="0"> 644 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=50&Height=&Quality=75)"></span> 645 </li> 646 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 647 { 648 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 649 { 650 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 651 { 652 if (image.Element.Index == 1 ) 653 { 654 isActive = "active"; 655 } 656 else 657 { 658 isActive = ""; 659 } 660 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@( image.Index + 1 )"> 661 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=50&Height=&Quality=75)"></span> 662 </li> 663 } 664 } 665 } 666 </ol> 667668 <a class="carousel-control-prev @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="prev"></a> 669 <a class="carousel-control-next @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="next"></a> 670671 </div> 672 </div> 673 </div> 674 </div> 675 </div> 676677 </div> 678 </div> 679 </div> 680 @sectionEnd() 681682 @sectionStart( sectionClasses: "e-section pb-2 isabella-camplet-dark" ) 683 <div class="col-12"> 684 <div class="row"> 685 <div class="col-12 col-md-5 mb-3 mb-md-0 order-md-2"> 686 @using System.Runtime.Remoting.Contexts 687 @using System.Text.RegularExpressions 688 @using Co3.Espresso.Base.Extensions 689 @using Co3.Espresso.Website.Services 690 @using Dynamicweb.Ecommerce.Extensibility.Provider 691 @using Dynamicweb.Ecommerce.Products 692 @using Dynamicweb.Frontend 693 @using Co3.Isabella.Data.DAL.Models 694 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 695 @using Dynamicweb.Content.Items 696 @using Dynamicweb.Ecommerce.International 697 @using Dynamicweb.Ecommerce.Orders 698 @using Dynamicweb.Security.UserManagement 699 @using Newtonsoft.Json 700 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 701702 @{ 703 double colli = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 704 double value = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 705706 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 707 IsabellaStock stockObject = isabellaProduct.Stock; 708 StockStatus mainStockStatus = stockObject.Status; 709 double stock = stockObject.Stock; 710 bool allowBuyIfOutOfStock = false; 711 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 712713 bool canBuyIfOutOfStock = true; 714 double totalStockMainAndRelated = 0; 715716 bool pimActive = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.PIMActive.Value"); 717 bool lockColliB2c = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2C.Value"); 718 bool lockColliB2b = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2B.Value"); 719 bool hidePriceFieldValue = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.HidePrice.Value"); 720 bool userCanBuy = false; 721 bool lockColli = false; 722723 bool isIsabellaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsabellaProduct.Value"); 724 bool isCampletProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.CampletProduct.Value"); 725 bool isVillaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.VillaProduct.Value"); 726 bool isAccessorieProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value"); 727728 bool isNoBuyB2C = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value"); 729 bool isNoBuyB2B = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value"); 730731 string userDealerType = string.Empty; 732733 bool isDiscontinued = pimActive == false; 734 bool hasRelatedProducts = false; 735736 totalStockMainAndRelated += stock; 737738 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 739740 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && shopType == "Hybrid"; 741742 bool hidePrice = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 743744745 if (isUserAuthenticated == false) 746 { 747 if (mainStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) 748 { 749 canBuyIfOutOfStock = false; 750 } 751 userCanBuy = true; 752 } 753 else 754 { 755 Item item = null; 756 if ( !string.IsNullOrEmpty(PageView.Current().User.ItemType)) 757 { 758 item = Dynamicweb.Services.Items.GetItem(PageView.Current().User.ItemType, PageView.Current().User.ItemId); 759 } 760761762 if (item != null && item.ContainsKey("Type") && item["Type"] != null) 763 { 764 userDealerType = item["Type"].ToString(); 765 } 766 if (string.IsNullOrEmpty(userDealerType)) 767 { 768 userDealerType = string.Empty; 769 } 770771772 if (isIsabellaProduct && userDealerType.Contains("Isabella") == true) 773 { 774 userCanBuy = true; 775 } 776 else if (isCampletProduct && userDealerType.Contains("Camplet") == true) 777 { 778 userCanBuy = true; 779 } 780 else if (isVillaProduct && userDealerType.Contains("Villa") == true) 781 { 782 userCanBuy = true; 783 } 784 } 785786 if (isUserAuthenticated == false && lockColliB2c == true) 787 { 788 lockColli = true; 789 } 790 else if (isUserAuthenticated == true && lockColliB2b == true) 791 { 792 lockColli = true; 793 } 794795 if (colli == 0) 796 { 797 colli = 0; 798 value = 1; 799 } 800 Dictionary<string, RelatedProductInfo> temp = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedProducts(product); 801802 string howItWorksPage = Espresso.Page.Area.Item["Product_Page_HowItWorks"]?.ToString().ToLower().Replace("default.aspx?id=", ""); 803 object findDealerLink = Espresso.Page.Area.Item["FindDealer"]?.ToString(); 804805 if (isHybridShop) 806 { 807 userCanBuy = false; 808 canBuyIfOutOfStock = false; 809 } 810811 } 812813 <form action="@globalAreaName/system/data/cart" class="bg-septenary-opacity-low e-product-form js-e-product-form js-e-product-form-addtocart js-isabella-product-form-addtocart js-isabella-related-form-addtocart js-e-product-cc-list-form p-2" method="post" data-hybrid="@isHybridShop"> 814 <input name="CartCmd" type="hidden" value="addMulti"> 815 <input name="Redirect" type="hidden" value=""> 816 <input name="Name" type="hidden" value="@eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"))"> 817 <input name="Number" type="hidden" value="@GetString("Ecom:Product.Number")"> 818 @if (hidePrice == false) 819 { 820 <input name="Price" type="hidden" value="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price.ToJavaScript()"> 821 } 822823 <input name="OrderContext" type="hidden" value="@OrderContext"> 824 <input name="ProductCurrencyCode" type="hidden" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 825 <h3 class="mb-1 mt-1">@Translate("eCom Product - Add To Cart Form Table - Choose product - Heading", "Vælg Produkt")</h3> 826 @if (pimActive == false) 827 { 828 <div class="alert alert-danger"> 829 <p class="m-0"> 830 @Translate("eCom Product - Add To Cart Form Table - Model Discontinued - Text", "Denne model er udgået, nedenfor kan du købe tilbehør") 831 </p> 832 </div> 833 } 834835 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 836 { 837 <div class="alert alert-danger @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 838 <p class="m-0"> 839 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 840 { 841 @Translate("eCom Product - Add To Cart Form Table - Model Out of Stock B2B - Text", "Denne model er udsolgt, nedenfor kan du købe tilbehør") 842 } 843 else 844 { 845 @Translate("eCom Product - Add To Cart Form Table - Model Out of Stock - Text", "Denne model er udsolgt, nedenfor kan du købe tilbehør") 846 } 847 </p> 848 </div> 849 } 850851 <div class="table-container" role="table"> 852853 <div class="flex-table header" role="rowgroup"> 854 <div class="first flex-row w-40" role="columnheader"></div> 855 @if (noBuyB2BandB2C == false) 856 { 857 <div class="flex-row w-10 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B() @(allowBuyIfOutOfStock == true ? "invisible" : string.Empty)" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Stock Text", "Lager")</div> 858 <div class="flex-row w-30 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B() @(hidePrice ? "d-none" : string.Empty)" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Price Text", "Pris")</div> 859 } 860 @if (isHybridShop == true && hidePrice == false) 861 { 862 <div class="flex-row w-40" role="columnheader"> 863 @Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris") 864 </div> 865 } 866 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 867 </div> 868 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 869 <div class="align-self-center first flex-row w-40" role="cell"> 870 @eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 871 <br/> 872 <span class="text-muted">@GetString("Ecom:Product.Number")</span> 873 </div> 874 @if (noBuyB2BandB2C == false) 875 { 876 <div class="align-self-center center flex-row w-10" role="cell"> 877 @if (isDiscontinued == false && noBuyB2BandB2C == false) 878 { 879 @GetProductStockByStatus(product, allowBuyIfOutOfStock) 880 } 881 </div> 882 } 883 @if (noBuyB2BandB2C == false) 884 { 885 <div class="align-self-center center flex-row w-30" role="cell"> 886 @if (isDiscontinued == false) 887 { 888 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 889 <div class="d-flex flex-column"> 890 @if (!noBuyB2BandB2C && !hidePrice) 891 { 892 <div @(priceCheck <= 0 ? "hidden" : string.Empty)> 893 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 894 </div> 895 } 896 @if (noBuyB2BandB2C) 897 { 898 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 899 } 900 else if (mainStockStatus == StockStatus.InStockAtRemote) 901 { 902 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 903 } 904 else if (canBuyIfOutOfStock == false && allowBuyIfOutOfStock == false) 905 { 906 <p class="m-0 text-danger">@Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt")</p> 907 } 908 </div> 909 } 910911 </div> 912 } 913 else if (isHybridShop) 914 { 915 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 916 if (!hidePrice) 917 { 918 <div class="align-self-center center flex-row w-40" role="cell"> 919 <div class="d-flex flex-column small"> 920 <span> 921 @if (priceCheck > 0) 922 { 923 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 924 } 925 else 926 { 927 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Missing Price - Text", "Pris mangler")</p> 928 } 929 </span> 930931 </div> 932 </div> 933 } 934 } 935 <div class="align-self-center flex-row w-20 ml-auto" role="cell"> 936 @if (isDiscontinued == false && canBuyIfOutOfStock == true) 937 { 938 <input name="ProductID0" type="hidden" value="@GetString("Ecom:Product.ID")"> 939 <input id="ProductLoopCounter0" name="ProductLoopCounter0" type="hidden" value="0"> 940 <input name="VariantID0" type="hidden" value=""> 941 if (noBuyB2BandB2C || isHybridShop) 942 { 943 @GetPdfOnlyQuantityInput(Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price, "main", Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 944 } 945 else 946 { 947 if (lockColli) 948 { 949 <input id="Quantity0" class="form-control js-e-cart-quantity js-isabella-quanitity text-right js-isabella-colli-quanitity" type="text" name="Quantity0" value="@value" data-rule-digits="true" data-rule-min="@colli" data-colli="@colli" data-step="@colli" data-price="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price"> 950 } 951 else 952 { 953 <input id="Quantity0" class="form-control js-e-cart-quantity js-isabella-quanitity text-right js-isabella-ease-colli-quanitity" type="text" name="Quantity0" value="@(isUserAuthenticated ? value : 1)" data-rule-digits="true" data-price="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price"> 954 } 955 } 956 } 957 else 958 { 959 <p class="m-0 text-danger"> 960 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 961 { 962 @GetPdfOnlyQuantityInput(Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price, "main", Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv")) 963 } 964 else if (isDiscontinued == true) 965 { 966 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 967 } 968969 </p> 970 } 971 </div> 972 </div> 973 </div> 974975 @if (temp != null) 976 { 977 int relatedCounter = 1; 978 <div class="accordion" id="relatedProductsCollapse"> 979980 @foreach (string key in temp.Keys) 981 { 982 if (string.IsNullOrEmpty(key) == false) 983 { 984 bool doValidateFrame = !isHybridShop || key == "Frames" || key == "AccessoriesWithFrames"; 985986 <div class="border-top isabella-product-form-heading py-1" id="isabella-product-form-heading-@key" data-key="@key"> 987 <h4 class="mb-0"> 988 <a class="collapsed isabella-product-form-heading-collapse" data-toggle="collapse" data-target="#isabella-product-form-collapse-@key" aria-expanded="true" aria-controls="isabella-product-form-collapse-@key"> 989990 @{ 991 object header = temp[key].Name; 992993 if (header != null) 994 { 995 @header.ToString() 996 } 997 } 998999 <i class="order-last p-accordion-toggle-icon-img"> </i> 10001001 </a> 1002 </h4> 1003 </div> 100410051006 <div id="isabella-product-form-collapse-@key" class="js-related-collapse collapse @((key == "Frames") ? "show" : string.Empty)" aria-labelledby="isabella-product-form-heading-@key" data-parent="#relatedProductsCollapse" aria-expanded="@((key == "Frames") ? "true" : "false")" data-key="@key" data-do-validate-frame="@doValidateFrame"> 1007 <div class="px-1 table-container" role="table"> 1008 <div class="flex-table header" role="rowgroup"> 1009 <div class="first flex-row w-40 " role="columnheader"></div> 1010 @if (noBuyB2BandB2C == false) 1011 { 1012 <div class="flex-row w-10 @(allowBuyIfOutOfStock == true ? "invisible" : string.Empty)" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Stock Text", "Lager")</div> 1013 <div class="flex-row w-30 @(hidePrice ? "d-none" : string.Empty)" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Price Text", "Pris")</div> 1014 } 1015 @if (isHybridShop && !hidePrice) 1016 { 1017 <div class="flex-row w-40" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris")</div> 1018 } 1019 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 1020 </div> 10211022 @{ 1023 bool showAcceptRow = true; 1024 } 10251026 @if (temp[key] != null) 1027 { 1028 foreach (RelatedProduct relatedProduct in temp[key].RelatedProducts) 1029 { 1030 double totalPackagePrice = 0; 1031 double totalPackageColli = 0; 1032 bool totalIsInStock = true; 1033 string relatedPackageName = string.Empty; 1034 string fallbackProductName = string.Empty; 1035 string productItemDescription = string.Empty; 1036 string stockStatus = string.Empty; 1037 bool isPimActive = true; 1038 bool canBuyRelatedIfOutOfStock = true; 1039 StockStatus _tempStockStatus = new StockStatus(); 1040 bool isGroup = string.IsNullOrEmpty(relatedProduct.Name) == false; 1041 bool relatedStockStatusForGroupAtRemote = false; 1042 hasRelatedProducts = relatedProduct.Products.Any(); 10431044 Dictionary<string, dynamic> packs = new Dictionary<string, dynamic>(); 10451046 if (isGroup == true) 1047 { 1048 <div class="flex-table js-isabella-product-form-row" role="rowgroup" data-group="true"> 1049 <div class="align-self-center first flex-row w-40" role="cell"> 10501051 @foreach (Product item in relatedProduct.Products) 1052 { 1053 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1054 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1055 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1056 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 1057 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1058 fallbackProductName = item.Name; 10591060 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1061 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1062 StockStatus relatedStockStatus = relatedStockObject.Status; 1063 double relatedStock = relatedStockObject.Stock; 10641065 if (relatedStockStatus == StockStatus.OutOfStock) 1066 { 1067 _tempStockStatus = relatedStockStatus; 1068 } 106910701071 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 107210731074 if (isHybridShop || (isUserAuthenticated == false && relatedStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false)) 1075 { 1076 canBuyRelatedIfOutOfStock = false; 1077 showAcceptRow = false; 1078 _tempStockStatus = relatedStockStatus; 1079 } 1080 if (_tempStockStatus != StockStatus.OutOfStock) 1081 { 1082 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 1083 } 10841085 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1086 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 10871088 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1089 totalStockMainAndRelated += relatedStock; 1090 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1091 { 1092 totalIsInStock = false; 1093 } 109410951096 totalPackagePrice += itemPrice; 10971098 if (isPimActive == true && canBuyRelatedIfOutOfStock == true) 1099 { 1100 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1101 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1102 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1103 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1104 } 1105 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1106 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 1107 relatedCounter++; 1108 @* 1109 <script> 1110 var debugInfo = debugInfo || {}; 1111 debugInfo["@relatedPackageName"] = { 1112 "isPimActive" : "@isPimActive", 1113 "canBuyRelatedIfOutOfStock" : "@canBuyRelatedIfOutOfStock", 1114 "noBuyB2BandB2C" : "@noBuyB2BandB2C", 1115 "relatedStockStatus": "@relatedStockStatus", 1116 "totalIsInStock": "@totalIsInStock" 1117 }; 1118 </script> 1119 *@ 11201121 packs[relatedPackageName] = new 1122 { 1123 isPimActive = isPimActive, 1124 canBuyRelatedIfOutOfStock = canBuyRelatedIfOutOfStock, 1125 noBuyB2BandB2C = noBuyB2BandB2C, 1126 isHybridShop = isHybridShop, 1127 relatedStockStatus = relatedStockStatus, 1128 totalIsInStock = totalIsInStock, 1129 noBuyB2C = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C"), 1130 noBuyB2B = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B") 1131 }; 1132 } 1133 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1134 { 1135 @relatedPackageName 1136 } 1137 else 1138 { 1139 @fallbackProductName 1140 } 11411142 @{ 1143 dynamic pack = new { }; 1144 } 11451146 @if (packs.ContainsKey(relatedPackageName)) 1147 { 1148 pack = packs[relatedPackageName]; 1149 } 1150115111521153 @if (!string.IsNullOrEmpty(productItemDescription)) 1154 { 1155 <i class="material-icons material-icons-large ml-2 p-0 text-muted" data-toggle="popover" data-trigger="click hover focus" data-content="@HttpUtility.HtmlAttributeEncode(Regex.Replace(productItemDescription, @"<[^>]*>", String.Empty))">info</i> 1156 } 11571158 </div> 11591160 @if (noBuyB2BandB2C == false) 1161 { 1162 <div class="align-self-center center flex-row w-10" role="cell"> 1163 @if (!noBuyB2BandB2C) 1164 { 1165 @stockStatus 1166 } 1167 </div> 1168 } 11691170 @if (noBuyB2BandB2C == false) 1171 { 1172 <div class="align-self-center center flex-row w-30 " role="cell"> 1173 <div class="d-flex flex-column"> 1174 @if (!noBuyB2BandB2C && !hidePrice) 1175 { 1176 <div> 1177 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1178 </div> 1179 } 1180 @if (noBuyB2BandB2C) 1181 { 1182 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1183 } 1184 else if (relatedStockStatusForGroupAtRemote) 1185 { 1186 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1187 } 1188 </div> 1189 </div> 1190 } 1191 @if (isHybridShop && !hidePrice) 1192 { 1193 <div class="align-self-center center flex-row w-40 " role="cell"> 1194 <div class="d-flex flex-column"> 1195 <div class="small"> 1196 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1197 </div> 1198 </div> 1199 </div> 1200 } 1201 <div class="align-self-center center flex-row w-20 ml-auto" role="cell"> 12021203 @if (isPimActive == true && (canBuyRelatedIfOutOfStock || pack.relatedStockStatus != StockStatus.OutOfStock) == true && (noBuyB2BandB2C == false || isUserAuthenticated == false && pack.noBuyB2C == false || isUserAuthenticated == true && pack.noBuyB2B == false)) 1204 { 1205 if (isHybridShop) 1206 { 1207 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1208 } 1209 else 1210 { 1211 <input class="form-control js-isabella-quanitity js-isabella-related-product-quantity text-right @(lockColli ? "js-isabella-colli-quanitity" : string.Empty)" type="text" value="0" data-rule-digits="true" data-price="@totalPackagePrice" data-key="@key"> 1212 } 1213 } 1214 else 1215 { 1216 <p class="m-0 text-danger align-self-center"> 1217 @if (canBuyRelatedIfOutOfStock == false) 1218 { 1219 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv")) 1220 } 1221 else if (isPimActive == false) 1222 { 1223 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1224 } 1225 else 1226 { 1227 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1228 } 1229 </p> 1230 } 123112321233 </div> 12341235 </div> 1236 } 1237 else 1238 { 1239 foreach (Product item in relatedProduct.Products) 1240 { 1241 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1242 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1243 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1244 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 12451246 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1247 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1248 StockStatus relatedStockStatus = relatedStockObject.Status; 1249 double relatedStock = relatedStockObject.Stock; 12501251 fallbackProductName = item.Name; 1252 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1253 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 1254 totalStockMainAndRelated += relatedStock; 1255 totalStockMainAndRelated += item.Stock; 1256 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1257 { 1258 totalIsInStock = false; 1259 } 12601261 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 1262 <div class="align-self-center first flex-row w-40" role="cell"> 1263 @if (isPimActive == true) 1264 { 1265 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1266 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1267 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1268 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1269 } 1270 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1271 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 12721273 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1274 { 1275 @relatedPackageName 1276 } 1277 else 1278 { 1279 @fallbackProductName 1280 } 1281 @if (key != "Frames" && key != "AccessoriesWithFrames") 1282 { 1283 <br/> 1284 <span class="text-muted">@item.Number</span> 1285 } 1286128712881289 @if (!string.IsNullOrEmpty(productItemDescription)) 1290 { 1291 <i class="material-icons material-icons-large ml-2 p-0 text-muted" data-toggle="popover" data-trigger="click hover focus" data-content="@HttpUtility.HtmlAttributeEncode(Regex.Replace(productItemDescription, @"<[^>]*>", String.Empty))">info</i> 1292 } 1293 </div> 12941295 @if (noBuyB2BandB2C == false) 1296 { 1297 <div class="align-self-center center flex-row w-10 " role="cell"> 1298 @GetProductStockByStatus(item, allowBuyIfOutOfStock) 1299 </div> 1300 } 1301 @if (noBuyB2BandB2C == false) 1302 { 1303 <div class="align-self-center center flex-row w-30" role="cell"> 1304 <div class="d-flex flex-column"> 1305 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1306 </div> 1307 </div> 1308 } 1309 @if (isHybridShop) 1310 { 1311 <div class="align-self-center center flex-row w-40" role="cell"> 1312 <div class="d-flex flex-column"> 1313 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1314 </div> 1315 </div> 1316 } 1317 <div class="flex-row align-self-center w-20 ml-auto" role="cell"> 1318 @GetQuantityInputByRelatedProductItem(item, isUserAuthenticated, key, lockColli) 1319 </div> 1320 </div> 1321 relatedCounter++; 1322 } 1323 } 1324 } 1325 } 1326 @if ((key == "Frames" || key == "AccessoriesWithFrames") && showAcceptRow) 1327 { 1328 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 1329 <div class="form-group js-isabella-accept-no-frame-row" style="display: @(key == "AccessoriesWithFrames" ? "none" : "block")"> 1330 <div class="form-check"> 1331 <input class="js-isabella-accept-no-frame-input @((key == "AccessoriesWithFrames" && isAccessorieProduct == false) ? "js-ignore-in-validation" : string.Empty) required" id="acceptNoFrame-@key" name="acceptNoFrame-@key" type="checkbox" value="no"> 1332 <label class="form-check-label pl-1 d-inline" for="acceptNoFrame-@key"> 1333 @Translate("eCom Product - Add To Cart Form Table - Confirm No Frame - Text", "Jeg bekræfter hermed, at jeg ikke ønsker et stel") 1334 </label> 1335 </div> 1336 </div> 1337 </div> 1338 } 1339 </div> 13401341 </div> 1342 } 1343 } 1344 </div> 1345 } 13461347 <div class="border-top mt-0 table-container" role="table"> 1348 @if(!hidePrice){ 1349 <div class="flex-table mt-1 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1350 <div class="align-self-center first flex-row h4 w-50" role="cell"> 1351 @Translate("eCom Product - Add To Cart Form Table - Total Price Text", "I alt") 1352 </div> 1353 <div class="flex-row h3 text-right w-50" role="cell"> 1354 <div class="js-isabella-calculated-price"> 1355 @if (isDiscontinued == false) 1356 { 1357 if (isUserAuthenticated == true) 1358 { 1359 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true) 1360 { 1361 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1362 } 1363 else 1364 { 1365 @eProductService.Instance.GetPriceFormatted(0) 1366 } 1367 } 1368 else 1369 { 1370 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true) 1371 { 1372 if (mainStockStatus == StockStatus.OutOfStock) 1373 { 1374 @eProductService.Instance.GetPriceFormatted(0) 1375 } 1376 else 1377 { 1378 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1379 } 1380 } 1381 } 1382 } 1383 else 1384 { 1385 @eProductService.Instance.GetPriceFormatted(0) 1386 } 13871388 </div> 1389 </div> 1390 </div> 1391 } 1392 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1393 @if (!isOutlet) 1394 { 1395 <div class="align-self-center first flex-row w-50" role="cell"> 1396 @if (!string.IsNullOrEmpty(howItWorksPage)) 1397 { 1398 <a class="text-underline" data-target="#howItWorksModal" data-toggle="modal"> 1399 @if (isUserAuthenticated == false) 1400 { 1401 @Translate("eCom Product - How It works Modal - Button Text", "Sådan fungerer det") 1402 } 1403 else 1404 { 1405 @Translate("eCom Product - How It works Modal B2B - Button Text", "Sådan fungerer det") 1406 } 1407 </a> 1408 } 1409 </div> 1410 } 1411 else 1412 { 1413 <div class="align-self-center first flex-row w-50" role="cell"></div> 1414 } 14151416 @if (!hidePrice) 1417 { 14181419 <div class="flex-row text-right w-50" role="cell"> 14201421 @if (noBuyB2BandB2C == false && userCanBuy == true) 1422 { 1423 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1424 { 1425 if (totalStockMainAndRelated == 0) 1426 { 1427 <p class="m-0 "></p> 1428 } 1429 else 1430 { 1431 if ((isDiscontinued == true && hasRelatedProducts == false) || shopType == "B2C") 1432 { 1433 <p class="m-0 "></p> 1434 } 1435 else 1436 { 1437 if (!isOutlet) 1438 { 1439 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Klik og hent - Button", "Klik og hent")</button> 1440 } 1441 else 1442 { 1443 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Order - Button", "Order now")</button> 1444 } 14451446 } 1447 } 1448 } 14491450 if ((GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true && isUserAuthenticated == true) || shopType == "B2C" && GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1451 { 1452 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Cart - Button", "Add to cart")</button> 1453 } 1454 } 1455 @if (userCanBuy == false || GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") == true && isUserAuthenticated == false || (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") == true && isUserAuthenticated == true)) 1456 { 1457 <p class="mb-0">@Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")</p> 1458 } 14591460 </div> 1461 } 1462 </div> 1463 @if (!isOutlet) 1464 { 1465 <div class="flex-table" role="rowgroup"> 1466 <div class="align-self-center first flex-row w-50 pr-1" role="cell"> 1467 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1468 { 1469 @Translate("Product page - Not On Stock Info B2B - Text", "B2B relevant text") 1470 } 1471 else 1472 { 1473 @Translate("Product page - Not On Stock Info - Start Text", "Er varen ikke på lager kontakt Isabellas salgsafdeling på") 1474 <span class="text-primary">@Translate("Product page - Contact Phone - Number", "76497292")</span> 1475 @Translate("Product page - Not On Stock Info - End Textr", "eller send en mail") 1476 } 1477 </div> 1478 <div class="flex-row text-right w-50" role="cell"> 1479 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1480 { 1481 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer B2B - Link", "Find forhandler")</a> 1482 } 1483 else 1484 { 1485 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer - Link", "Find forhandler")</a> 1486 } 1487 </div> 1488 <div class="mt-2 p-0 col-12"> 1489 @if ( isUserAuthenticated == true ) 1490 { 1491 <div class="col-12"> 1492 <div class="row"> 1493 <div class="col-6"> 1494 @using Dynamicweb.Frontend 1495 <div class="dropdown"> 1496 <a class="dropdown-toggle" data-toggle="dropdown"> 1497 <i class="material-icons material-icons-large">playlist_add</i> @Translate( "eCom Product - Add to favorites - Link", "Add to favorites" ) 1498 </a> 1499 <div class="dropdown-menu pt-0"> 1500 <h4 class="dropdown-header">@Translate( "eCom Product - Add to favorite list - Heading", "Add to ..." )</h4> 1501 <form action="" class="js-e-product-cc-list-form mt-1"> 1502 @foreach ( LoopItem listType in GetLoop( "CustomerCenter.ListTypes" ) ) 1503 { 1504 foreach ( LoopItem list in listType.GetLoop( "CustomerCenter.ProductLists" ) ) 1505 { 1506 <div class="dropdown-item"> 1507 <label class="custom-checkbox custom-control m-0"> 1508 <input type="checkbox" class="custom-control-input js-e-cc-list" id="js-e-cc-list-@list.GetString( "Ecom:CustomerCenter.List.ID" )" name="list-@list.GetValue( "Ecom:CustomerCenter.List.ID" )" @( list.GetBoolean( "Ecom:Product.List.IsProductInThisList" ) == true ? "checked" : "" ) data-url-add="@list.GetString( "Ecom:Product.AddToThisListAction" )" data-url-remove="@list.GetString( "Ecom:Product.RemoveFromThisList" )"> 1509 <span class="custom-control-indicator"></span> 1510 <span class="custom-control-description">@list.GetString( "Ecom:CustomerCenter.List.Name" )</span> 1511 </label> 1512 </div> 1513 } 1514 } 1515 </form> 1516 <div class="dropdown-divider"></div> 1517 <a class="dropdown-item" href="@PageView.Current().Area.Item[ "ExtranetListsPage" ]"><i class="material-icons">add</i> @Translate( "eCom Product - Add new favorite list - Link", "Create a new list" )</a> 1518 </div> 1519 </div> 152015211522 </div> 1523 <div class="col-6"> 1524 <p> 1525 <a class="text-dark" href="@signBuilderUrl"> 1526 <i class="e-nav-pageicon material-icons">image</i> @Translate( "eCom Product - SignBuilder - Text", "Opret prisskilt (pdf)" )</a> 1527 </p> 1528 </div> 1529 </div> 1530 </div> 1531 } 1532 <div class="col-12"> 1533 <p> 1534 <a class="js-isabella-product-details-pdf-generate text-primary" href="#"> 1535 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download PDF - Text", "Hent produkt-PDF" )</a> 1536 </p> 1537 </div> 15381539 </div> 1540 </div> 1541 } 15421543 </div> 1544 </form> 15451546 <!-- Modal --> 1547 <div aria-hidden="true" aria-labelledby="howItWorksModalLabel" class="fade modal" id="howItWorksModal" role="dialog" tabindex="-1"> 1548 <div class="modal-dialog" role="document"> 1549 <div class="modal-content"> 1550 <div class="modal-body"> 1551 @if (!string.IsNullOrEmpty(howItWorksPage)) 1552 { 1553 @RenderPageContent(int.Parse(howItWorksPage)) 1554 } 1555 </div> 1556 </div> 1557 </div> 1558 </div> 155915601561 @functions 1562 { 156315641565 public string GetPriceByRelatedProductItem(Product item, bool isUserAuthenticated, bool allowBuyIfOutOfStock, bool hidePrice) 1566 { 1567 string returnValue = string.Empty; 1568 bool isPimActive = false; 1569 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 15701571 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 15721573 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1574 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1575 string textNoBuy = Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online"); 1576 string textNotInStock = Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt"); 1577 string textAtRemote = Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager"); 15781579 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1580 IsabellaStock stockObject = isabellaProduct.Stock; 1581 StockStatus stockStatus = stockObject.Status; 158215831584 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1585 { 1586 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1587 } 15881589 if (isPimActive) 1590 { 1591 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 15921593 if (hidePrice) 1594 { 1595 return ""; 1596 } 15971598 if (noBuyB2BandB2C) 1599 { 1600 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1601 } 1602 else 1603 { 1604 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1605 if (allowBuyIfOutOfStock == true) 1606 { 1607 return returnValue; 1608 } 16091610 if ((isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1611 { 1612 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1613 } 1614 else if (stockStatus == StockStatus.OutOfStock) 1615 { 1616 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNotInStock); 1617 } 1618 else if (stockStatus == StockStatus.InStockAtRemote) 1619 { 1620 returnValue += string.Format("<p class=\"m-0 text-muted\">{0}</p>", textAtRemote); 1621 } 1622 } 1623 if (isHybridShop) 1624 { 1625 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1626 } 1627 } 1628 return returnValue; 1629 } 16301631 public string GetQuantityInputByRelatedProductItem(Product item, bool isUserAuthenticated, string itemKey, bool lockColli) 1632 { 1633 string returnValue = string.Empty; 1634 bool isPimActive = false; 1635 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1636 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 16371638 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1639 { 1640 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1641 } 16421643 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1644 IsabellaStock stockObject = isabellaProduct.Stock; 1645 StockStatus stockStatus = stockObject.Status; 16461647 bool allowBuyIfOutOfStock = false; 1648 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 16491650 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1651 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1652 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1653 string textNoBuy = Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online"); 1654 string textNotInStockInput = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1655 if (isPimActive && stockStatus != StockStatus.OutOfStock || allowBuyIfOutOfStock == true) 1656 { 1657 if (noBuyB2BandB2C || (isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1658 { 1659 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1660 } 1661 else 1662 { 1663 returnValue = string.Format("<input class=\"form-control js-isabella-quanitity js-isabella-related-product-quantity text-right {0}\" type=\"text\" value=\"0\" data-rule-digits=\"true\" data-price=\"{1}\" data-key=\"{2}\">", lockColli ? "js-isabella-colli-quanitity" : string.Empty, itemPrice, itemKey); 1664 } 1665 } 1666 else 1667 { 1668 if (isPimActive == false) 1669 { 1670 returnValue = string.Format("<p class=\"m-0 text-danger\">{0}</p>", Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået")); 1671 } 1672 else 1673 { 1674 if (noBuyB2BandB2C || isUserAuthenticated == false) 1675 { 1676 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, noBuyB2BandB2C ? textNoBuy : textNotInStockInput); 1677 } 1678 else 1679 { 1680 if (noBuyB2BandB2C || noBuyB2BRelated == "True") 1681 { 1682 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1683 } 1684 else 1685 { 1686 returnValue = string.Format("<input class=\"form-control js-isabella-quanitity js-isabella-related-product-quantity text-right {0}\" type=\"text\" value=\"0\" data-rule-digits=\"true\" data-price=\"{1}\" data-key=\"{2}\">", (lockColli ? "js-isabella-colli-quanitity" : string.Empty), itemPrice, itemKey); 1687 } 1688 } 1689 } 1690 } 1691 if (isHybridShop) 1692 { 1693 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1694 } 1695 return returnValue; 1696 } 16971698 public string GetPdfOnlyQuantityInput(double itemPrice, string itemKey, string popoverText) 1699 { 1700 bool isUserAuthenticated = PageView.Current().User != null; 1701 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1702 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1703 if (isHybridShop) 1704 { 1705 popoverText = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1706 } 1707 return string.Format("<input class=\"form-control js-pdf-quantity text-right faded text-danger\" type=\"text\" value=\"0\" data-rule-digits=\"true\" data-price=\"{0}\" data-key=\"{1}\" data-toggle=\"popover\" data-trigger=\"hover focus\" data-placement=\"top\" data-content=\"{2}\">", itemPrice, itemKey, popoverText); 1708 } 17091710 public bool ShouldShowStock(Product item) 1711 { 1712 bool returnValue = false; 17131714 bool isPimActive = false; 17151716 if (item != null && item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1717 { 1718 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1719 } 17201721 returnValue = isPimActive; 17221723 return returnValue; 1724 } 17251726 public string GetProductStockByStatus(Product product, bool allowBuyIfOutOfStock) 1727 { 1728 string returnValue = string.Empty; 17291730 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 173117321733 if (product != null) 1734 { 1735 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 1736 IsabellaStock stockObject = isabellaProduct.Stock; 1737 StockStatus stockStatus = stockObject.Status; 17381739 if (ShouldShowStock(product) == false || allowBuyIfOutOfStock == true) 1740 { 1741 return returnValue; 1742 } 17431744 switch (stockStatus.ToString()) 1745 { 1746 case "InStock": 1747 returnValue = "<span class=\"text-success\">●</span>"; 1748 break; 1749 case "InStockAtRemote": 1750 returnValue = "<span class=\"text-warning\">●</span>"; 1751 break; 1752 case "OutOfStock": 1753 returnValue = "<span class=\"text-danger\">●</span>"; 1754 break; 1755 } 1756 } 1757 else 1758 { 1759 returnValue = "<span class=\"text-danger\">●</span>"; 1760 } 17611762 if (noBuyB2BandB2C) 1763 { 1764 returnValue = ""; 1765 } 17661767 return returnValue; 1768 } 1769 } 1770 </div> 1771 <div class="col-12 col-md-7 order-md-1"> 1772 @using Co3.Espresso.Base.Extensions 1773 @using Co3.Espresso.Website.Services 1774 @using Dynamicweb.Admin.dk.dynamicweb.templates 1775 @using Dynamicweb.Ecommerce.Products 1776 @using Dynamicweb.Ecommerce.Products.Categories 1777 @using Dynamicweb.Ecommerce.Products.FieldDisplayGroups 1778 @using Dynamicweb.Frontend 1779 @using ProductService = Co3.Isabella.Dw.Services.ProductService 17801781 @{ 1782 //Hard coded group ID's from Model Display Groups // 1783 List< string > modelDisplayGroupIds = new List< string >(); 1784 modelDisplayGroupIds.Add("7"); 1785 List< LoopItem > modelDisplayGroupList = new List< LoopItem >(); 1786 } 17871788 <div class="col-12 p p-accordion"> 1789 <div class="p-accordion-container "> 1790 <div class="border-bottom e-reveal-done mb-0 p-accordion-item"> 17911792 @{ 1793 int displayGroupCount = 0; 1794 } 17951796 @foreach (LoopItem groupItem in GetLoop("FieldDisplayGroups")) 1797 { 17981799 string displayGroupId = groupItem.GetString("Ecom:FieldDisplayGroup.ID"); 18001801 if (modelDisplayGroupIds.Contains(groupItem.GetString("Ecom:FieldDisplayGroup.ID"))) 1802 { 1803 modelDisplayGroupList.Add(groupItem); 1804 } 1805 else 1806 { 1807 List<LoopItem> fieldItems = new List<LoopItem>(); 1808 bool hasValues = false; 18091810 foreach (LoopItem fieldItem in groupItem.GetLoop("Fields")) 1811 { 1812 fieldItems.Add(fieldItem); 1813 if (!string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value"))) 1814 { 1815 hasValues = true; 1816 } 1817 } 18181819 if (hasValues == true) 1820 { 1821 <div class="p-accordion-toggle"> 1822 <p class="align-items-center border-top collapsed d-flex justify-content-between m-0 py-1" data-target="#accordion-id-@displayGroupId" data-toggle="collapse"> 1823 <span class="font-weight-bold line-height-sm my-0 p-accordion-toggle-text text-auto">@groupItem.GetString("Ecom:FieldDisplayGroup.Name")</span> 1824 <i class="order-last p-accordion-toggle-icon-img"> </i> 1825 </p> 1826 </div> 1827 <div class="collapse @(displayGroupCount == 0 ? "show" : string.Empty)" id="accordion-id-@displayGroupId"> 1828 <div class="pb-2"> 1829 <div class="row"> 1830 @{ 1831 int loopCounter = 0; 1832 } 183318341835 @foreach (LoopItem fieldItem in fieldItems) 1836 { 1837 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("Color")) 1838 { 1839 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1840 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1841 string fieldImage = string.Empty; 18421843 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1844 { 1845 if (fieldValue.Length == fieldLabel.Length) 1846 { 1847 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 18481849 JSON.pdfData.colors.Add(new 1850 { 1851 fieldLabel = fieldValue[sharedArrayIndex], 1852 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1853 imageUri = string.Empty 1854 }); 1855 } 1856 } 1857 } 18581859 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMatch")) 1860 { 1861 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1862 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1863 string fieldImage = string.Empty; 18641865 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1866 { 1867 if (fieldValue.Length == fieldLabel.Length) 1868 { 1869 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 18701871 JSON.pdfData.frameMatch.Add(new 1872 { 1873 fieldLabel = fieldValue[sharedArrayIndex], 1874 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1875 imageUri = string.Empty 1876 }); 1877 } 1878 } 1879 } 18801881 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("MiscFrameMaterial")) 1882 { 1883 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1884 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1885 string fieldImage = string.Empty; 18861887 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1888 { 1889 if (fieldValue.Length == fieldLabel.Length) 1890 { 1891 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 18921893 JSON.pdfData.miscFrameMaterial.Add(new 1894 { 1895 fieldLabel = fieldValue[sharedArrayIndex], 1896 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1897 imageUri = string.Empty 1898 }); 1899 } 1900 } 1901 } 19021903 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMaterial")) 1904 { 1905 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1906 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1907 string fieldImage = string.Empty; 19081909 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1910 { 1911 if (fieldValue.Length == fieldLabel.Length) 1912 { 1913 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 19141915 JSON.pdfData.frameMaterial.Add(new 1916 { 1917 fieldLabel = fieldValue[sharedArrayIndex], 1918 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1919 imageUri = string.Empty 1920 }); 1921 } 1922 } 1923 } 19241925 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("Color") || fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMatch")) 1926 { 1927 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 1928 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 1929 if (categoryFieldIds.Length == 3) 1930 { 1931 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 1932 translatedFieldLabel = translatedField.Label; 1933 } 1934 <div class="col-12"> 1935 @{ 1936 string[] colorValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1937 string[] colorLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1938 string colorImagePng = string.Empty; 1939 } 1940194119421943 @if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 1944 { 19451946 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 19471948 <div class="row"> 1949 @for (int sharedArrayIndex = 0; sharedArrayIndex < colorValue.Length; sharedArrayIndex++) 1950 { 1951 if (colorValue.Length == colorLabel.Length) 1952 { 1953 colorImagePng = colorValue[sharedArrayIndex] + ".png"; 1954 <div class="col-4 mb-2"> 1955 <img src="@Co3.Espresso.Website.Services.ImageService.Instance.GetImageURL("/Files/Images/isabella/IsabellaIcons/" + @colorImagePng, 200, 65, 0)" class="col-12 mb-1 mr-2 p-0"> 1956 <div> 1957 @colorLabel[sharedArrayIndex] 1958 </div> 1959 </div> 1960 } 1961 } 1962 </div> 1963 } 19641965 </div> 1966 } 1967 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name").Contains("VideoPresentation") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value") != "") 1968 { 1969 <div class="col-12 mb-2"> 1970 <div class="col-12 px-0 mt-1"> 1971 <div class="embed-responsive embed-responsive-16by9"> 1972 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")" width="100%" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 1973 <div class="cookieconsent-optout-marketing"> 1974 <div> 1975 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 1976 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 1977 </a> 19781979 </div> 1980 </div> 1981 </div> 1982 </div> 1983 </div> 1984 } 1985 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".jpg")) 1986 { 1987 <img class="col-12 col-md-6" src="@Co3.Espresso.Website.Services.ImageService.Instance.GetImageURL("/Files/Images/" + fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value"), 500, 0, 0)"/> 1988 } 1989 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".pdf")) 1990 { 1991 <div class="col-5 col-lg-3 d-flex"> 1992 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 1993 </div> 1994 <div class="col-7 col-lg-9 d-flex flex-column"> 1995 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Replace("../", "/Files/")"> 1996 @Translate("eCom Product = Download PDF - Link", "Download pdf here") 1997 </a> 1998 </div> 1999 } 2000 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Link")) 2001 { 2002 <div class="col-5 col-lg-3 d-flex"> 2003 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2004 </div> 2005 <div class="col-7 col-lg-9 d-flex flex-column"> 2006 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")"> 2007 @Translate("eCom Product - View more - Text", "View more") 2008 </a> 2009 </div> 2010 } 2011 else 2012 { 2013 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2014 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2015 if (categoryFieldIds.Length == 3) 2016 { 2017 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2018 translatedFieldLabel = translatedField.Label; 2019 } 20202021 switch (groupItem.GetString("Ecom:FieldDisplayGroup.ID")) 2022 { 2023 case "11": // Delivery Width 2024 <div class="col-12"> 2025 <div class="row"> 2026 <div class="col-12 col-md-6"> 2027 <p> 2028 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2029 { 2030 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2031 } 2032 else 2033 { 2034 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2035 } 2036 </p> 2037 </div> 2038 <div class="col-12 col-md-6"> 2039 @using Dynamicweb.Admin.dk.dynamicweb.templates 20402041 @{ 2042 string deliveryCarouselClassList = "d-none"; 2043 } 20442045 <div class="e-product-image-container"> 2046 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-delivery"> 2047 <div class="e-product-image-wrapper"> 2048 <div class="carousel-inner"> 2049 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2050 { 2051 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2052 { 2053 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2054 { 2055 if (image.Element.Index == 1 ) 2056 { 2057 isActive = "active"; 2058 } 2059 else 2060 { 2061 isActive = ""; 2062 } 2063 if (image.Index != 0 ) 2064 { 2065 deliveryCarouselClassList = "d-flex"; 2066 } 2067 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-delivery" data-toggle="modal"> 2068 <img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=600&Height=&Quality=90" alt="" class="e-product-image" data-target="#js-e-product-image-modal-carousel-delivery" data-slide-to="@( image.Index )"> 2069 </div> 2070 } 2071 } 2072 } 20732074 <a class="carousel-control-prev @deliveryCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-delivery"></a> 2075 <a class="carousel-control-next @deliveryCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-delivery"></a> 20762077 </div> 2078 </div> 2079 <ol class="carousel-indicators @deliveryCarouselClassList"> 2080 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2081 { 2082 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2083 { 2084 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2085 { 2086 if (image.Element.Index == 1 ) 2087 { 2088 isActive = "active"; 2089 } 2090 else 2091 { 2092 isActive = ""; 2093 } 2094 <li class="@isActive" data-target="#js-e-product-image-carousel-delivery" data-slide-to="@( image.Index )"></li> 2095 } 2096 } 2097 } 2098 </ol> 2099 </div> 2100 </div> 2101 @using Dynamicweb.Admin.dk.dynamicweb.templates 2102 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-delivery" data-backdrop="false" data-keyboard="true"> 2103 <div class="modal-dialog"> 2104 <div class="modal-content"> 2105 <div class="modal-body"> 21062107 <button type="button" class="close" data-dismiss="modal"> 2108 <i class="material-icons">close</i> 2109 </button> 21102111 <div id="js-e-product-image-modal-carousel-delivery" class="carousel slide" data-keyboard="true" data-interval="false"> 2112 <div class="carousel-inner"> 2113 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2114 { 2115 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2116 { 2117 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2118 { 2119 if (image.Element.Index == 1 ) 2120 { 2121 isActive = "active"; 2122 } 2123 else 2124 { 2125 isActive = ""; 2126 deliveryCarouselClassList = "d-flex"; 2127 } 2128 <div class="carousel-item @isActive" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString("Ecom:Product:Detail.Image.Clean")&Format=jpg&Width=&Height=1800&Quality=90)"> 2129 </div> 2130 } 2131 } 2132 } 2133 </div> 21342135 <ol class="carousel-indicators @deliveryCarouselClassList"> 2136 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2137 { 2138 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2139 { 2140 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2141 { 2142 if (image.Element.Index == 1 ) 2143 { 2144 isActive = "active"; 2145 } 2146 else 2147 { 2148 isActive = ""; 2149 deliveryCarouselClassList = "d-flex"; 2150 } 2151 <li class="@isActive" data-target="#js-e-product-image-modal-carousel-delivery" data-slide-to="@( image.Index + 1 )"> 2152 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=50&Height=&Quality=75)"></span> 2153 </li> 2154 } 2155 } 2156 } 2157 </ol> 21582159 <a class="carousel-control-prev @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="prev"></a> 2160 <a class="carousel-control-next @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="next"></a> 21612162 </div> 2163 </div> 2164 </div> 2165 </div> 2166 </div> 21672168 </div> 2169 </div> 2170 </div> 2171 break; 2172 case "2": // Material 2173 <div class="col-12"> 2174 @{ 2175 string materialImg = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) + ".png"; 21762177 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2178 { 2179 JSON.pdfData.materials.Add( new 2180 { 2181 id = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ), 2182 label = translatedFieldLabel, 2183 text = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" ), 2184 path = string.Format( "/Files/Images/isabella/IsabellaIcons/{0}", materialImg ), 2185 imageUri = string.Empty 2186 } ); 2187 } 21882189 bool isEditor = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName") == "EditorText"; 21902191 } 21922193 @if ( string.IsNullOrEmpty(fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )) == false ) 2194 { 2195 if(isEditor){ 2196 <p class="mb-1">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</p> 2197 } 2198 else 2199 { 2200 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 2201 <div class="d-flex align-items-start mb-3"> 2202 <img src="/Files/Images/isabella/IsabellaIcons/@materialImg" style="width: 45px" class="mr-2"> 2203 <div> 2204 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2205 { 2206 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2207 } 2208 else 2209 { 2210 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2211 } 2212 </div> 2213 </div> 2214 } 221522162217 } 22182219 </div> 2220 break; 2221 case "3": // Measures 2222 if(loopCounter == 0) { 2223 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2224 { 2225 if ( imageCategories.GetString( "Category.SystemName" ) == "MeasureIllustrations" ) 2226 { 2227 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2228 { 2229 <div class="col-12"> 2230 <img src="@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )" alt="" class="col-12 p-0 mb-3"> 2231 </div> 2232 } 2233 } 2234 } 22352236 } 22372238 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc") || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc2")) 2239 { 2240 <div class="col-12 col-md-6"> 2241 <p class="font-weight-bold"> 2242 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2243 { 2244 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2245 } 2246 else 2247 { 2248 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2249 } 2250 </p> 2251 </div> 2252 } 2253 else if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2254 <div class="col-5 col-lg-3 d-flex"> 2255 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2256 </div> 2257 <div class="col-7 col-lg-9 d-flex"> 2258 <p class="mb-0 pb-0"> 2259 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2260 { 2261 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2262 } 2263 else 2264 { 2265 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2266 } 2267 </p><br /> 2268 </div> 22692270 JSON.pdfData.measures.Add( new 2271 { 2272 value = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 2273 name = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" ) 2274 } ); 2275 } 2276 break; 2277 case "1": // Details & Features 2278 if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2279 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("VideoPresentation")) { 2280 <div class="col-12 mb-2"> 2281 <div class="col-12 px-0"> 2282 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 22832284 <div class="embed-responsive embed-responsive-16by9"> 2285 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" width="100%" height="210" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 2286 <div class="cookieconsent-optout-marketing"> 2287 <div> 2288 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2289 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2290 </a> 22912292 </div> 2293 </div> 2294 </div> 2295 </div> 2296 </div> 2297 } else { 2298 <div class="col-5 col-lg-3 d-flex"> 2299 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2300 </div> 2301 <div class="col-7 col-lg-9 d-flex flex-column"> 2302 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameGuide" || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameIllustration") { 2303 <a href="@GetString( "Ecom:Product.CategoryField.AccessoriesGeneral.FrameGuide.Value" )">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</a> 2304 } else { 2305 if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2306 { 2307 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2308 } 2309 else 2310 { 2311 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2312 } 2313 } 2314 <br /> 2315 </div> 2316 } 2317 } 2318 break; 2319 case "5": // Assembly 23202321 if(loopCounter == 0) { 2322 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2323 { 2324 if ( imageCategories.GetString( "Category.SystemName" ).Contains("AssemblyIllustrations" )) 2325 { 2326 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2327 { 2328 <div class="col-12 col-lg-8"> 2329 <img src="/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=png&Width=600&Height=&Quality=90" alt="" class="col-12 p-0 mb-3"> 2330 </div> 2331 } 2332 } 2333 } 23342335 } 2336 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "AssemblyGuide" && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2337 { 2338 <div class="col-12 mb-3"> 2339 <p class="font-weight-bold mb-1">@Translate( "eCom Product - Download installation instructions - Header", "Opstillingsvejledning" )</p> 2340 <a class="text-primary" href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download> 2341 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download installation instructions - Link", "Download opstillingsvejledning" ) 2342 </a> 2343 </div> 2344 } 2345 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo1") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2346 { 2347 <div class="col-12"> 2348 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo1.Value.Clean" )</p> 2349 <div class="embed-responsive embed-responsive-16by9"> 2350 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" width="100%" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 2351 <div class="cookieconsent-optout-marketing"> 2352 <div> 2353 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2354 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2355 </a> 23562357 </div> 2358 </div> 2359 </div> 2360 </div> 2361 } 2362 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo2") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2363 { 2364 <div class="col-12"> 2365 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo2.Value.Clean" )</p> 2366 <div class="embed-responsive embed-responsive-16by9"> 2367 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" width="100%" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 2368 <div class="cookieconsent-optout-marketing"> 2369 <div> 2370 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2371 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2372 </a> 23732374 </div> 2375 </div> 2376 </div> 23772378 </div> 2379 } 2380 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo3") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2381 { 2382 <div class="col-12"> 2383 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 2384 <div class="embed-responsive embed-responsive-16by9"> 2385 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" width="100%" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 2386 <div class="cookieconsent-optout-marketing"> 2387 <div> 2388 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2389 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2390 </a> 23912392 </div> 2393 </div> 2394 </div> 2395 </div> 2396 } 2397 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MaintenanceAdvice") || string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false && fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyLabelVideo") == false ) 2398 { 2399 <div class="col-5 col-lg-3 d-flex"> 2400 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2401 </div> 2402 <div class="col-7 col-lg-9 d-flex flex-column"> 2403 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2404 { 2405 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2406 } 2407 else 2408 { 2409 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2410 } 2411 </div> 2412 } 2413 break; 2414 default: 2415 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2416 { 2417 <div class="col-5 col-lg-3 d-flex"> 2418 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2419 </div> 2420 <div class="col-7 col-lg-9 d-flex flex-column"> 2421 @if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True") 2422 { 2423 string text = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel"); 2424 if (text.Contains(",")) 2425 { 2426 string[] splitText = text.Split(','); 2427 text = string.Join(", ", splitText); 2428 } 2429 @text<br/> 2430 } 2431 else 2432 { 2433 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br/> 2434 } 2435 </div> 2436 } 2437 break; 2438 } 2439 } 2440 loopCounter++; 2441 } 2442 </div> 2443 </div> 2444 </div> 2445 displayGroupCount++; 2446 } 2447 } 24482449 } 2450 </div> 2451 </div> 2452 </div> 245324542455 @functions 2456 { 2457 public Field GetTranslatedCategoryFieldName(string categoryId, string fieldId) 2458 { 2459 Field result = null; 24602461 Category category = Category.GetCategoryById(categoryId, Dynamicweb.Ecommerce.Common.Context.LanguageID); 24622463 Field field = category.Fields.FirstOrDefault(f => f.Id.Equals(fieldId)); 24642465 if (field != null && string.IsNullOrEmpty(field.Label) == false) 2466 { 24672468 result = field; 2469 } 24702471 return result; 2472 } 2473 } 24742475 </div> 2476 </div> 2477 </div> 24782479 <script> 2480 dataLayer.push({ 2481 "ecommerce": { 2482 "detail": { 2483 "products": [{ 2484 "name": "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2485 "id": "@GetString("Ecom:Product.Number")", 2486 "price": "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()" 2487 }] 2488 } 2489 } 2490 }); 24912492 /*New GA4*/ 2493 dataLayer.push({ 2494 event: 'view_item', 2495 ecommerce: { 2496 items: [ 2497 { 2498 item_name: "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2499 item_id: "@GetString("Ecom:Product.Number")", 2500 price: @eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript().Replace( ",", "" ) 2501 } 2502 ] 2503 } 2504 }); 2505 </script> 25062507 @sectionEnd() 2508250925102511 @using Dynamicweb.SystemTools 25122513 @{ 2514 string boughtWithHeading = Translate("eCom - Recommended Products - Bought With - Heading", "Ofte købt sammen med"); 2515 string boughtWithFallbackHeading = Translate("eCom - Recommended Products - Best Sellers - Heading", "Populære produkter"); 2516 } 25172518 @if(!isOutlet && !isCamplet){ 2519 @sectionStart( sectionClasses: "e-section py-2 bg-septenary-opacity-low border-bottom js-e-recommended-products-container" ) 2520 <div class="col-12 js-e-recommended-products" data-recommendation="boughtWith" data-heading="@boughtWithHeading" data-fallback-heading="@boughtWithFallbackHeading"> 25212522 <div class="js-e-recommended-products-container"> 2523 <div class="e-loading-overlay e-products-loading-overlay js-e-products-loading-overlay is-loading"> 2524 <div class="e-loading-spinner"></div> 2525 </div> 2526 </div> 25272528 </div> 2529 @sectionEnd() 2530 } 25312532253325342535 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) ) == false ) 2536 { 2537 <section class="e-section js-e-section e-theme-secondary mb-0 p p-0 p-mosaic p-mosaic-img-right"> 2538 <div class="container-fluid px-0"> 2539 <div class="e-reveal-done no-gutters row"> 2540 <div class="align-self-center col-12 col-md-6 p-txt-container"> 2541 <h2>@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" )</h2> 2542 @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) 2543 <p> 2544 <a class="arrow-white isabella-arrow text-white" href="@GetString( modelTypeLink )"> 2545 @Translate( "eCom Product - Model - Read more about - Link", "Læs mere om" ) @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" ) @Translate( "eCom Product - Model - series - Link", "serien" ) 2546 </a> 2547 </p> 2548 </div> 2549 <div class="col-12 col-md-6 e-section-height-md order-md-last p-img-container position-relative"> 2550 <div class="bg-center-middle bg-cover p-img pos-b-0 position-absolute pos-l-0 pos-r-0 pos-t-0" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeImage.Value.Clean" )&Format=png&Width=1280&Height=0&Quality=75);" title=""></div> 2551 </div> 2552 </div> 2553 </div> 2554 </section> 2555 } 25562557 <code class="js-e-breadcrumb-item-append" data-text="@HttpUtility.HtmlAttributeEncode( GetString( "Ecom:Product.Name" ) )" data-link="@HttpUtility.HtmlAttributeEncode( eProductService.Instance.GetProductLink( GetString( "Ecom:Product.PrimaryOrFirstGroupID" ), GetString( "Ecom:Product.ID" ) ) )"></code> 2558 <div class="e-loading-overlay e-pdf-loading-overlay js-e-search-loading-overlay"> 2559 <div class="e-loading-spinner"></div> 2560 </div> 2561 <script> 2562 var isabellaProductData = @JsonService.Instance.ToJson( JSON ) 2563 </script> 25642565 @using Dynamicweb.Frontend 2566 @{ 2567 string currencySeparatorDecimal = PageView.Current().Area.CultureInfo.NumberFormat.NumberDecimalSeparator; 2568 string currencySeparatorInteger = PageView.Current().Area.CultureInfo.NumberFormat.NumberGroupSeparator; 2569 string productLink = eProductService.Instance.GetProductLink( GetString("Ecom:Product.PrimaryOrFirstGroupID"), GetString("Ecom:Product.ID") ); 2570 } 25712572 <script type="application/ld+json"> 2573 { 2574 "@@context" : "http://schema.org", 2575 "@@type" : "Product", 2576 "description" : "@GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ).StripHtml()", 2577 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 2578 "name" : "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).StripHtml()", 2579 "image" : "@( HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + GetString("Ecom:Product.ImageDefault.Clean") )", 2580 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )", 2581 "sku" : "@GetString("Ecom:Product.Number")", 2582 "offers" : { 2583 "@@type" : "Offer", 2584 "availability" : @( GetInteger( "Ecom:Product.Stock" ) > 0 ? "\"http://schema.org/InStock\"" : "\"http://schema.org/OutOfStock\"" ), 2585 "price" : "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()", 2586 "priceCurrency" : "@EcomContext.Currency.Code", 2587 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )" 2588 } 2589 } 2590 </script> 25912592 </div> 25932594 @if (!isOutlet) 2595 { 2596 <related-products type="RelatedProducts" product-id="@product.Id" variant-id="@product.VariantId"></related-products> 2597 } 25982599 @sectionStart() 260026012602 @using Co3.Espresso.Base.Extensions 2603 @using Co3.Espresso.Website.Models.FrontEnd 2604 @using Co3.Espresso.Website.Services 2605 @using Dynamicweb.Frontend 26062607 <script id="js-e-handlebars-tmpl-recommended-products" type="text/x-handlebars-template"> 26082609 <h4 class="isabella-text-bullets-left mb-3"> 2610 {{heading}} 2611 </h4> 2612 <div class="e-products f"> 26132614 <div class="row"> 2615 {{#each products}} 2616 {{#if pimActive}} 2617 <div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"> 2618 <div class="card border-1 mb-6"> 2619 <a href="{{url}}"> 2620 <img src="{{imageDefault}}" alt="{{name}} {{productType}}" class="col-12 p-0"> 2621 {{#if news}} 2622 <div class="isabella-product-item-news"> 2623 @Translate("Ecom Product - News Badge - Text","Nyhed") 2624 </div> 2625 {{/if}} 2626 </a> 2627 <div class="card-body p-1 p-lg-3"> 2628 <h4 class="e-products-item-name mb-0"> 2629 <a href="{{url}}"> 2630 {{{name}}} 2631 </a> 2632 </h4> 26332634 </div> 2635 </div> 2636 </div> 26372638 {{/if}} 2639 {{/each}} 2640 </div> 2641 </div> 26422643 </script> 264426452646 @SnippetStart("ProductOpenGraph") 2647 @{ 2648 string openGraphTitle = product.Meta.Title; 2649 if (string.IsNullOrEmpty(openGraphTitle)) 2650 { 2651 openGraphTitle = product.Name; 2652 } 2653 string openGraphDescription = product.Meta.Description; 2654 if (string.IsNullOrEmpty(openGraphDescription)) 2655 { 2656 openGraphDescription = product.ShortDescription; 2657 } 2658 string openGraphImage = $"{HttpContext.Current.Request.Url.Scheme}://{HttpContext.Current.Request.Url.Host}/admin/public/getimage.ashx?Crop=0&Image={productImage}&Format=jpg&Width=1820&Height=1000&Quality=90"; 2659 } 2660 <meta property="og:title" content="@openGraphTitle"> 2661 <meta property="og:description" content="@openGraphDescription.StripHtml()"> 2662 <meta property="og:image" content="@openGraphImage"> 2663 @SnippetEnd("ProductOpenGraph")