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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\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:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 435
at Co3.Isabella.Dw.Services.ProductService.GetPrice(String productId, String variantId, String languageId) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 475
at CompiledRazorTemplates.Dynamic.RazorEngine_37b0d48f870d403989481bf9319a0522.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 1711
at CompiledRazorTemplates.Dynamic.RazorEngine_37b0d48f870d403989481bf9319a0522.Execute() in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Product\espresso.cshtml:line 1432
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"; 368369 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService(); 370 Product product = dwProductService.GetProductById( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ), Context.LanguageID ); 371 bool hidePricePdf = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 372 bool disableRelatedProducts = PageView.Current().Area.Item["DisableRelatedProducts"] != null && PageView.Current().Area.Item["DisableRelatedProducts"]?.ToString() == "True"; 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 signbuilderDescription = productDescription; 381 if (signbuilderDescription.Length > 250) 382 { 383 signbuilderDescription = signbuilderDescription.Substring(0, 250); 384 } 385 string signBuilderUrl = $"{signBuilderUrlBase}&productSign=true&headline={HttpUtility.UrlEncode(productHeadline)}&copy={HttpUtility.UrlEncode(signbuilderDescription)}&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))}&currency={HttpUtility.UrlEncode(Context.Currency.Code)}&hidePrice={hidePricePdf}"; 386 string OrderContext = PageView.Current().Area.Item[ "ContextCart" ]?.ToString(); 387388 if ( string.IsNullOrEmpty( PageView.Current().Area.Domain ) ) 389 { 390 globalAreaName = PageView.Current().Area.Name; 391 } 392 bool noBuyB2BandB2CPdf = PageView.Current().Area.Item[ "EcommerceNoBuyB2CB2B" ] != null && ( bool ) PageView.Current().Area.Item[ "EcommerceNoBuyB2CB2B" ]; 393 bool isHybridShopPdf = noBuyB2BandB2CPdf && isUserAuthenticated && shopType == "Hybrid"; 394395 dynamic JSON = new 396 { 397 productid = GetValue( "Ecom:Product.ID" ), 398 variantoptions = new List< dynamic >(), 399 variantcombinations = new List< dynamic >(), 400 pdfData = new 401 { 402 name = productHeadline, 403 headline = productHeadline, 404 productnumber = GetString( "Ecom:Product.Number" ), 405 price = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).Price, 406 description = productDescription, 407 image = string.Format("/admin/public/getimage.ashx?Crop=0&Image={0}&Format=jpg&Width=1820&Height=1000&Quality=90",productImage ), 408 currency = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 409 logo = "Files/Images/isabella/signbuilder/signbuilder-logo.png", 410 colors = new List< dynamic >(), 411 frameMatch = new List< dynamic >(), 412 miscFrameMaterial = new List<dynamic>(), 413 frameMaterial = new List<dynamic>(), 414 materials = new List< dynamic >(), 415 measures = new List< dynamic >(), 416 isHybrid = isHybridShopPdf, 417 noBuyB2BandB2C = isHybridShopPdf ? false : (bool) Espresso.Page.Area.Item[ "EcommerceNoBuyB2CB2B" ], 418 isAccessory = GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true, 419 hidePrice = hidePricePdf, 420 translations = new { 421 relatedProductHeaderProduct = Translate( "PDF - Related Products Header - Product", "Added product" ), 422 relatedProductHeaderPrice = Translate( "PDF - Related Products Header - Price", "Price" ), 423 relatedProductTotalPrice = Translate( "PDF - Related Products Header - Total Price", "Total" ), 424 framesHeader = Translate( "PDF - Frames Header", "Stel muligheder" ), 425 materialsHeader = Translate( "PDF - Materials Header", "Materials" ), 426 measuresHeader = Translate( "PDF - Measures Header", "Measures" ) 427 } 428 } 429 }; 430431 @* Global Image modal variable used in part image carousel *@ 432 string isActive = string.Empty; 433434 IEnumerable< Product > parentProducts = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedParentProducts( product ); 435436 string eComCountryCode = Espresso.Page.Area.Item[ "EcommerceCountryCode" ] != null ? Espresso.Page.Area.Item[ "EcommerceCountryCode" ].ToString() : ""; 437 string modelTypeLink = getModelTypeLink(); 438439 string dwProductId = GetString("Ecom:Product.ID"); 440 string dwProductVariantId = GetString("Ecom:Product.VariantID"); 441442 } 443444 @sectionEnd() 445446 <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"> 447 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == false ) 448 { 449 <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"> 450 <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> 451 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 452 <div class="isabella-product-item-news"> 453 @Translate("Ecom Product - News Badge - Text","Nyhed") 454 </div> 455 } 456 <a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link" href=""> 457 <i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i> 458 </a> 459 </section> 460 } 461462 @sectionStart( sectionClasses: "e-section py-2 isabella-camplet-dark" ) 463 <div class="col-12"> 464 <div class="row"> 465 <div class="col-12 col-md-7"> 466 <div class="e-product-text-container"> 467 <h1 class="e-product-name"> 468 @eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ) 469470 </h1> 471 <div class="e-product-text mb-3"> 472 @GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ) 473 </div> 474475476 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.Value" ) ) == false ) 477 { 478 <p class="mb-4"> 479 <a class="arrow-primary isabella-arrow" href="@GetString( modelTypeLink )"> 480 @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" ) 481 </a> 482 </p> 483 } 484 </div> 485 </div> 486 <div class="col-12 col-md-5"> 487 @using Dynamicweb.Admin.dk.dynamicweb.templates 488 @using WebSupergoo.ImageGlue6 489 @using System.Text.RegularExpressions; 490491 @{ 492 string moodCarouselClassList = "d-none"; 493 int currentIndex = 0; 494 string productVideo = GetString( "Ecom:Product:Field.Video" ); 495496 var YoutubeShowControls = "True"; 497 var YoutubeShowTitle = ""; 498 var YoutubeShowLogo = "False"; 499 var YoutubeShowRelated = "False"; 500501 var Url = productVideo; 502 var UrlRegex = new Regex( @"^.*((youtu.be\/|vimeo.com\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*" ); 503504 Match videoUrlMatch = UrlRegex.Match( Url ); 505 var EmbedUrl = String.Empty; 506507 if( videoUrlMatch.Success && videoUrlMatch.Groups.Count >= 8 ) { 508 EmbedUrl = string.Format( "https://www.youtube.com/embed/{0}?rel=0&controls={1}&showinfo={2}&modestbranding={3}&rel={4}", videoUrlMatch.Groups[ 7 ].Value, YoutubeShowControls == "True" ? "1" : "0", YoutubeShowTitle == "True" ? "1" : "0", YoutubeShowLogo == "True" ? "0" : "1", YoutubeShowRelated == "True" ? "1" : "0" ); 509 } 510511 var videoUrlID = videoUrlMatch.Groups[ 7 ].Value; 512 } 513514 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true ) 515 { 516 <div class="e-product-image-container position-relative isabella-product-image-container-mood"> 517 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 518 <div class="isabella-product-item-news zi-sticky"> 519 @Translate("Ecom Product - News Badge - Text","Nyhed") 520 </div> 521 } 522 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 523 <div class="e-product-image-wrapper"> 524 <div class="carousel-inner"> 525 <div class="active carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 526 <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"> 527 </div> 528529 @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 if ( image.Index != null ) 536 { 537 moodCarouselClassList = "d-flex"; 538 } 539 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 540 <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)"> 541 </div> 542 } 543 } 544 } 545546 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 547 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 548549 </div> 550 </div> 551552 @* 553 <ol class="carousel-indicators @moodCarouselClassList"> 554 <li data-target="#js-e-product-image-carousel" class="active" data-slide-to="0"></li> 555 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 556 { 557 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 558 { 559 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 560 { 561 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 562 } 563 } 564 } 565 </ol> 566 *@ 567568 @{ 569 currentIndex = 0; 570 } 571572 @* 573 <ol class="carousel-indicators @moodCarouselClassList"> 574 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 575 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span> 576 </li> 577 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 578 { 579 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 580 { 581 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 582 { 583 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 584 int imageIndex = image.Index + 1; 585 currentIndex = imageIndex; 586 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 587 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 588 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span> 589 </li> 590 } 591 } 592 } 593 </ol> 594 *@ 595596 <ol class="carousel-indicators @moodCarouselClassList"> 597 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 598 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.ImageDefault.Default.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span> 599 </li> 600601 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 602 { 603 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 604 { 605 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 606 { 607 int imageIndex = image.Index + 1; 608 currentIndex = imageIndex; 609 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 610 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 611 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span> 612 </li> 613 } 614 } 615 } 616 @if ( !string.IsNullOrEmpty( productVideo ) ) 617 { 618 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 619 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 620 </li> 621 } 622623 </ol> 624625626627 </div> 628 </div> 629 } 630 else 631 { 632633 <div class="e-product-image-container isabella-product-image-container-mood"> 634 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 635 <div class="e-product-image-wrapper"> 636 <div class="carousel-inner"> 637638 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 639 { 640 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 641 { 642 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 643 { 644 if ( image.Element.Index == 1 ) 645 { 646 isActive = "active"; 647 } 648 else 649 { 650 isActive = ""; 651 } 652 if ( image.Index != 0 ) 653 { 654 moodCarouselClassList = "d-flex"; 655 } 656 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 657 <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 )"> 658 </div> 659 } 660 } 661 } 662 @if ( !string.IsNullOrEmpty( productVideo ) ) { 663 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 664 <div class="embed-responsive embed-responsive-16by9"> 665 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@EmbedUrl" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 666 </div> 667 </div> 668 } 669670 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 671 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 672673 </div> 674 </div> 675676 @{ 677 currentIndex = 0; 678 } 679680 <ol class="carousel-indicators @moodCarouselClassList"> 681682683 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 684 { 685 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 686 { 687 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 688 { 689 int imageIndex = image.Index; 690 currentIndex = imageIndex; 691 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 692 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 693 <span style="background-image: url(/admin/public/getimage.ashx?Crop=0&Image=@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )&Format=jpg&Width=100&Height=&Quality=75)"></span> 694 </li> 695 } 696 } 697 } 698 @if ( !string.IsNullOrEmpty( productVideo ) ) 699 { 700 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 701 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 702 </li> 703 } 704705 </ol> 706707708709710711 </div> 712 </div> 713 } 714715716 @using Dynamicweb.Admin.dk.dynamicweb.templates 717 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-mood" data-backdrop="false" data-keyboard="true"> 718 <div class="modal-dialog"> 719 <div class="modal-content"> 720 <div class="modal-body"> 721722 <button type="button" class="close" data-dismiss="modal"> 723 <i class="material-icons">close</i> 724 </button> 725726 <div id="js-e-product-image-modal-carousel-mood" class="carousel slide" data-keyboard="true" data-interval="false"> 727 <div class="carousel-inner"> 728729 <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)"> 730 </div> 731 @foreach (LoopItem imageCategories in GetLoop("ImageCategories")) 732 { 733 if (imageCategories.GetString("Category.SystemName") == "MoodImages") 734 { 735 foreach (ElementWithIndex<LoopItem> image in imageCategories.GetLoop("Category.Images").WithIndex()) 736 { 737 if (image.Element.Index == 1) 738 { 739 isActive = "active"; 740 } 741 else 742 { 743 isActive = ""; 744 } 745 <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)"> 746 </div> 747 } 748 } 749 } 750 </div> 751752 <ol class="carousel-indicators @moodCarouselClassList"> 753 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="0"> 754 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=50&Height=&Quality=75)"></span> 755 </li> 756 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 757 { 758 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 759 { 760 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 761 { 762 if (image.Element.Index == 1 ) 763 { 764 isActive = "active"; 765 } 766 else 767 { 768 isActive = ""; 769 } 770 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@( image.Index + 1 )"> 771 <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> 772 </li> 773 } 774 } 775 } 776 </ol> 777778 <a class="carousel-control-prev @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="prev"></a> 779 <a class="carousel-control-next @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="next"></a> 780781 </div> 782 </div> 783 </div> 784 </div> 785 </div> 786787 </div> 788 </div> 789 </div> 790 @sectionEnd() 791792 @sectionStart( sectionClasses: "e-section pb-2 isabella-camplet-dark" ) 793 <div class="col-12"> 794 <div class="row"> 795 <div class="col-12 col-md-5 mb-3 mb-md-0 order-md-2"> 796 @using System.Runtime.Remoting.Contexts 797 @using System.Text.RegularExpressions 798 @using Co3.Espresso.Base.Extensions 799 @using Co3.Espresso.Website.Services 800 @using Dynamicweb.Ecommerce.Extensibility.Provider 801 @using Dynamicweb.Ecommerce.Products 802 @using Dynamicweb.Frontend 803 @using Co3.Isabella.Data.DAL.Models 804 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 805 @using Dynamicweb.Content.Items 806 @using Dynamicweb.Ecommerce.International 807 @using Dynamicweb.Ecommerce.Orders 808 @using Dynamicweb.Security.UserManagement 809 @using Newtonsoft.Json 810 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 811812 @{ 813 double colli = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 814 double value = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 815816 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 817 IsabellaStock stockObject = isabellaProduct.Stock; 818 StockStatus mainStockStatus = stockObject.Status; 819 double stock = stockObject.Stock; 820 bool allowBuyIfOutOfStock = false; 821 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 822823 bool canBuyIfOutOfStock = true; 824 double totalStockMainAndRelated = 0; 825826 bool pimActive = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.PIMActive.Value"); 827 bool lockColliB2c = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2C.Value"); 828 bool lockColliB2b = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2B.Value"); 829 bool hidePriceFieldValue = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.HidePrice.Value"); 830 bool userCanBuy = false; 831 bool lockColli = false; 832833 bool isIsabellaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsabellaProduct.Value"); 834 bool isCampletProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.CampletProduct.Value"); 835 bool isVillaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.VillaProduct.Value"); 836 bool isAccessorieProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value"); 837838 bool isNoBuyB2C = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value"); 839 bool isNoBuyB2B = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value"); 840841 string userDealerType = string.Empty; 842843 bool isDiscontinued = pimActive == false; 844 bool hasRelatedProducts = false; 845846 totalStockMainAndRelated += stock; 847848 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 849850 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && shopType == "Hybrid"; 851 bool isNoBuyWithPricesShop = noBuyB2BandB2C && shopType == "NoBuy"; 852853 bool hidePrice = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 854855856 if (isUserAuthenticated == false) 857 { 858 if (mainStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) 859 { 860 canBuyIfOutOfStock = false; 861 } 862 userCanBuy = true; 863 } 864 else 865 { 866 Item item = null; 867 if ( !string.IsNullOrEmpty(PageView.Current().User.ItemType)) 868 { 869 item = Dynamicweb.Services.Items.GetItem(PageView.Current().User.ItemType, PageView.Current().User.ItemId); 870 } 871872873 if (item != null && item.ContainsKey("Type") && item["Type"] != null) 874 { 875 userDealerType = item["Type"].ToString(); 876 } 877 if (string.IsNullOrEmpty(userDealerType)) 878 { 879 userDealerType = string.Empty; 880 } 881882883 if (isIsabellaProduct && userDealerType.Contains("Isabella") == true) 884 { 885 userCanBuy = true; 886 } 887 else if (isCampletProduct && userDealerType.Contains("Camplet") == true) 888 { 889 userCanBuy = true; 890 } 891 else if (isVillaProduct && userDealerType.Contains("Villa") == true) 892 { 893 userCanBuy = true; 894 } 895 } 896897 if (isUserAuthenticated == false && lockColliB2c == true) 898 { 899 lockColli = true; 900 } 901 else if (isUserAuthenticated == true && lockColliB2b == true) 902 { 903 lockColli = true; 904 } 905906 if (colli == 0) 907 { 908 colli = 0; 909 value = 1; 910 } 911 Dictionary<string, RelatedProductInfo> temp = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedProducts(product); 912913 string howItWorksPage = Espresso.Page.Area.Item["Product_Page_HowItWorks"]?.ToString().ToLower().Replace("default.aspx?id=", ""); 914 object findDealerLink = Espresso.Page.Area.Item["FindDealer"]?.ToString(); 915916 if (isHybridShop || isNoBuyWithPricesShop) 917 { 918 userCanBuy = false; 919 canBuyIfOutOfStock = false; 920 } 921922 } 923924 <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"> 925 <input name="CartCmd" type="hidden" value="addMulti"> 926 <input name="Redirect" type="hidden" value=""> 927 <input name="Name" type="hidden" value="@eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"))"> 928 <input name="Number" type="hidden" value="@GetString("Ecom:Product.Number")"> 929 @if (hidePrice == false) 930 { 931 <input name="Price" type="hidden" value="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price.ToJavaScript()"> 932 } 933934 <input name="OrderContext" type="hidden" value="@OrderContext"> 935 <input name="ProductCurrencyCode" type="hidden" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 936 <h3 class="mb-1 mt-1">@Translate("eCom Product - Add To Cart Form Table - Choose product - Heading", "Vælg Produkt")</h3> 937 @if (pimActive == false) 938 { 939 <div class="alert alert-danger"> 940 <p class="m-0"> 941 @Translate("eCom Product - Add To Cart Form Table - Model Discontinued - Text", "Denne model er udgået, nedenfor kan du købe tilbehør") 942 </p> 943 </div> 944 } 945946 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 947 { 948 <div class="alert alert-danger @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 949 <p class="m-0"> 950 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 951 { 952 @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") 953 } 954 else 955 { 956 @Translate("eCom Product - Add To Cart Form Table - Model Out of Stock - Text", "Denne model er udsolgt, nedenfor kan du købe tilbehør") 957 } 958 </p> 959 </div> 960 } 961962 <div class="table-container" role="table"> 963964 <div class="flex-table header" role="rowgroup"> 965 <div class="first flex-row w-40" role="columnheader"></div> 966 @if (noBuyB2BandB2C == false) 967 { 968 <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> 969 <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> 970 } 971 @if ((isHybridShop == true && hidePrice == false) || isNoBuyWithPricesShop) 972 { 973 <div class="flex-row w-40" role="columnheader"> 974 @Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris") 975 </div> 976 } 977 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 978 </div> 979 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 980 <div class="align-self-center first flex-row w-40" role="cell"> 981 @eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 982 <br/> 983 <span class="text-muted">@GetString("Ecom:Product.Number")</span> 984 </div> 985 @if (noBuyB2BandB2C == false) 986 { 987 <div class="align-self-center center flex-row w-10" role="cell"> 988 @if (isDiscontinued == false && noBuyB2BandB2C == false) 989 { 990 @GetProductStockByStatus(product, allowBuyIfOutOfStock) 991 } 992 </div> 993 } 994 @if (noBuyB2BandB2C == false) 995 { 996 <div class="align-self-center center flex-row w-30" role="cell"> 997 @if (isDiscontinued == false) 998 { 999 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1000 <div class="d-flex flex-column"> 1001 @if (!noBuyB2BandB2C && !hidePrice) 1002 { 1003 <div @(priceCheck <= 0 ? "hidden" : string.Empty)> 1004 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1005 </div> 1006 } 1007 @if (noBuyB2BandB2C) 1008 { 1009 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1010 } 1011 else if (mainStockStatus == StockStatus.InStockAtRemote) 1012 { 1013 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1014 } 1015 else if (canBuyIfOutOfStock == false && allowBuyIfOutOfStock == false) 1016 { 1017 <p class="m-0 text-danger">@Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt")</p> 1018 } 1019 </div> 1020 } 10211022 </div> 1023 } 1024 else if (isHybridShop || isNoBuyWithPricesShop) 1025 { 1026 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1027 if (!hidePrice || isNoBuyWithPricesShop) 1028 { 1029 <div class="align-self-center center flex-row w-40" role="cell"> 1030 <div class="d-flex flex-column small"> 1031 <span> 1032 @if (priceCheck > 0) 1033 { 1034 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1035 } 1036 else 1037 { 1038 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Missing Price - Text", "Pris mangler")</p> 1039 } 1040 </span> 10411042 </div> 1043 </div> 1044 } 1045 } 1046 <div class="align-self-center flex-row w-20 ml-auto" role="cell"> 1047 @if (isDiscontinued == false && canBuyIfOutOfStock == true) 1048 { 1049 <input name="ProductID0" type="hidden" value="@GetString("Ecom:Product.ID")"> 1050 <input id="ProductLoopCounter0" name="ProductLoopCounter0" type="hidden" value="0"> 1051 <input name="VariantID0" type="hidden" value=""> 1052 if (noBuyB2BandB2C || isHybridShop || isNoBuyWithPricesShop) 1053 { 1054 @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")) 1055 } 1056 else 1057 { 1058 if (lockColli) 1059 { 1060 <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"> 1061 } 1062 else 1063 { 1064 <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"> 1065 } 1066 } 1067 } 1068 else 1069 { 1070 <p class="m-0 text-danger"> 1071 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 1072 { 1073 @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")) 1074 } 1075 else if (isDiscontinued == true) 1076 { 1077 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1078 } 10791080 </p> 1081 } 1082 </div> 1083 </div> 1084 </div> 10851086 @if (temp != null) 1087 { 1088 int relatedCounter = 1; 1089 <div class="accordion" id="relatedProductsCollapse"> 10901091 @foreach (string key in temp.Keys) 1092 { 1093 if (string.IsNullOrEmpty(key) == false) 1094 { 1095 bool doValidateFrame = !isHybridShop || key == "Frames" || key == "AccessoriesWithFrames"; 10961097 <div class="border-top isabella-product-form-heading py-1" id="isabella-product-form-heading-@key" data-key="@key"> 1098 <h4 class="mb-0"> 1099 <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"> 11001101 @{ 1102 object header = temp[key].Name; 11031104 if (header != null) 1105 { 1106 @header.ToString() 1107 } 1108 } 11091110 <i class="order-last p-accordion-toggle-icon-img">&nbsp;</i> 11111112 </a> 1113 </h4> 1114 </div> 111511161117 <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"> 1118 <div class="px-1 table-container" role="table"> 1119 <div class="flex-table header" role="rowgroup"> 1120 <div class="first flex-row w-40 " role="columnheader"></div> 1121 @if (noBuyB2BandB2C == false) 1122 { 1123 <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> 1124 <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> 1125 } 1126 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1127 { 1128 <div class="flex-row w-40" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris")</div> 1129 } 1130 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 1131 </div> 11321133 @{ 1134 bool showAcceptRow = true; 1135 } 11361137 @if (temp[key] != null) 1138 { 1139 foreach (RelatedProduct relatedProduct in temp[key].RelatedProducts) 1140 { 1141 double totalPackagePrice = 0; 1142 double totalPackageColli = 0; 1143 bool totalIsInStock = true; 1144 string relatedPackageName = string.Empty; 1145 string fallbackProductName = string.Empty; 1146 string productItemDescription = string.Empty; 1147 string stockStatus = string.Empty; 1148 bool isPimActive = true; 1149 bool canBuyRelatedIfOutOfStock = true; 1150 StockStatus _tempStockStatus = new StockStatus(); 1151 bool isGroup = string.IsNullOrEmpty(relatedProduct.Name) == false; 1152 bool relatedStockStatusForGroupAtRemote = false; 1153 hasRelatedProducts = relatedProduct.Products.Any(); 11541155 Dictionary<string, dynamic> packs = new Dictionary<string, dynamic>(); 11561157 if (isGroup == true) 1158 { 1159 <div class="flex-table js-isabella-product-form-row" role="rowgroup" data-group="true"> 1160 <div class="align-self-center first flex-row w-40" role="cell"> 11611162 @foreach (Product item in relatedProduct.Products) 1163 { 1164 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1165 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1166 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1167 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 1168 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1169 fallbackProductName = item.Name; 11701171 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1172 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1173 StockStatus relatedStockStatus = relatedStockObject.Status; 1174 double relatedStock = relatedStockObject.Stock; 11751176 if (relatedStockStatus == StockStatus.OutOfStock) 1177 { 1178 _tempStockStatus = relatedStockStatus; 1179 } 118011811182 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 118311841185 if (isHybridShop || (isUserAuthenticated == false && relatedStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) || isNoBuyWithPricesShop) 1186 { 1187 canBuyRelatedIfOutOfStock = false; 1188 showAcceptRow = false; 1189 _tempStockStatus = relatedStockStatus; 1190 } 1191 if (_tempStockStatus != StockStatus.OutOfStock) 1192 { 1193 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 1194 } 11951196 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1197 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 11981199 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1200 totalStockMainAndRelated += relatedStock; 1201 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1202 { 1203 totalIsInStock = false; 1204 } 120512061207 totalPackagePrice += itemPrice; 12081209 if (isPimActive == true && canBuyRelatedIfOutOfStock == true) 1210 { 1211 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1212 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1213 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1214 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1215 } 1216 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1217 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 1218 relatedCounter++; 1219 @* 1220 <script> 1221 var debugInfo = debugInfo || {}; 1222 debugInfo["@relatedPackageName"] = { 1223 "isPimActive" : "@isPimActive", 1224 "canBuyRelatedIfOutOfStock" : "@canBuyRelatedIfOutOfStock", 1225 "noBuyB2BandB2C" : "@noBuyB2BandB2C", 1226 "relatedStockStatus": "@relatedStockStatus", 1227 "totalIsInStock": "@totalIsInStock" 1228 }; 1229 </script> 1230 *@ 12311232 packs[relatedPackageName] = new 1233 { 1234 isPimActive = isPimActive, 1235 canBuyRelatedIfOutOfStock = canBuyRelatedIfOutOfStock, 1236 noBuyB2BandB2C = noBuyB2BandB2C, 1237 isHybridShop = isHybridShop, 1238 relatedStockStatus = relatedStockStatus, 1239 totalIsInStock = totalIsInStock, 1240 noBuyB2C = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C"), 1241 noBuyB2B = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B") 1242 }; 1243 } 1244 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1245 { 1246 @relatedPackageName 1247 } 1248 else 1249 { 1250 @fallbackProductName 1251 } 12521253 @{ 1254 dynamic pack = new { }; 1255 } 12561257 @if (packs.ContainsKey(relatedPackageName)) 1258 { 1259 pack = packs[relatedPackageName]; 1260 } 1261126212631264 @if (!string.IsNullOrEmpty(productItemDescription)) 1265 { 1266 <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> 1267 } 12681269 </div> 12701271 @if (noBuyB2BandB2C == false) 1272 { 1273 <div class="align-self-center center flex-row w-10" role="cell"> 1274 @if (!noBuyB2BandB2C) 1275 { 1276 @stockStatus 1277 } 1278 </div> 1279 } 12801281 @if (noBuyB2BandB2C == false) 1282 { 1283 <div class="align-self-center center flex-row w-30 " role="cell"> 1284 <div class="d-flex flex-column"> 1285 @if (!noBuyB2BandB2C && !hidePrice) 1286 { 1287 <div> 1288 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1289 </div> 1290 } 1291 @if (noBuyB2BandB2C) 1292 { 1293 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1294 } 1295 else if (relatedStockStatusForGroupAtRemote) 1296 { 1297 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1298 } 1299 </div> 1300 </div> 1301 } 1302 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1303 { 1304 <div class="align-self-center center flex-row w-40 " role="cell"> 1305 <div class="d-flex flex-column"> 1306 <div class="small"> 1307 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1308 </div> 1309 </div> 1310 </div> 1311 } 1312 <div class="align-self-center center flex-row w-20 ml-auto" role="cell"> 13131314 @if (isPimActive == true && (canBuyRelatedIfOutOfStock || pack.relatedStockStatus != StockStatus.OutOfStock) == true && (noBuyB2BandB2C == false || isUserAuthenticated == false && pack.noBuyB2C == false || isUserAuthenticated == true && pack.noBuyB2B == false)) 1315 { 1316 if (isHybridShop || isNoBuyWithPricesShop) 1317 { 1318 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1319 } 1320 else 1321 { 1322 <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"> 1323 } 1324 } 1325 else 1326 { 1327 <p class="m-0 text-danger align-self-center"> 1328 @if (canBuyRelatedIfOutOfStock == false) 1329 { 1330 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv")) 1331 } 1332 else if (isPimActive == false) 1333 { 1334 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1335 } 1336 else 1337 { 1338 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1339 } 1340 </p> 1341 } 134213431344 </div> 13451346 </div> 1347 } 1348 else 1349 { 1350 foreach (Product item in relatedProduct.Products) 1351 { 1352 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1353 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1354 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1355 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 13561357 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1358 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1359 StockStatus relatedStockStatus = relatedStockObject.Status; 1360 double relatedStock = relatedStockObject.Stock; 13611362 fallbackProductName = item.Name; 1363 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1364 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 1365 totalStockMainAndRelated += relatedStock; 1366 totalStockMainAndRelated += item.Stock; 1367 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1368 { 1369 totalIsInStock = false; 1370 } 13711372 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 1373 <div class="align-self-center first flex-row w-40" role="cell"> 1374 @if (isPimActive == true) 1375 { 1376 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1377 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1378 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1379 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1380 } 1381 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1382 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 13831384 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1385 { 1386 @relatedPackageName 1387 } 1388 else 1389 { 1390 @fallbackProductName 1391 } 1392 @if (key != "Frames" && key != "AccessoriesWithFrames") 1393 { 1394 <br/> 1395 <span class="text-muted">@item.Number</span> 1396 } 1397139813991400 @if (!string.IsNullOrEmpty(productItemDescription)) 1401 { 1402 <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> 1403 } 1404 </div> 14051406 @if (noBuyB2BandB2C == false) 1407 { 1408 <div class="align-self-center center flex-row w-10 " role="cell"> 1409 @GetProductStockByStatus(item, allowBuyIfOutOfStock) 1410 </div> 1411 } 1412 @if (noBuyB2BandB2C == false) 1413 { 1414 <div class="align-self-center center flex-row w-30" role="cell"> 1415 <div class="d-flex flex-column"> 1416 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1417 </div> 1418 </div> 1419 } 1420 @if (isHybridShop) 1421 { 1422 <div class="align-self-center center flex-row w-40" role="cell"> 1423 <div class="d-flex flex-column"> 1424 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1425 </div> 1426 </div> 1427 } 1428 @if (isNoBuyWithPricesShop) 1429 { 1430 <div class="align-self-center center flex-row w-40" role="cell"> 1431 <div class="d-flex flex-column"> 1432 @GetPriceByRelatedProductItem(item, false, false, false) 1433 </div> 1434 </div> 1435 } 1436 <div class="flex-row align-self-center w-20 ml-auto" role="cell"> 1437 @GetQuantityInputByRelatedProductItem(item, isUserAuthenticated, key, lockColli) 1438 </div> 1439 </div> 1440 relatedCounter++; 1441 } 1442 } 1443 } 1444 } 1445 @if ((key == "Frames" || key == "AccessoriesWithFrames") && showAcceptRow) 1446 { 1447 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 1448 <div class="form-group js-isabella-accept-no-frame-row" style="display: @(key == "AccessoriesWithFrames" ? "none" : "block")"> 1449 <div class="form-check"> 1450 <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"> 1451 <label class="form-check-label pl-1 d-inline" for="acceptNoFrame-@key"> 1452 @Translate("eCom Product - Add To Cart Form Table - Confirm No Frame - Text", "Jeg bekræfter hermed, at jeg ikke ønsker et stel") 1453 </label> 1454 </div> 1455 </div> 1456 </div> 1457 } 1458 </div> 14591460 </div> 1461 } 1462 } 1463 </div> 1464 } 14651466 <div class="border-top mt-0 table-container" role="table"> 1467 @if(!hidePrice){ 1468 <div class="flex-table mt-1 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1469 <div class="align-self-center first flex-row h4 w-50" role="cell"> 1470 @Translate("eCom Product - Add To Cart Form Table - Total Price Text", "I alt") 1471 </div> 1472 <div class="flex-row h3 text-right w-50" role="cell"> 1473 <div class="js-isabella-calculated-price"> 1474 @if (isDiscontinued == false) 1475 { 1476 if (isUserAuthenticated == true) 1477 { 1478 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true) 1479 { 1480 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1481 } 1482 else 1483 { 1484 @eProductService.Instance.GetPriceFormatted(0) 1485 } 1486 } 1487 else 1488 { 1489 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true) 1490 { 1491 if (mainStockStatus == StockStatus.OutOfStock) 1492 { 1493 @eProductService.Instance.GetPriceFormatted(0) 1494 } 1495 else 1496 { 1497 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1498 } 1499 } 1500 } 1501 } 1502 else 1503 { 1504 @eProductService.Instance.GetPriceFormatted(0) 1505 } 15061507 </div> 1508 </div> 1509 </div> 1510 } 1511 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1512 @if (!isOutlet) 1513 { 1514 <div class="align-self-center first flex-row w-50" role="cell"> 1515 @if (!string.IsNullOrEmpty(howItWorksPage)) 1516 { 1517 <a class="text-underline" data-target="#howItWorksModal" data-toggle="modal"> 1518 @if (isUserAuthenticated == false) 1519 { 1520 @Translate("eCom Product - How It works Modal - Button Text", "Sådan fungerer det") 1521 } 1522 else 1523 { 1524 @Translate("eCom Product - How It works Modal B2B - Button Text", "Sådan fungerer det") 1525 } 1526 </a> 1527 } 1528 </div> 1529 } 1530 else 1531 { 1532 <div class="align-self-center first flex-row w-50" role="cell"></div> 1533 } 15341535 @if (!hidePrice) 1536 { 15371538 <div class="flex-row text-right w-50" role="cell"> 15391540 @if (noBuyB2BandB2C == false && userCanBuy == true) 1541 { 1542 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1543 { 1544 if (totalStockMainAndRelated == 0) 1545 { 1546 <p class="m-0 "></p> 1547 } 1548 else 1549 { 1550 if ((isDiscontinued == true && hasRelatedProducts == false) || shopType == "B2C") 1551 { 1552 <p class="m-0 "></p> 1553 } 1554 else 1555 { 1556 if (!isOutlet) 1557 { 1558 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Klik og hent - Button", "Klik og hent")</button> 1559 } 1560 else 1561 { 1562 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Order - Button", "Order now")</button> 1563 } 15641565 } 1566 } 1567 } 15681569 if ((GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true && isUserAuthenticated == true) || shopType == "B2C" && GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1570 { 1571 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Cart - Button", "Add to cart")</button> 1572 } 1573 } 1574 @if (userCanBuy == false || GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") == true && isUserAuthenticated == false || (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") == true && isUserAuthenticated == true)) 1575 { 1576 <p class="mb-0">@Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")</p> 1577 } 15781579 </div> 1580 } 1581 </div> 1582 @if (!isOutlet) 1583 { 1584 <div class="flex-table" role="rowgroup"> 1585 <div class="align-self-center first flex-row w-50 pr-1" role="cell"> 1586 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1587 { 1588 @Translate("Product page - Not On Stock Info B2B - Text", "B2B relevant text") 1589 } 1590 else 1591 { 1592 @Translate("Product page - Not On Stock Info - Start Text", "Er varen ikke på lager kontakt Isabellas salgsafdeling på") 1593 <span class="text-primary">@Translate("Product page - Contact Phone - Number", "76497292")</span> 1594 @Translate("Product page - Not On Stock Info - End Textr", "eller send en mail") 1595 } 1596 </div> 1597 <div class="flex-row text-right w-50" role="cell"> 1598 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1599 { 1600 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer B2B - Link", "Find forhandler")</a> 1601 } 1602 else 1603 { 1604 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer - Link", "Find forhandler")</a> 1605 } 1606 </div> 1607 <div class="mt-2 p-0 col-12"> 1608 @if ( isUserAuthenticated == true ) 1609 { 1610 <div class="col-12"> 1611 <div class="row"> 1612 <div class="col-6"> 1613 @using Dynamicweb.Frontend 1614 <div class="dropdown"> 1615 <a class="dropdown-toggle" data-toggle="dropdown"> 1616 <i class="material-icons material-icons-large">playlist_add</i>&nbsp;@Translate( "eCom Product - Add to favorites - Link", "Add to favorites" ) 1617 </a> 1618 <div class="dropdown-menu pt-0"> 1619 <h4 class="dropdown-header">@Translate( "eCom Product - Add to favorite list - Heading", "Add to ..." )</h4> 1620 <form action="" class="js-e-product-cc-list-form mt-1"> 1621 @foreach ( LoopItem listType in GetLoop( "CustomerCenter.ListTypes" ) ) 1622 { 1623 foreach ( LoopItem list in listType.GetLoop( "CustomerCenter.ProductLists" ) ) 1624 { 1625 <div class="dropdown-item"> 1626 <label class="custom-checkbox custom-control m-0"> 1627 <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" )"> 1628 <span class="custom-control-indicator"></span> 1629 <span class="custom-control-description">@list.GetString( "Ecom:CustomerCenter.List.Name" )</span> 1630 </label> 1631 </div> 1632 } 1633 } 1634 </form> 1635 <div class="dropdown-divider"></div> 1636 <a class="dropdown-item" href="@PageView.Current().Area.Item[ "ExtranetListsPage" ]"><i class="material-icons">add</i>&nbsp;@Translate( "eCom Product - Add new favorite list - Link", "Create a new list" )</a> 1637 </div> 1638 </div> 163916401641 </div> 1642 <div class="col-6"> 1643 <p> 1644 <a class="text-dark" href="@signBuilderUrl"> 1645 <i class="e-nav-pageicon material-icons">image</i> @Translate( "eCom Product - SignBuilder - Text", "Opret prisskilt (pdf)" )</a> 1646 </p> 1647 </div> 1648 </div> 1649 </div> 1650 } 1651 <div class="col-12"> 1652 <p> 1653 <a class="js-isabella-product-details-pdf-generate text-primary" href="#"> 1654 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download PDF - Text", "Hent produkt-PDF" )</a> 1655 </p> 1656 </div> 16571658 </div> 1659 </div> 1660 } 16611662 </div> 1663 </form> 16641665 <!-- Modal --> 1666 <div aria-hidden="true" aria-labelledby="howItWorksModalLabel" class="fade modal" id="howItWorksModal" role="dialog" tabindex="-1"> 1667 <div class="modal-dialog" role="document"> 1668 <div class="modal-content"> 1669 <div class="modal-body"> 1670 @if (!string.IsNullOrEmpty(howItWorksPage)) 1671 { 1672 @RenderPageContent(int.Parse(howItWorksPage)) 1673 } 1674 </div> 1675 </div> 1676 </div> 1677 </div> 167816791680 @functions 1681 { 168216831684 public string GetPriceByRelatedProductItem(Product item, bool isUserAuthenticated, bool allowBuyIfOutOfStock, bool hidePrice) 1685 { 1686 string returnValue = string.Empty; 1687 bool isPimActive = false; 1688 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 16891690 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1691 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 16921693 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1694 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1695 string textNoBuy = Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online"); 1696 string textNotInStock = Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt"); 1697 string textAtRemote = Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager"); 16981699 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1700 IsabellaStock stockObject = isabellaProduct.Stock; 1701 StockStatus stockStatus = stockObject.Status; 170217031704 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1705 { 1706 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1707 } 17081709 if (isPimActive) 1710 { 1711 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 17121713 if (hidePrice) 1714 { 1715 return ""; 1716 } 17171718 if (noBuyB2BandB2C) 1719 { 1720 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1721 } 1722 else 1723 { 1724 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1725 if (allowBuyIfOutOfStock == true) 1726 { 1727 return returnValue; 1728 } 17291730 if ((isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1731 { 1732 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1733 } 1734 else if (stockStatus == StockStatus.OutOfStock) 1735 { 1736 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNotInStock); 1737 } 1738 else if (stockStatus == StockStatus.InStockAtRemote) 1739 { 1740 returnValue += string.Format("<p class=\"m-0 text-muted\">{0}</p>", textAtRemote); 1741 } 1742 } 1743 if (isHybridShop || isNoBuyWithPricesShop) 1744 { 1745 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1746 } 1747 } 1748 return returnValue; 1749 } 17501751 public string GetQuantityInputByRelatedProductItem(Product item, bool isUserAuthenticated, string itemKey, bool lockColli) 1752 { 1753 string returnValue = string.Empty; 1754 bool isPimActive = false; 1755 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1756 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1757 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 17581759 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1760 { 1761 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1762 } 17631764 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1765 IsabellaStock stockObject = isabellaProduct.Stock; 1766 StockStatus stockStatus = stockObject.Status; 17671768 bool allowBuyIfOutOfStock = false; 1769 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 17701771 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1772 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1773 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1774 string textNoBuy = Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online"); 1775 string textNotInStockInput = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1776 if (isPimActive && stockStatus != StockStatus.OutOfStock || allowBuyIfOutOfStock == true) 1777 { 1778 if (noBuyB2BandB2C || (isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1779 { 1780 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1781 } 1782 else 1783 { 1784 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); 1785 } 1786 } 1787 else 1788 { 1789 if (isPimActive == false) 1790 { 1791 returnValue = string.Format("<p class=\"m-0 text-danger\">{0}</p>", Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået")); 1792 } 1793 else 1794 { 1795 if (noBuyB2BandB2C || isUserAuthenticated == false) 1796 { 1797 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, noBuyB2BandB2C ? textNoBuy : textNotInStockInput); 1798 } 1799 else 1800 { 1801 if (noBuyB2BandB2C || noBuyB2BRelated == "True") 1802 { 1803 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1804 } 1805 else 1806 { 1807 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); 1808 } 1809 } 1810 } 1811 } 1812 if (isHybridShop || isNoBuyWithPricesShop) 1813 { 1814 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1815 } 1816 return returnValue; 1817 } 18181819 public string GetPdfOnlyQuantityInput(double itemPrice, string itemKey, string popoverText) 1820 { 1821 bool isUserAuthenticated = PageView.Current().User != null; 1822 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1823 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1824 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 1825 if (isHybridShop) 1826 { 1827 popoverText = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1828 } 1829 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); 1830 } 18311832 public bool ShouldShowStock(Product item) 1833 { 1834 bool returnValue = false; 18351836 bool isPimActive = false; 18371838 if (item != null && item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1839 { 1840 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1841 } 18421843 returnValue = isPimActive; 18441845 return returnValue; 1846 } 18471848 public string GetProductStockByStatus(Product product, bool allowBuyIfOutOfStock) 1849 { 1850 string returnValue = string.Empty; 18511852 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 185318541855 if (product != null) 1856 { 1857 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 1858 IsabellaStock stockObject = isabellaProduct.Stock; 1859 StockStatus stockStatus = stockObject.Status; 18601861 if (ShouldShowStock(product) == false || allowBuyIfOutOfStock == true) 1862 { 1863 return returnValue; 1864 } 18651866 switch (stockStatus.ToString()) 1867 { 1868 case "InStock": 1869 returnValue = "<span class=\"text-success\">●</span>"; 1870 break; 1871 case "InStockAtRemote": 1872 returnValue = "<span class=\"text-warning\">●</span>"; 1873 break; 1874 case "OutOfStock": 1875 returnValue = "<span class=\"text-danger\">●</span>"; 1876 break; 1877 } 1878 } 1879 else 1880 { 1881 returnValue = "<span class=\"text-danger\">●</span>"; 1882 } 18831884 if (noBuyB2BandB2C) 1885 { 1886 returnValue = ""; 1887 } 18881889 return returnValue; 1890 } 1891 } 1892 </div> 1893 <div class="col-12 col-md-7 order-md-1"> 1894 @using Co3.Espresso.Base.Extensions 1895 @using Co3.Espresso.Website.Services 1896 @using Dynamicweb.Admin.dk.dynamicweb.templates 1897 @using Dynamicweb.Ecommerce.Products 1898 @using Dynamicweb.Ecommerce.Products.Categories 1899 @using Dynamicweb.Ecommerce.Products.FieldDisplayGroups 1900 @using Dynamicweb.Frontend 1901 @using ProductService = Co3.Isabella.Dw.Services.ProductService 19021903 @{ 1904 //Hard coded group ID's from Model Display Groups // 1905 List< string > modelDisplayGroupIds = new List< string >(); 1906 modelDisplayGroupIds.Add("7"); 1907 List< LoopItem > modelDisplayGroupList = new List< LoopItem >(); 1908 } 19091910 <div class="col-12 p p-accordion"> 1911 <div class="p-accordion-container "> 1912 <div class="border-bottom e-reveal-done mb-0 p-accordion-item"> 19131914 @{ 1915 int displayGroupCount = 0; 1916 } 19171918 @foreach (LoopItem groupItem in GetLoop("FieldDisplayGroups")) 1919 { 19201921 string displayGroupId = groupItem.GetString("Ecom:FieldDisplayGroup.ID"); 19221923 if (modelDisplayGroupIds.Contains(groupItem.GetString("Ecom:FieldDisplayGroup.ID"))) 1924 { 1925 modelDisplayGroupList.Add(groupItem); 1926 } 1927 else 1928 { 1929 List<LoopItem> fieldItems = new List<LoopItem>(); 1930 bool hasValues = false; 19311932 foreach (LoopItem fieldItem in groupItem.GetLoop("Fields")) 1933 { 1934 fieldItems.Add(fieldItem); 1935 if (!string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value"))) 1936 { 1937 hasValues = true; 1938 } 1939 } 19401941 if (hasValues == true) 1942 { 1943 <div class="p-accordion-toggle"> 1944 <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"> 1945 <span class="font-weight-bold line-height-sm my-0 p-accordion-toggle-text text-auto">@groupItem.GetString("Ecom:FieldDisplayGroup.Name")</span> 1946 <i class="order-last p-accordion-toggle-icon-img">&nbsp;</i> 1947 </p> 1948 </div> 1949 <div class="collapse @(displayGroupCount == 0 ? "show" : string.Empty)" id="accordion-id-@displayGroupId"> 1950 <div class="pb-2"> 1951 <div class="row"> 1952 @{ 1953 int loopCounter = 0; 1954 } 195519561957 @foreach (LoopItem fieldItem in fieldItems) 1958 { 1959 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("Color")) 1960 { 1961 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1962 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1963 string fieldImage = string.Empty; 19641965 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1966 { 1967 if (fieldValue.Length == fieldLabel.Length) 1968 { 1969 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 19701971 JSON.pdfData.colors.Add(new 1972 { 1973 fieldLabel = fieldValue[sharedArrayIndex], 1974 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1975 imageUri = string.Empty 1976 }); 1977 } 1978 } 1979 } 19801981 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMatch")) 1982 { 1983 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1984 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1985 string fieldImage = string.Empty; 19861987 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1988 { 1989 if (fieldValue.Length == fieldLabel.Length) 1990 { 1991 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 19921993 JSON.pdfData.frameMatch.Add(new 1994 { 1995 fieldLabel = fieldValue[sharedArrayIndex], 1996 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1997 imageUri = string.Empty 1998 }); 1999 } 2000 } 2001 } 20022003 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("MiscFrameMaterial")) 2004 { 2005 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2006 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2007 string fieldImage = string.Empty; 20082009 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2010 { 2011 if (fieldValue.Length == fieldLabel.Length) 2012 { 2013 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 20142015 JSON.pdfData.miscFrameMaterial.Add(new 2016 { 2017 fieldLabel = fieldValue[sharedArrayIndex], 2018 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2019 imageUri = string.Empty 2020 }); 2021 } 2022 } 2023 } 20242025 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMaterial")) 2026 { 2027 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2028 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2029 string fieldImage = string.Empty; 20302031 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2032 { 2033 if (fieldValue.Length == fieldLabel.Length) 2034 { 2035 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 20362037 JSON.pdfData.frameMaterial.Add(new 2038 { 2039 fieldLabel = fieldValue[sharedArrayIndex], 2040 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2041 imageUri = string.Empty 2042 }); 2043 } 2044 } 2045 } 20462047 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")) 2048 { 2049 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2050 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2051 if (categoryFieldIds.Length == 3) 2052 { 2053 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2054 translatedFieldLabel = translatedField.Label; 2055 } 2056 <div class="col-12"> 2057 @{ 2058 string[] colorValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2059 string[] colorLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2060 string colorImagePng = string.Empty; 2061 } 2062206320642065 @if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2066 { 20672068 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 20692070 <div class="row"> 2071 @for (int sharedArrayIndex = 0; sharedArrayIndex < colorValue.Length; sharedArrayIndex++) 2072 { 2073 if (colorValue.Length == colorLabel.Length) 2074 { 2075 colorImagePng = colorValue[sharedArrayIndex] + ".png"; 2076 <div class="col-4 mb-2"> 2077 <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"> 2078 <div> 2079 @colorLabel[sharedArrayIndex] 2080 </div> 2081 </div> 2082 } 2083 } 2084 </div> 2085 } 20862087 </div> 2088 } 2089 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name").Contains("VideoPresentation") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value") != "") 2090 { 2091 <div class="col-12 mb-2"> 2092 <div class="col-12 px-0 mt-1"> 2093 <div class="embed-responsive embed-responsive-16by9"> 2094 <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> 2095 <div class="cookieconsent-optout-marketing"> 2096 <div> 2097 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2098 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2099 </a> 21002101 </div> 2102 </div> 2103 </div> 2104 </div> 2105 </div> 2106 } 2107 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".jpg")) 2108 { 2109 <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)"/> 2110 } 2111 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".pdf")) 2112 { 2113 <div class="col-5 col-lg-3 d-flex"> 2114 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2115 </div> 2116 <div class="col-7 col-lg-9 d-flex flex-column"> 2117 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Replace("../", "/Files/")"> 2118 @Translate("eCom Product = Download PDF - Link", "Download pdf here") 2119 </a> 2120 </div> 2121 } 2122 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Link")) 2123 { 2124 <div class="col-5 col-lg-3 d-flex"> 2125 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2126 </div> 2127 <div class="col-7 col-lg-9 d-flex flex-column"> 2128 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")"> 2129 @Translate("eCom Product - View more - Text", "View more") 2130 </a> 2131 </div> 2132 } 2133 else 2134 { 2135 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2136 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2137 if (categoryFieldIds.Length == 3) 2138 { 2139 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2140 translatedFieldLabel = translatedField.Label; 2141 } 21422143 switch (groupItem.GetString("Ecom:FieldDisplayGroup.ID")) 2144 { 2145 case "11": // Delivery Width 2146 <div class="col-12"> 2147 <div class="row"> 2148 <div class="col-12 col-md-6"> 2149 <p> 2150 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2151 { 2152 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2153 } 2154 else 2155 { 2156 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2157 } 2158 </p> 2159 </div> 2160 <div class="col-12 col-md-6"> 2161 @using Dynamicweb.Admin.dk.dynamicweb.templates 21622163 @{ 2164 string deliveryCarouselClassList = "d-none"; 2165 } 21662167 <div class="e-product-image-container"> 2168 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-delivery"> 2169 <div class="e-product-image-wrapper"> 2170 <div class="carousel-inner"> 2171 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2172 { 2173 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2174 { 2175 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2176 { 2177 if (image.Element.Index == 1 ) 2178 { 2179 isActive = "active"; 2180 } 2181 else 2182 { 2183 isActive = ""; 2184 } 2185 if (image.Index != 0 ) 2186 { 2187 deliveryCarouselClassList = "d-flex"; 2188 } 2189 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-delivery" data-toggle="modal"> 2190 <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 )"> 2191 </div> 2192 } 2193 } 2194 } 21952196 <a class="carousel-control-prev @deliveryCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-delivery"></a> 2197 <a class="carousel-control-next @deliveryCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-delivery"></a> 21982199 </div> 2200 </div> 2201 <ol class="carousel-indicators @deliveryCarouselClassList"> 2202 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2203 { 2204 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2205 { 2206 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2207 { 2208 if (image.Element.Index == 1 ) 2209 { 2210 isActive = "active"; 2211 } 2212 else 2213 { 2214 isActive = ""; 2215 } 2216 <li class="@isActive" data-target="#js-e-product-image-carousel-delivery" data-slide-to="@( image.Index )"></li> 2217 } 2218 } 2219 } 2220 </ol> 2221 </div> 2222 </div> 2223 @using Dynamicweb.Admin.dk.dynamicweb.templates 2224 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-delivery" data-backdrop="false" data-keyboard="true"> 2225 <div class="modal-dialog"> 2226 <div class="modal-content"> 2227 <div class="modal-body"> 22282229 <button type="button" class="close" data-dismiss="modal"> 2230 <i class="material-icons">close</i> 2231 </button> 22322233 <div id="js-e-product-image-modal-carousel-delivery" class="carousel slide" data-keyboard="true" data-interval="false"> 2234 <div class="carousel-inner"> 2235 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2236 { 2237 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2238 { 2239 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2240 { 2241 if (image.Element.Index == 1 ) 2242 { 2243 isActive = "active"; 2244 } 2245 else 2246 { 2247 isActive = ""; 2248 deliveryCarouselClassList = "d-flex"; 2249 } 2250 <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)"> 2251 </div> 2252 } 2253 } 2254 } 2255 </div> 22562257 <ol class="carousel-indicators @deliveryCarouselClassList"> 2258 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2259 { 2260 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2261 { 2262 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2263 { 2264 if (image.Element.Index == 1 ) 2265 { 2266 isActive = "active"; 2267 } 2268 else 2269 { 2270 isActive = ""; 2271 deliveryCarouselClassList = "d-flex"; 2272 } 2273 <li class="@isActive" data-target="#js-e-product-image-modal-carousel-delivery" data-slide-to="@( image.Index + 1 )"> 2274 <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> 2275 </li> 2276 } 2277 } 2278 } 2279 </ol> 22802281 <a class="carousel-control-prev @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="prev"></a> 2282 <a class="carousel-control-next @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="next"></a> 22832284 </div> 2285 </div> 2286 </div> 2287 </div> 2288 </div> 22892290 </div> 2291 </div> 2292 </div> 2293 break; 2294 case "2": // Material 2295 <div class="col-12"> 2296 @{ 2297 string materialImg = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) + ".png"; 22982299 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2300 { 2301 JSON.pdfData.materials.Add( new 2302 { 2303 id = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ), 2304 label = translatedFieldLabel, 2305 text = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" ), 2306 path = string.Format( "/Files/Images/isabella/IsabellaIcons/{0}", materialImg ), 2307 imageUri = string.Empty 2308 } ); 2309 } 23102311 bool isEditor = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName") == "EditorText"; 23122313 } 23142315 @if ( string.IsNullOrEmpty(fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )) == false ) 2316 { 2317 if(isEditor){ 2318 <p class="mb-1">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</p> 2319 } 2320 else 2321 { 2322 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 2323 <div class="d-flex align-items-start mb-3"> 2324 <img src="/Files/Images/isabella/IsabellaIcons/@materialImg" style="width: 45px" class="mr-2"> 2325 <div> 2326 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2327 { 2328 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2329 } 2330 else 2331 { 2332 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2333 } 2334 </div> 2335 </div> 2336 } 233723382339 } 23402341 </div> 2342 break; 2343 case "3": // Measures 2344 if(loopCounter == 0) { 2345 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2346 { 2347 if ( imageCategories.GetString( "Category.SystemName" ) == "MeasureIllustrations" ) 2348 { 2349 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2350 { 2351 <div class="col-12"> 2352 <img src="@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )" alt="" class="col-12 p-0 mb-3"> 2353 </div> 2354 } 2355 } 2356 } 23572358 } 23592360 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc") || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc2")) 2361 { 2362 <div class="col-12 col-md-6"> 2363 <p class="font-weight-bold"> 2364 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2365 { 2366 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2367 } 2368 else 2369 { 2370 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2371 } 2372 </p> 2373 </div> 2374 } 2375 else if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2376 <div class="col-5 col-lg-3 d-flex"> 2377 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2378 </div> 2379 <div class="col-7 col-lg-9 d-flex"> 2380 <p class="mb-0 pb-0"> 2381 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2382 { 2383 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2384 } 2385 else 2386 { 2387 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2388 } 2389 </p><br /> 2390 </div> 23912392 JSON.pdfData.measures.Add( new 2393 { 2394 value = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 2395 name = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Name" ) 2396 } ); 2397 } 2398 break; 2399 case "1": // Details & Features 2400 if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2401 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("VideoPresentation")) { 2402 <div class="col-12 mb-2"> 2403 <div class="col-12 px-0"> 2404 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 24052406 <div class="embed-responsive embed-responsive-16by9"> 2407 <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> 2408 <div class="cookieconsent-optout-marketing"> 2409 <div> 2410 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2411 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2412 </a> 24132414 </div> 2415 </div> 2416 </div> 2417 </div> 2418 </div> 2419 } else { 2420 <div class="col-5 col-lg-3 d-flex"> 2421 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2422 </div> 2423 <div class="col-7 col-lg-9 d-flex flex-column"> 2424 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameGuide" || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameIllustration") { 2425 <a href="@GetString( "Ecom:Product.CategoryField.AccessoriesGeneral.FrameGuide.Value" )">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</a> 2426 } else { 2427 if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2428 { 2429 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2430 } 2431 else 2432 { 2433 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2434 } 2435 } 2436 <br /> 2437 </div> 2438 } 2439 } 2440 break; 2441 case "5": // Assembly 24422443 if(loopCounter == 0) { 2444 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2445 { 2446 if ( imageCategories.GetString( "Category.SystemName" ).Contains("AssemblyIllustrations" )) 2447 { 2448 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2449 { 2450 <div class="col-12 col-lg-8"> 2451 <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"> 2452 </div> 2453 } 2454 } 2455 } 24562457 } 2458 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "AssemblyGuide" && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2459 { 2460 <div class="col-12 mb-3"> 2461 <p class="font-weight-bold mb-1">@Translate( "eCom Product - Download installation instructions - Header", "Opstillingsvejledning" )</p> 2462 <a class="text-primary" href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download> 2463 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download installation instructions - Link", "Download opstillingsvejledning" ) 2464 </a> 2465 </div> 2466 } 2467 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo1") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2468 { 2469 <div class="col-12"> 2470 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo1.Value.Clean" )</p> 2471 <div class="embed-responsive embed-responsive-16by9"> 2472 <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> 2473 <div class="cookieconsent-optout-marketing"> 2474 <div> 2475 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2476 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2477 </a> 24782479 </div> 2480 </div> 2481 </div> 2482 </div> 2483 } 2484 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo2") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2485 { 2486 <div class="col-12"> 2487 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo2.Value.Clean" )</p> 2488 <div class="embed-responsive embed-responsive-16by9"> 2489 <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> 2490 <div class="cookieconsent-optout-marketing"> 2491 <div> 2492 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2493 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2494 </a> 24952496 </div> 2497 </div> 2498 </div> 24992500 </div> 2501 } 2502 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo3") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2503 { 2504 <div class="col-12"> 2505 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 2506 <div class="embed-responsive embed-responsive-16by9"> 2507 <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> 2508 <div class="cookieconsent-optout-marketing"> 2509 <div> 2510 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2511 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2512 </a> 25132514 </div> 2515 </div> 2516 </div> 2517 </div> 2518 } 2519 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 ) 2520 { 2521 <div class="col-5 col-lg-3 d-flex"> 2522 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2523 </div> 2524 <div class="col-7 col-lg-9 d-flex flex-column"> 2525 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2526 { 2527 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2528 } 2529 else 2530 { 2531 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2532 } 2533 </div> 2534 } 2535 break; 2536 default: 2537 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2538 { 2539 <div class="col-5 col-lg-3 d-flex"> 2540 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2541 </div> 2542 <div class="col-7 col-lg-9 d-flex flex-column"> 2543 @if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True") 2544 { 2545 string text = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel"); 2546 if (text.Contains(",")) 2547 { 2548 string[] splitText = text.Split(','); 2549 text = string.Join(", ", splitText); 2550 } 2551 @text<br/> 2552 } 2553 else 2554 { 2555 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br/> 2556 } 2557 </div> 2558 } 2559 break; 2560 } 2561 } 2562 loopCounter++; 2563 } 2564 </div> 2565 </div> 2566 </div> 2567 displayGroupCount++; 2568 } 2569 } 25702571 } 2572 </div> 2573 </div> 2574 </div> 257525762577 @functions 2578 { 2579 public Field GetTranslatedCategoryFieldName(string categoryId, string fieldId) 2580 { 2581 Field result = null; 25822583 Category category = Category.GetCategoryById(categoryId, Dynamicweb.Ecommerce.Common.Context.LanguageID); 25842585 Field field = category.Fields.FirstOrDefault(f => f.Id.Equals(fieldId)); 25862587 if (field != null && string.IsNullOrEmpty(field.Label) == false) 2588 { 25892590 result = field; 2591 } 25922593 return result; 2594 } 2595 } 25962597 </div> 2598 </div> 2599 </div> 26002601 <script> 2602 dataLayer.push({ 2603 "ecommerce": { 2604 "detail": { 2605 "products": [{ 2606 "name": "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2607 "id": "@GetString("Ecom:Product.Number")", 2608 "price": "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()" 2609 }] 2610 } 2611 } 2612 }); 26132614 /*New GA4*/ 2615 dataLayer.push({ 2616 event: 'view_item', 2617 ecommerce: { 2618 items: [ 2619 { 2620 item_name: "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2621 item_id: "@GetString("Ecom:Product.Number")", 2622 price: @eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript().Replace( ",", "" ) 2623 } 2624 ] 2625 } 2626 }); 2627 </script> 26282629 @sectionEnd() 2630263126322633 @if (!disableRelatedProducts) 2634 { 2635 <div> 2636 @using Dynamicweb.SystemTools 26372638 @{ 2639 string boughtWithHeading = Translate("eCom - Recommended Products - Bought With - Heading", "Ofte købt sammen med"); 2640 string boughtWithFallbackHeading = Translate("eCom - Recommended Products - Best Sellers - Heading", "Populære produkter"); 2641 } 26422643 @if(!isOutlet && !isCamplet){ 2644 @sectionStart( sectionClasses: "e-section py-2 bg-septenary-opacity-low border-bottom js-e-recommended-products-container" ) 2645 <div class="col-12 js-e-recommended-products" data-recommendation="boughtWith" data-heading="@boughtWithHeading" data-fallback-heading="@boughtWithFallbackHeading"> 26462647 <div class="js-e-recommended-products-container"> 2648 <div class="e-loading-overlay e-products-loading-overlay js-e-products-loading-overlay is-loading"> 2649 <div class="e-loading-spinner"></div> 2650 </div> 2651 </div> 26522653 </div> 2654 @sectionEnd() 2655 } 26562657 </div> 2658 } 2659266026612662 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) ) == false ) 2663 { 2664 <section class="e-section js-e-section e-theme-secondary mb-0 p p-0 p-mosaic p-mosaic-img-right"> 2665 <div class="container-fluid px-0"> 2666 <div class="e-reveal-done no-gutters row"> 2667 <div class="align-self-center col-12 col-md-6 p-txt-container"> 2668 <h2>@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" )</h2> 2669 @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) 2670 <p> 2671 <a class="arrow-white isabella-arrow text-white" href="@GetString( modelTypeLink )"> 2672 @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" ) 2673 </a> 2674 </p> 2675 </div> 2676 <div class="col-12 col-md-6 e-section-height-md order-md-last p-img-container position-relative"> 2677 <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&amp;Image=@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeImage.Value.Clean" )&amp;Format=png&amp;Width=1280&amp;Height=0&amp;Quality=75);" title=""></div> 2678 </div> 2679 </div> 2680 </div> 2681 </section> 2682 } 26832684 <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> 2685 <div class="e-loading-overlay e-pdf-loading-overlay js-e-search-loading-overlay"> 2686 <div class="e-loading-spinner"></div> 2687 </div> 2688 <script> 2689 var isabellaProductData = @JsonService.Instance.ToJson( JSON ) 2690 </script> 26912692 @using Dynamicweb.Frontend 2693 @{ 2694 string currencySeparatorDecimal = PageView.Current().Area.CultureInfo.NumberFormat.NumberDecimalSeparator; 2695 string currencySeparatorInteger = PageView.Current().Area.CultureInfo.NumberFormat.NumberGroupSeparator; 2696 string productLink = eProductService.Instance.GetProductLink( GetString("Ecom:Product.PrimaryOrFirstGroupID"), GetString("Ecom:Product.ID") ); 2697 } 26982699 <script type="application/ld+json"> 2700 { 2701 "@@context" : "http://schema.org", 2702 "@@type" : "Product", 2703 "description" : "@GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ).StripHtml()", 2704 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 2705 "name" : "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).StripHtml()", 2706 "image" : "@( HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + GetString("Ecom:Product.ImageDefault.Clean") )", 2707 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )", 2708 "sku" : "@GetString("Ecom:Product.Number")", 2709 "offers" : { 2710 "@@type" : "Offer", 2711 "availability" : @( GetInteger( "Ecom:Product.Stock" ) > 0 ? "\"http://schema.org/InStock\"" : "\"http://schema.org/OutOfStock\"" ), 2712 "price" : "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()", 2713 "priceCurrency" : "@EcomContext.Currency.Code", 2714 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )" 2715 } 2716 } 2717 </script> 27182719 </div> 27202721 @if (!isOutlet && !disableRelatedProducts) 2722 { 2723 <related-products type="RelatedProducts" product-id="@product.Id" variant-id="@product.VariantId"></related-products> 2724 } 27252726 @sectionStart() 272727282729 @using Co3.Espresso.Base.Extensions 2730 @using Co3.Espresso.Website.Models.FrontEnd 2731 @using Co3.Espresso.Website.Services 2732 @using Dynamicweb.Frontend 27332734 <script id="js-e-handlebars-tmpl-recommended-products" type="text/x-handlebars-template"> 27352736 <h4 class="isabella-text-bullets-left mb-3"> 2737 {{heading}} 2738 </h4> 2739 <div class="e-products f"> 27402741 <div class="row"> 2742 {{#each products}} 2743 {{#if pimActive}} 2744 <div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"> 2745 <div class="card border-1 mb-6"> 2746 <a href="{{url}}"> 2747 <img src="{{imageDefault}}" alt="{{name}} {{productType}}" class="col-12 p-0"> 2748 {{#if news}} 2749 <div class="isabella-product-item-news"> 2750 @Translate("Ecom Product - News Badge - Text","Nyhed") 2751 </div> 2752 {{/if}} 2753 </a> 2754 <div class="card-body p-1 p-lg-3"> 2755 <h4 class="e-products-item-name mb-0"> 2756 <a href="{{url}}"> 2757 {{{name}}} 2758 </a> 2759 </h4> 27602761 </div> 2762 </div> 2763 </div> 27642765 {{/if}} 2766 {{/each}} 2767 </div> 2768 </div> 27692770 </script> 277127722773 @SnippetStart("ProductOpenGraph") 2774 @{ 2775 string openGraphTitle = product.Meta.Title; 2776 if (string.IsNullOrEmpty(openGraphTitle)) 2777 { 2778 openGraphTitle = product.Name; 2779 } 2780 string openGraphDescription = product.Meta.Description; 2781 if (string.IsNullOrEmpty(openGraphDescription)) 2782 { 2783 openGraphDescription = product.ShortDescription; 2784 } 2785 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"; 2786 } 2787 <meta property="og:title" content="@openGraphTitle"> 2788 <meta property="og:description" content="@openGraphDescription.StripHtml()"> 2789 <meta property="og:image" content="@openGraphImage"> 2790 @SnippetEnd("ProductOpenGraph")
keyboard_arrow_up