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 201 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_131b7de785b14c4dbaa22e7e1b3372ca.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 1735 at CompiledRazorTemplates.Dynamic.RazorEngine_131b7de785b14c4dbaa22e7e1b3372ca.Execute() in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Product\espresso.cshtml:line 1454 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)}©={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))}¤cy={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 if (isOutlet && !GetBoolean("Ecom:Product:Field.IsOutlet")) 443 { 444 HttpContext.Current.Response.Redirect("/"); 445 } 446447 } 448449 @sectionEnd() 450451 <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"> 452 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == false ) 453 { 454 <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"> 455 <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> 456 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 457 <div class="isabella-product-item-news"> 458 @Translate("Ecom Product - News Badge - Text","Nyhed") 459 </div> 460 } 461 <a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link" href=""> 462 <i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i> 463 </a> 464 </section> 465 } 466467 @sectionStart( sectionClasses: "e-section py-2 isabella-camplet-dark" ) 468 <div class="col-12"> 469 <div class="row"> 470 <div class="col-12 col-md-7"> 471 <div class="e-product-text-container"> 472 <h1 class="e-product-name"> 473 @eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ) 474475 </h1> 476 <div class="e-product-text mb-3"> 477 @GetString("Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value") 478 </div> 479480481 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.Value" ) ) == false ) 482 { 483 <p class="mb-4"> 484 <a class="arrow-primary isabella-arrow" href="@GetString( modelTypeLink )"> 485 @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" ) 486 </a> 487 </p> 488 } 489 </div> 490 </div> 491 <div class="col-12 col-md-5"> 492 @using Dynamicweb.Admin.dk.dynamicweb.templates 493 @using WebSupergoo.ImageGlue6 494 @using System.Text.RegularExpressions; 495496 @{ 497 string moodCarouselClassList = "d-none"; 498 int currentIndex = 0; 499 string productVideo = GetString( "Ecom:Product:Field.Video" ); 500501 var YoutubeShowControls = "True"; 502 var YoutubeShowTitle = ""; 503 var YoutubeShowLogo = "False"; 504 var YoutubeShowRelated = "False"; 505506 var Url = productVideo; 507 var UrlRegex = new Regex( @"^.*((youtu.be\/|vimeo.com\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*" ); 508509 Match videoUrlMatch = UrlRegex.Match( Url ); 510 var EmbedUrl = String.Empty; 511512 if( videoUrlMatch.Success && videoUrlMatch.Groups.Count >= 8 ) { 513 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" ); 514 } 515516 var videoUrlID = videoUrlMatch.Groups[ 7 ].Value; 517 } 518519 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true ) 520 { 521 <div class="e-product-image-container position-relative isabella-product-image-container-mood"> 522 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 523 <div class="isabella-product-item-news zi-sticky"> 524 @Translate("Ecom Product - News Badge - Text","Nyhed") 525 </div> 526 } 527 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 528 <div class="e-product-image-wrapper"> 529 <div class="carousel-inner"> 530 <div class="active carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 531 <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"> 532 </div> 533534 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 535 { 536 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 537 { 538 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 539 { 540 if ( image.Index != null ) 541 { 542 moodCarouselClassList = "d-flex"; 543 } 544 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 545 <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)"> 546 </div> 547 } 548 } 549 } 550 @if ( !string.IsNullOrEmpty( productVideo ) ) 551 { 552 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 553 <div class="embed-responsive embed-responsive-16by9"> 554 <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> 555 </div> 556 </div> 557 } 558559560 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 561 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 562563 </div> 564 </div> 565566 @* 567 <ol class="carousel-indicators @moodCarouselClassList"> 568 <li data-target="#js-e-product-image-carousel" class="active" data-slide-to="0"></li> 569 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 570 { 571 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 572 { 573 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 574 { 575 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 576 } 577 } 578 } 579 </ol> 580 *@ 581582 @{ 583 currentIndex = 0; 584 } 585586 @* 587 <ol class="carousel-indicators @moodCarouselClassList"> 588 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 589 <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> 590 </li> 591 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 592 { 593 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 594 { 595 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 596 { 597 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 598 int imageIndex = image.Index + 1; 599 currentIndex = imageIndex; 600 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 601 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 602 <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> 603 </li> 604 } 605 } 606 } 607 </ol> 608 *@ 609610 <ol class="carousel-indicators @moodCarouselClassList"> 611 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 612 <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> 613 </li> 614615 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 616 { 617 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 618 { 619 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 620 { 621 int imageIndex = image.Index + 1; 622 currentIndex = imageIndex; 623 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 624 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 625 <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> 626 </li> 627 } 628 } 629 } 630 @if ( !string.IsNullOrEmpty( productVideo ) ) 631 { 632 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 633 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 634 </li> 635 } 636637 </ol> 638639640641 </div> 642 </div> 643 } 644 else 645 { 646647 <div class="e-product-image-container isabella-product-image-container-mood"> 648 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 649 <div class="e-product-image-wrapper"> 650 <div class="carousel-inner"> 651652 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 653 { 654 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 655 { 656 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 657 { 658 if ( image.Element.Index == 1 ) 659 { 660 isActive = "active"; 661 } 662 else 663 { 664 isActive = ""; 665 } 666 if ( image.Index != 0 ) 667 { 668 moodCarouselClassList = "d-flex"; 669 } 670 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 671 <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 )"> 672 </div> 673 } 674 } 675 } 676 @if ( !string.IsNullOrEmpty( productVideo ) ) { 677 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 678 <div class="embed-responsive embed-responsive-16by9"> 679 <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> 680 </div> 681 </div> 682 } 683684 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 685 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 686687 </div> 688 </div> 689690 @{ 691 currentIndex = 0; 692 } 693694 <ol class="carousel-indicators @moodCarouselClassList"> 695696697 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 698 { 699 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 700 { 701 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 702 { 703 int imageIndex = image.Index; 704 currentIndex = imageIndex; 705 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 706 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 707 <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> 708 </li> 709 } 710 } 711 } 712 @if ( !string.IsNullOrEmpty( productVideo ) ) 713 { 714 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 715 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 716 </li> 717 } 718719 </ol> 720721722723724725 </div> 726 </div> 727 } 728729730 @using Dynamicweb.Admin.dk.dynamicweb.templates 731 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-mood" data-backdrop="false" data-keyboard="true"> 732 <div class="modal-dialog"> 733 <div class="modal-content"> 734 <div class="modal-body"> 735736 <button type="button" class="close" data-dismiss="modal"> 737 <i class="material-icons">close</i> 738 </button> 739740 <div id="js-e-product-image-modal-carousel-mood" class="carousel slide" data-keyboard="true" data-interval="false"> 741 <div class="carousel-inner"> 742743 <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)"> 744 </div> 745 @foreach (LoopItem imageCategories in GetLoop("ImageCategories")) 746 { 747 if (imageCategories.GetString("Category.SystemName") == "MoodImages") 748 { 749 foreach (ElementWithIndex<LoopItem> image in imageCategories.GetLoop("Category.Images").WithIndex()) 750 { 751 if (image.Element.Index == 1) 752 { 753 isActive = "active"; 754 } 755 else 756 { 757 isActive = ""; 758 } 759 <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)"> 760 </div> 761 } 762 } 763 } 764 </div> 765766 <ol class="carousel-indicators @moodCarouselClassList"> 767 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="0"> 768 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=50&Height=&Quality=75)"></span> 769 </li> 770 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 771 { 772 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 773 { 774 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 775 { 776 if (image.Element.Index == 1 ) 777 { 778 isActive = "active"; 779 } 780 else 781 { 782 isActive = ""; 783 } 784 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@( image.Index + 1 )"> 785 <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> 786 </li> 787 } 788 } 789 } 790 </ol> 791792 <a class="carousel-control-prev @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="prev"></a> 793 <a class="carousel-control-next @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="next"></a> 794795 </div> 796 </div> 797 </div> 798 </div> 799 </div> 800801 </div> 802 </div> 803 </div> 804 @sectionEnd() 805806 @sectionStart( sectionClasses: "e-section pb-2 isabella-camplet-dark" ) 807 <div class="col-12"> 808 <div class="row"> 809 <div class="col-12 col-md-5 mb-3 mb-md-0 order-md-2"> 810 @using System.Runtime.Remoting.Contexts 811 @using System.Text.RegularExpressions 812 @using Co3.Espresso.Base.Extensions 813 @using Co3.Espresso.Website.Services 814 @using Dynamicweb.Ecommerce.Extensibility.Provider 815 @using Dynamicweb.Ecommerce.Products 816 @using Dynamicweb.Frontend 817 @using Co3.Isabella.Data.DAL.Models 818 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 819 @using Dynamicweb.Content.Items 820 @using Dynamicweb.Ecommerce.International 821 @using Dynamicweb.Ecommerce.Orders 822 @using Dynamicweb.Security.UserManagement 823 @using Newtonsoft.Json 824 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 825826 @{ 827 double colli = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 828 double value = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 829830 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 831 IsabellaStock stockObject = isabellaProduct.Stock; 832 StockStatus mainStockStatus = stockObject.Status; 833 double stock = stockObject.Stock; 834 bool allowBuyIfOutOfStock = false; 835 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 836837 bool canBuyIfOutOfStock = true; 838 double totalStockMainAndRelated = 0; 839840 bool pimActive = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.PIMActive.Value"); 841 bool lockColliB2c = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2C.Value"); 842 bool lockColliB2b = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2B.Value"); 843 bool hidePriceFieldValue = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.HidePrice.Value"); 844 bool userCanBuy = false; 845 bool lockColli = false; 846847 bool isIsabellaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsabellaProduct.Value"); 848 bool isCampletProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.CampletProduct.Value"); 849 bool isVillaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.VillaProduct.Value"); 850 bool isAccessorieProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value"); 851852 bool isNoBuyB2C = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value"); 853 bool isNoBuyB2B = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value"); 854855 string userDealerType = string.Empty; 856857 bool isDiscontinued = pimActive == false; 858 bool hasRelatedProducts = false; 859860 totalStockMainAndRelated += stock; 861862 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 863864 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && shopType == "Hybrid"; 865 bool isNoBuyWithPricesShop = noBuyB2BandB2C && shopType == "NoBuy"; 866867 bool hidePrice = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 868869870 if (isUserAuthenticated == false) 871 { 872 if (mainStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) 873 { 874 canBuyIfOutOfStock = false; 875 } 876 userCanBuy = true; 877 } 878 else 879 { 880 Item item = null; 881 if ( !string.IsNullOrEmpty(PageView.Current().User.ItemType)) 882 { 883 item = Dynamicweb.Services.Items.GetItem(PageView.Current().User.ItemType, PageView.Current().User.ItemId); 884 } 885886887 if (item != null && item.ContainsKey("Type") && item["Type"] != null) 888 { 889 userDealerType = item["Type"].ToString(); 890 } 891 if (string.IsNullOrEmpty(userDealerType)) 892 { 893 userDealerType = string.Empty; 894 } 895896897 if (isIsabellaProduct && userDealerType.Contains("Isabella") == true) 898 { 899 userCanBuy = true; 900 } 901 else if (isCampletProduct && userDealerType.Contains("Camplet") == true) 902 { 903 userCanBuy = true; 904 } 905 else if (isVillaProduct && userDealerType.Contains("Villa") == true) 906 { 907 userCanBuy = true; 908 } 909 } 910911 if (isUserAuthenticated == false && lockColliB2c == true) 912 { 913 lockColli = true; 914 } 915 else if (isUserAuthenticated == true && lockColliB2b == true) 916 { 917 lockColli = true; 918 } 919920 if (colli == 0) 921 { 922 colli = 0; 923 value = 1; 924 } 925 Dictionary<string, RelatedProductInfo> temp = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedProducts(product); 926927 string howItWorksPage = Espresso.Page.Area.Item["Product_Page_HowItWorks"]?.ToString().ToLower().Replace("default.aspx?id=", ""); 928 object findDealerLink = Espresso.Page.Area.Item["FindDealer"]?.ToString(); 929930 if (isHybridShop || isNoBuyWithPricesShop) 931 { 932 userCanBuy = false; 933 canBuyIfOutOfStock = false; 934 } 935936 } 937938 <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"> 939 <input name="CartCmd" type="hidden" value="addMulti"> 940 <input name="Redirect" type="hidden" value=""> 941 <input name="Name" type="hidden" value="@eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"))"> 942 <input name="Number" type="hidden" value="@GetString("Ecom:Product.Number")"> 943 @if (hidePrice == false) 944 { 945 <input name="Price" type="hidden" value="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price.ToJavaScript()"> 946 } 947948 <input name="OrderContext" type="hidden" value="@OrderContext"> 949 <input name="ProductCurrencyCode" type="hidden" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 950 <h3 class="mb-1 mt-1">@Translate("eCom Product - Add To Cart Form Table - Choose product - Heading", "Vælg Produkt")</h3> 951 @if (pimActive == false) 952 { 953 <div class="alert alert-danger"> 954 <p class="m-0"> 955 @Translate("eCom Product - Add To Cart Form Table - Model Discontinued - Text", "Denne model er udgået, nedenfor kan du købe tilbehør") 956 </p> 957 </div> 958 } 959960 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 961 { 962 <div class="alert alert-danger @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 963 <p class="m-0"> 964 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 965 { 966 @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") 967 } 968 else 969 { 970 @Translate("eCom Product - Add To Cart Form Table - Model Out of Stock - Text", "Denne model er udsolgt, nedenfor kan du købe tilbehør") 971 } 972 </p> 973 </div> 974 } 975976 <div class="table-container" role="table"> 977978 <div class="flex-table header" role="rowgroup"> 979 <div class="first flex-row w-40" role="columnheader"></div> 980 @if (noBuyB2BandB2C == false) 981 { 982 <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> 983 <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> 984 } 985 @if ((isHybridShop == true && hidePrice == false) || isNoBuyWithPricesShop) 986 { 987 <div class="flex-row w-40" role="columnheader"> 988 @Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris") 989 </div> 990 } 991 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 992 </div> 993 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 994 <div class="align-self-center first flex-row w-40" role="cell"> 995 @eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 996 <br/> 997 <span class="text-muted">@GetString("Ecom:Product.Number")</span> 998 </div> 999 @if (noBuyB2BandB2C == false) 1000 { 1001 <div class="align-self-center center flex-row w-10" role="cell"> 1002 @if (isDiscontinued == false && noBuyB2BandB2C == false) 1003 { 1004 @GetProductStockByStatus(product, allowBuyIfOutOfStock) 1005 } 1006 </div> 1007 } 1008 @if (noBuyB2BandB2C == false) 1009 { 1010 <div class="align-self-center center flex-row w-30" role="cell"> 1011 @if (isDiscontinued == false) 1012 { 1013 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1014 <div class="d-flex flex-column"> 1015 @if (!noBuyB2BandB2C && !hidePrice) 1016 { 1017 <div @(priceCheck <= 0 ? "hidden" : string.Empty)> 1018 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1019 </div> 1020 } 1021 @if (noBuyB2BandB2C) 1022 { 1023 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1024 } 1025 else if (mainStockStatus == StockStatus.InStockAtRemote) 1026 { 1027 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1028 } 1029 else if (canBuyIfOutOfStock == false && allowBuyIfOutOfStock == false) 1030 { 1031 <p class="m-0 text-danger">@Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt")</p> 1032 } 1033 </div> 1034 } 10351036 </div> 1037 } 1038 else if (isHybridShop || isNoBuyWithPricesShop) 1039 { 1040 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1041 if (!hidePrice || isNoBuyWithPricesShop) 1042 { 1043 <div class="align-self-center center flex-row w-40" role="cell"> 1044 <div class="d-flex flex-column small"> 1045 <span> 1046 @if (priceCheck > 0) 1047 { 1048 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1049 } 1050 else 1051 { 1052 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Missing Price - Text", "Pris mangler")</p> 1053 } 1054 </span> 10551056 </div> 1057 </div> 1058 } 1059 } 1060 <div class="align-self-center flex-row w-20 ml-auto" role="cell"> 1061 @if (isDiscontinued == false && canBuyIfOutOfStock == true) 1062 { 1063 <input name="ProductID0" type="hidden" value="@GetString("Ecom:Product.ID")"> 1064 <input id="ProductLoopCounter0" name="ProductLoopCounter0" type="hidden" value="0"> 1065 <input name="VariantID0" type="hidden" value=""> 1066 if (noBuyB2BandB2C || isHybridShop || isNoBuyWithPricesShop) 1067 { 1068 @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")) 1069 } 1070 else 1071 { 1072 if (lockColli) 1073 { 1074 <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"> 1075 } 1076 else 1077 { 1078 <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"> 1079 } 1080 } 1081 } 1082 else 1083 { 1084 <p class="m-0 text-danger"> 1085 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 1086 { 1087 @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")) 1088 } 1089 else if (isDiscontinued == true) 1090 { 1091 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1092 } 10931094 </p> 1095 } 1096 </div> 1097 </div> 1098 </div> 10991100 @if (temp != null) 1101 { 1102 int relatedCounter = 1; 1103 <div class="accordion" id="relatedProductsCollapse"> 11041105 @foreach (string key in temp.Keys) 1106 { 1107 if (string.IsNullOrEmpty(key) == false) 1108 { 1109 bool doValidateFrame = !isHybridShop || key == "Frames" || key == "AccessoriesWithFrames"; 11101111 <div class="border-top isabella-product-form-heading py-1" id="isabella-product-form-heading-@key" data-key="@key"> 1112 <h4 class="mb-0"> 1113 <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"> 11141115 @{ 1116 object header = temp[key].Name; 11171118 if (header != null) 1119 { 1120 @header.ToString() 1121 } 1122 } 11231124 <i class="order-last p-accordion-toggle-icon-img"> </i> 11251126 </a> 1127 </h4> 1128 </div> 112911301131 <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"> 1132 <div class="px-1 table-container" role="table"> 1133 <div class="flex-table header" role="rowgroup"> 1134 <div class="first flex-row w-40 " role="columnheader"></div> 1135 @if (noBuyB2BandB2C == false) 1136 { 1137 <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> 1138 <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> 1139 } 1140 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1141 { 1142 <div class="flex-row w-40" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris")</div> 1143 } 1144 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 1145 </div> 11461147 @{ 1148 bool showAcceptRow = true; 1149 } 11501151 @if (temp[key] != null) 1152 { 1153 List<string> usedProductIds = new List<string>(); 1154 foreach (RelatedProduct relatedProduct in temp[key].RelatedProducts) 1155 { 1156 double totalPackagePrice = 0; 1157 double totalPackageColli = 0; 1158 bool totalIsInStock = true; 1159 string relatedPackageName = string.Empty; 1160 string fallbackProductName = string.Empty; 1161 string productItemDescription = string.Empty; 1162 string stockStatus = string.Empty; 1163 bool isPimActive = true; 1164 bool canBuyRelatedIfOutOfStock = true; 1165 StockStatus _tempStockStatus = new StockStatus(); 1166 bool isGroup = string.IsNullOrEmpty(relatedProduct.Name) == false; 1167 bool relatedStockStatusForGroupAtRemote = false; 1168 hasRelatedProducts = relatedProduct.Products.Any(); 11691170 Dictionary<string, dynamic> packs = new Dictionary<string, dynamic>(); 11711172 if (isGroup == true) 1173 { 1174 <div class="flex-table js-isabella-product-form-row" role="rowgroup" data-group="true"> 1175 <div class="align-self-center first flex-row w-40" role="cell"> 11761177 @foreach (Product item in relatedProduct.Products) 1178 { 1179 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1180 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1181 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1182 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 1183 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1184 fallbackProductName = item.Name; 11851186 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1187 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1188 StockStatus relatedStockStatus = relatedStockObject.Status; 1189 double relatedStock = relatedStockObject.Stock; 11901191 if (relatedStockStatus == StockStatus.OutOfStock) 1192 { 1193 _tempStockStatus = relatedStockStatus; 1194 } 11951196 if (usedProductIds.Contains(item.Id)) 1197 { 1198 continue; 1199 } 12001201 usedProductIds.Add(item.Id); 120212031204 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 120512061207 if (isHybridShop || (isUserAuthenticated == false && relatedStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) || isNoBuyWithPricesShop) 1208 { 1209 canBuyRelatedIfOutOfStock = false; 1210 showAcceptRow = false; 1211 _tempStockStatus = relatedStockStatus; 1212 } 1213 if (_tempStockStatus != StockStatus.OutOfStock) 1214 { 1215 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 1216 } 12171218 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1219 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 12201221 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1222 totalStockMainAndRelated += relatedStock; 1223 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1224 { 1225 totalIsInStock = false; 1226 } 122712281229 totalPackagePrice += itemPrice; 12301231 if (isPimActive == true && canBuyRelatedIfOutOfStock == true) 1232 { 1233 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1234 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1235 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1236 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1237 } 1238 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1239 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 1240 relatedCounter++; 1241 @* 1242 <script> 1243 var debugInfo = debugInfo || {}; 1244 debugInfo["@relatedPackageName"] = { 1245 "isPimActive" : "@isPimActive", 1246 "canBuyRelatedIfOutOfStock" : "@canBuyRelatedIfOutOfStock", 1247 "noBuyB2BandB2C" : "@noBuyB2BandB2C", 1248 "relatedStockStatus": "@relatedStockStatus", 1249 "totalIsInStock": "@totalIsInStock" 1250 }; 1251 </script> 1252 *@ 12531254 packs[relatedPackageName] = new 1255 { 1256 isPimActive = isPimActive, 1257 canBuyRelatedIfOutOfStock = canBuyRelatedIfOutOfStock, 1258 noBuyB2BandB2C = noBuyB2BandB2C, 1259 isHybridShop = isHybridShop, 1260 relatedStockStatus = relatedStockStatus, 1261 totalIsInStock = totalIsInStock, 1262 noBuyB2C = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C"), 1263 noBuyB2B = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B") 1264 }; 1265 } 1266 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1267 { 1268 @relatedPackageName 1269 } 1270 else 1271 { 1272 @fallbackProductName 1273 } 12741275 @{ 1276 dynamic pack = new { }; 1277 } 12781279 @if (packs.ContainsKey(relatedPackageName)) 1280 { 1281 pack = packs[relatedPackageName]; 1282 } 1283128412851286 @if (!string.IsNullOrEmpty(productItemDescription)) 1287 { 1288 <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> 1289 } 12901291 </div> 12921293 @if (noBuyB2BandB2C == false) 1294 { 1295 <div class="align-self-center center flex-row w-10" role="cell"> 1296 @if (!noBuyB2BandB2C) 1297 { 1298 @stockStatus 1299 } 1300 </div> 1301 } 13021303 @if (noBuyB2BandB2C == false) 1304 { 1305 <div class="align-self-center center flex-row w-30 " role="cell"> 1306 <div class="d-flex flex-column"> 1307 @if (!noBuyB2BandB2C && !hidePrice) 1308 { 1309 <div> 1310 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1311 </div> 1312 } 1313 @if (noBuyB2BandB2C) 1314 { 1315 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1316 } 1317 else if (relatedStockStatusForGroupAtRemote) 1318 { 1319 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1320 } 1321 </div> 1322 </div> 1323 } 1324 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1325 { 1326 <div class="align-self-center center flex-row w-40 " role="cell"> 1327 <div class="d-flex flex-column"> 1328 <div class="small"> 1329 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1330 </div> 1331 </div> 1332 </div> 1333 } 1334 <div class="align-self-center center flex-row w-20 ml-auto" role="cell"> 13351336 @if (isPimActive == true && (canBuyRelatedIfOutOfStock || pack.relatedStockStatus != StockStatus.OutOfStock) == true && (noBuyB2BandB2C == false || isUserAuthenticated == false && pack.noBuyB2C == false || isUserAuthenticated == true && pack.noBuyB2B == false)) 1337 { 1338 if (isHybridShop || isNoBuyWithPricesShop) 1339 { 1340 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1341 } 1342 else 1343 { 1344 <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"> 1345 } 1346 } 1347 else 1348 { 1349 <p class="m-0 text-danger align-self-center"> 1350 @if (canBuyRelatedIfOutOfStock == false) 1351 { 1352 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv")) 1353 } 1354 else if (isPimActive == false) 1355 { 1356 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1357 } 1358 else 1359 { 1360 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1361 } 1362 </p> 1363 } 136413651366 </div> 13671368 </div> 1369 } 1370 else 1371 { 1372 foreach (Product item in relatedProduct.Products) 1373 { 1374 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1375 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1376 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1377 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 13781379 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1380 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1381 StockStatus relatedStockStatus = relatedStockObject.Status; 1382 double relatedStock = relatedStockObject.Stock; 13831384 fallbackProductName = item.Name; 1385 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1386 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 1387 totalStockMainAndRelated += relatedStock; 1388 totalStockMainAndRelated += item.Stock; 1389 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1390 { 1391 totalIsInStock = false; 1392 } 13931394 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 1395 <div class="align-self-center first flex-row w-40" role="cell"> 1396 @if (isPimActive == true) 1397 { 1398 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1399 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1400 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1401 <input class="js-isabella-related-product-child-quantity-input" name="@quantiInputName" type="hidden" value="0"> 1402 } 1403 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1404 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 14051406 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1407 { 1408 @relatedPackageName 1409 } 1410 else 1411 { 1412 @fallbackProductName 1413 } 1414 @if (key != "Frames" && key != "AccessoriesWithFrames") 1415 { 1416 <br/> 1417 <span class="text-muted">@item.Number</span> 1418 } 1419142014211422 @if (!string.IsNullOrEmpty(productItemDescription)) 1423 { 1424 <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> 1425 } 1426 </div> 14271428 @if (noBuyB2BandB2C == false) 1429 { 1430 <div class="align-self-center center flex-row w-10 " role="cell"> 1431 @GetProductStockByStatus(item, allowBuyIfOutOfStock) 1432 </div> 1433 } 1434 @if (noBuyB2BandB2C == false) 1435 { 1436 <div class="align-self-center center flex-row w-30" role="cell"> 1437 <div class="d-flex flex-column"> 1438 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1439 </div> 1440 </div> 1441 } 1442 @if (isHybridShop) 1443 { 1444 <div class="align-self-center center flex-row w-40" role="cell"> 1445 <div class="d-flex flex-column"> 1446 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1447 </div> 1448 </div> 1449 } 1450 @if (isNoBuyWithPricesShop) 1451 { 1452 <div class="align-self-center center flex-row w-40" role="cell"> 1453 <div class="d-flex flex-column"> 1454 @GetPriceByRelatedProductItem(item, false, false, false) 1455 </div> 1456 </div> 1457 } 1458 <div class="flex-row align-self-center w-20 ml-auto" role="cell"> 1459 @GetQuantityInputByRelatedProductItem(item, isUserAuthenticated, key, lockColli) 1460 </div> 1461 </div> 1462 relatedCounter++; 1463 } 1464 } 1465 } 1466 } 1467 @if ((key == "Frames" || key == "AccessoriesWithFrames") && showAcceptRow) 1468 { 1469 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 1470 <div class="form-group js-isabella-accept-no-frame-row" style="display: @(key == "AccessoriesWithFrames" ? "none" : "block")"> 1471 <div class="form-check"> 1472 <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"> 1473 <label class="form-check-label pl-1 d-inline" for="acceptNoFrame-@key"> 1474 @Translate("eCom Product - Add To Cart Form Table - Confirm No Frame - Text", "Jeg bekræfter hermed, at jeg ikke ønsker et stel") 1475 </label> 1476 </div> 1477 </div> 1478 </div> 1479 } 1480 </div> 14811482 </div> 1483 } 1484 } 1485 </div> 1486 } 14871488 <div class="border-top mt-0 table-container" role="table"> 1489 @if(!hidePrice){ 1490 <div class="flex-table mt-1 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1491 <div class="align-self-center first flex-row h4 w-50" role="cell"> 1492 @Translate("eCom Product - Add To Cart Form Table - Total Price Text", "I alt") 1493 </div> 1494 <div class="flex-row h3 text-right w-50" role="cell"> 1495 <div class="js-isabella-calculated-price"> 1496 @if (isDiscontinued == false) 1497 { 1498 if (isUserAuthenticated == true) 1499 { 1500 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true) 1501 { 1502 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1503 } 1504 else 1505 { 1506 @eProductService.Instance.GetPriceFormatted(0) 1507 } 1508 } 1509 else 1510 { 1511 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true) 1512 { 1513 if (mainStockStatus == StockStatus.OutOfStock) 1514 { 1515 @eProductService.Instance.GetPriceFormatted(0) 1516 } 1517 else 1518 { 1519 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1520 } 1521 } else{ 1522 @eProductService.Instance.GetPriceFormatted(0) 1523 } 1524 } 1525 } 1526 else 1527 { 1528 @eProductService.Instance.GetPriceFormatted(0) 1529 } 15301531 </div> 1532 </div> 1533 </div> 1534 } 1535 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1536 @if (!isOutlet) 1537 { 1538 <div class="align-self-center first flex-row w-50" role="cell"> 1539 @if (!string.IsNullOrEmpty(howItWorksPage)) 1540 { 1541 <a class="text-underline" data-target="#howItWorksModal" data-toggle="modal"> 1542 @if (isUserAuthenticated == false) 1543 { 1544 @Translate("eCom Product - How It works Modal - Button Text", "Sådan fungerer det") 1545 } 1546 else 1547 { 1548 @Translate("eCom Product - How It works Modal B2B - Button Text", "Sådan fungerer det") 1549 } 1550 </a> 1551 } 1552 </div> 1553 } 1554 else 1555 { 1556 <div class="align-self-center first flex-row w-50" role="cell"></div> 1557 } 15581559 @if (!hidePrice) 1560 { 15611562 <div class="flex-row text-right w-50" role="cell"> 15631564 @if (noBuyB2BandB2C == false && userCanBuy == true) 1565 { 1566 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1567 { 1568 if (totalStockMainAndRelated == 0) 1569 { 1570 <p class="m-0 "></p> 1571 } 1572 else 1573 { 1574 if ((isDiscontinued == true && hasRelatedProducts == false) || shopType == "B2C") 1575 { 1576 <p class="m-0 "></p> 1577 } 1578 else 1579 { 1580 if (!isOutlet) 1581 { 1582 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Klik og hent - Button", "Klik og hent")</button> 1583 } 1584 else 1585 { 1586 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Order - Button", "Order now")</button> 1587 } 15881589 } 1590 } 1591 } 15921593 if ((GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true && isUserAuthenticated == true) || shopType == "B2C" && GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1594 { 1595 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Cart - Button", "Add to cart")</button> 1596 } 1597 } 1598 @if (userCanBuy == false || GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") == true && isUserAuthenticated == false || (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") == true && isUserAuthenticated == true)) 1599 { 1600 <h4 class="mb-0 text-primary">@Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")</h4> 1601 } 16021603 </div> 1604 } 1605 </div> 1606 @if (!isOutlet) 1607 { 1608 <div class="flex-table" role="rowgroup"> 1609 <div class="align-self-center first flex-row w-50 pr-1" role="cell"> 1610 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1611 { 1612 @Translate("Product page - Not On Stock Info B2B - Text", "B2B relevant text") 1613 } 1614 else 1615 { 1616 @Translate("Product page - Not On Stock Info - Start Text", "Er varen ikke på lager kontakt Isabellas salgsafdeling på") 1617 <span class="text-primary">@Translate("Product page - Contact Phone - Number", "76497292")</span> 1618 @Translate("Product page - Not On Stock Info - End Textr", "eller send en mail") 1619 } 1620 </div> 1621 <div class="flex-row text-right w-50" role="cell"> 1622 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1623 { 1624 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer B2B - Link", "Find forhandler")</a> 1625 } 1626 else 1627 { 1628 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer - Link", "Find forhandler")</a> 1629 } 1630 </div> 1631 <div class="mt-2 p-0 col-12"> 1632 @if ( isUserAuthenticated == true ) 1633 { 1634 <div class="col-12"> 1635 <div class="row"> 1636 <div class="col-6"> 1637 @using Dynamicweb.Frontend 1638 <div class="dropdown"> 1639 <a class="dropdown-toggle" data-toggle="dropdown"> 1640 <i class="material-icons material-icons-large">playlist_add</i> @Translate( "eCom Product - Add to favorites - Link", "Add to favorites" ) 1641 </a> 1642 <div class="dropdown-menu pt-0"> 1643 <h4 class="dropdown-header">@Translate( "eCom Product - Add to favorite list - Heading", "Add to ..." )</h4> 1644 <form action="" class="js-e-product-cc-list-form mt-1"> 1645 @foreach ( LoopItem listType in GetLoop( "CustomerCenter.ListTypes" ) ) 1646 { 1647 foreach ( LoopItem list in listType.GetLoop( "CustomerCenter.ProductLists" ) ) 1648 { 1649 <div class="dropdown-item"> 1650 <label class="custom-checkbox custom-control m-0"> 1651 <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" )"> 1652 <span class="custom-control-indicator"></span> 1653 <span class="custom-control-description">@list.GetString( "Ecom:CustomerCenter.List.Name" )</span> 1654 </label> 1655 </div> 1656 } 1657 } 1658 </form> 1659 <div class="dropdown-divider"></div> 1660 <a class="dropdown-item" href="@PageView.Current().Area.Item[ "ExtranetListsPage" ]"><i class="material-icons">add</i> @Translate( "eCom Product - Add new favorite list - Link", "Create a new list" )</a> 1661 </div> 1662 </div> 166316641665 </div> 1666 <div class="col-6"> 1667 <p> 1668 <a class="text-dark" href="@signBuilderUrl"> 1669 <i class="e-nav-pageicon material-icons">image</i> @Translate( "eCom Product - SignBuilder - Text", "Opret prisskilt (pdf)" )</a> 1670 </p> 1671 </div> 1672 </div> 1673 </div> 1674 } 1675 <div class="col-12"> 1676 <p> 1677 <a class="js-isabella-product-details-pdf-generate text-primary" href="#"> 1678 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download PDF - Text", "Hent produkt-PDF" )</a> 1679 </p> 1680 </div> 16811682 </div> 1683 </div> 1684 } 16851686 </div> 1687 </form> 16881689 <!-- Modal --> 1690 <div aria-hidden="true" aria-labelledby="howItWorksModalLabel" class="fade modal" id="howItWorksModal" role="dialog" tabindex="-1"> 1691 <div class="modal-dialog" role="document"> 1692 <div class="modal-content"> 1693 <div class="modal-body"> 1694 @if (!string.IsNullOrEmpty(howItWorksPage)) 1695 { 1696 @RenderPageContent(int.Parse(howItWorksPage)) 1697 } 1698 </div> 1699 </div> 1700 </div> 1701 </div> 170217031704 @functions 1705 { 170617071708 public string GetPriceByRelatedProductItem(Product item, bool isUserAuthenticated, bool allowBuyIfOutOfStock, bool hidePrice) 1709 { 1710 string returnValue = string.Empty; 1711 bool isPimActive = false; 1712 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 17131714 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1715 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 17161717 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1718 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1719 string textNoBuy = Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online"); 1720 string textNotInStock = Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt"); 1721 string textAtRemote = Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager"); 17221723 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1724 IsabellaStock stockObject = isabellaProduct.Stock; 1725 StockStatus stockStatus = stockObject.Status; 172617271728 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1729 { 1730 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1731 } 17321733 if (isPimActive) 1734 { 1735 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 17361737 if (hidePrice) 1738 { 1739 return ""; 1740 } 17411742 if (noBuyB2BandB2C) 1743 { 1744 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1745 } 1746 else 1747 { 1748 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1749 if (allowBuyIfOutOfStock == true) 1750 { 1751 return returnValue; 1752 } 17531754 if ((isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1755 { 1756 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1757 } 1758 else if (stockStatus == StockStatus.OutOfStock) 1759 { 1760 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNotInStock); 1761 } 1762 else if (stockStatus == StockStatus.InStockAtRemote) 1763 { 1764 returnValue += string.Format("<p class=\"m-0 text-muted\">{0}</p>", textAtRemote); 1765 } 1766 } 1767 if (isHybridShop || isNoBuyWithPricesShop) 1768 { 1769 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1770 } 1771 } 1772 return returnValue; 1773 } 17741775 public string GetQuantityInputByRelatedProductItem(Product item, bool isUserAuthenticated, string itemKey, bool lockColli) 1776 { 1777 string returnValue = string.Empty; 1778 bool isPimActive = false; 1779 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1780 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1781 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 17821783 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1784 { 1785 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1786 } 17871788 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1789 IsabellaStock stockObject = isabellaProduct.Stock; 1790 StockStatus stockStatus = stockObject.Status; 17911792 bool allowBuyIfOutOfStock = false; 1793 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 17941795 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1796 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1797 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1798 string textNoBuy = Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online"); 1799 string textNotInStockInput = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1800 if (isPimActive && stockStatus != StockStatus.OutOfStock || allowBuyIfOutOfStock == true) 1801 { 1802 if (noBuyB2BandB2C || (isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1803 { 1804 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1805 } 1806 else 1807 { 1808 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); 1809 } 1810 } 1811 else 1812 { 1813 if (isPimActive == false) 1814 { 1815 returnValue = string.Format("<p class=\"m-0 text-danger\">{0}</p>", Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået")); 1816 } 1817 else 1818 { 1819 if (noBuyB2BandB2C || isUserAuthenticated == false) 1820 { 1821 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, noBuyB2BandB2C ? textNoBuy : textNotInStockInput); 1822 } 1823 else 1824 { 1825 if (noBuyB2BandB2C || noBuyB2BRelated == "True") 1826 { 1827 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1828 } 1829 else 1830 { 1831 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); 1832 } 1833 } 1834 } 1835 } 1836 if (isHybridShop || isNoBuyWithPricesShop) 1837 { 1838 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1839 } 1840 return returnValue; 1841 } 18421843 public string GetPdfOnlyQuantityInput(double itemPrice, string itemKey, string popoverText) 1844 { 1845 bool isUserAuthenticated = PageView.Current().User != null; 1846 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1847 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1848 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 1849 if (isHybridShop) 1850 { 1851 popoverText = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1852 } 1853 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); 1854 } 18551856 public bool ShouldShowStock(Product item) 1857 { 1858 bool returnValue = false; 18591860 bool isPimActive = false; 18611862 if (item != null && item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1863 { 1864 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1865 } 18661867 returnValue = isPimActive; 18681869 return returnValue; 1870 } 18711872 public string GetProductStockByStatus(Product product, bool allowBuyIfOutOfStock) 1873 { 1874 string returnValue = string.Empty; 18751876 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 187718781879 if (product != null) 1880 { 1881 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 1882 IsabellaStock stockObject = isabellaProduct.Stock; 1883 StockStatus stockStatus = stockObject.Status; 18841885 if (ShouldShowStock(product) == false || allowBuyIfOutOfStock == true) 1886 { 1887 return returnValue; 1888 } 18891890 switch (stockStatus.ToString()) 1891 { 1892 case "InStock": 1893 returnValue = "<span class=\"text-success\">●</span>"; 1894 break; 1895 case "InStockAtRemote": 1896 returnValue = "<span class=\"text-warning\">●</span>"; 1897 break; 1898 case "OutOfStock": 1899 returnValue = "<span class=\"text-danger\">●</span>"; 1900 break; 1901 } 1902 } 1903 else 1904 { 1905 returnValue = "<span class=\"text-danger\">●</span>"; 1906 } 19071908 if (noBuyB2BandB2C) 1909 { 1910 returnValue = ""; 1911 } 19121913 return returnValue; 1914 } 1915 } 1916 </div> 1917 <div class="col-12 col-md-7 order-md-1"> 1918 @using Co3.Espresso.Base.Extensions 1919 @using Co3.Espresso.Website.Services 1920 @using Dynamicweb.Admin.dk.dynamicweb.templates 1921 @using Dynamicweb.Ecommerce.Products 1922 @using Dynamicweb.Ecommerce.Products.Categories 1923 @using Dynamicweb.Ecommerce.Products.FieldDisplayGroups 1924 @using Dynamicweb.Frontend 1925 @using ProductService = Co3.Isabella.Dw.Services.ProductService 19261927 @{ 1928 //Hard coded group ID's from Model Display Groups // 1929 List< string > modelDisplayGroupIds = new List< string >(); 1930 modelDisplayGroupIds.Add("7"); 1931 List< LoopItem > modelDisplayGroupList = new List< LoopItem >(); 1932 } 19331934 <div class="col-12 p p-accordion"> 1935 <div class="p-accordion-container "> 1936 <div class="border-bottom e-reveal-done mb-0 p-accordion-item"> 19371938 @{ 1939 int displayGroupCount = 0; 1940 } 19411942 @foreach (LoopItem groupItem in GetLoop("FieldDisplayGroups")) 1943 { 19441945 string displayGroupId = groupItem.GetString("Ecom:FieldDisplayGroup.ID"); 19461947 if (modelDisplayGroupIds.Contains(groupItem.GetString("Ecom:FieldDisplayGroup.ID"))) 1948 { 1949 modelDisplayGroupList.Add(groupItem); 1950 } 1951 else 1952 { 1953 List<LoopItem> fieldItems = new List<LoopItem>(); 1954 bool hasValues = false; 19551956 foreach (LoopItem fieldItem in groupItem.GetLoop("Fields")) 1957 { 1958 fieldItems.Add(fieldItem); 1959 if (!string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value"))) 1960 { 1961 hasValues = true; 1962 } 1963 } 19641965 if (hasValues == true) 1966 { 1967 <div class="p-accordion-toggle"> 1968 <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"> 1969 <span class="font-weight-bold line-height-sm my-0 p-accordion-toggle-text text-auto">@groupItem.GetString("Ecom:FieldDisplayGroup.Name")</span> 1970 <i class="order-last p-accordion-toggle-icon-img"> </i> 1971 </p> 1972 </div> 1973 <div class="collapse @(displayGroupCount == 0 ? "show" : string.Empty)" id="accordion-id-@displayGroupId"> 1974 <div class="pb-2"> 1975 <div class="row"> 1976 @{ 1977 int loopCounter = 0; 1978 } 197919801981 @foreach (LoopItem fieldItem in fieldItems) 1982 { 1983 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("Color")) 1984 { 1985 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 1986 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 1987 string fieldImage = string.Empty; 19881989 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 1990 { 1991 if (fieldValue.Length == fieldLabel.Length) 1992 { 1993 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 19941995 JSON.pdfData.colors.Add(new 1996 { 1997 fieldLabel = fieldValue[sharedArrayIndex], 1998 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 1999 imageUri = string.Empty 2000 }); 2001 } 2002 } 2003 } 20042005 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMatch")) 2006 { 2007 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2008 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2009 string fieldImage = string.Empty; 20102011 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2012 { 2013 if (fieldValue.Length == fieldLabel.Length) 2014 { 2015 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 20162017 JSON.pdfData.frameMatch.Add(new 2018 { 2019 fieldLabel = fieldValue[sharedArrayIndex], 2020 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2021 imageUri = string.Empty 2022 }); 2023 } 2024 } 2025 } 20262027 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("MiscFrameMaterial")) 2028 { 2029 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2030 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2031 string fieldImage = string.Empty; 20322033 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2034 { 2035 if (fieldValue.Length == fieldLabel.Length) 2036 { 2037 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 20382039 JSON.pdfData.miscFrameMaterial.Add(new 2040 { 2041 fieldLabel = fieldValue[sharedArrayIndex], 2042 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2043 imageUri = string.Empty 2044 }); 2045 } 2046 } 2047 } 20482049 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMaterial")) 2050 { 2051 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2052 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2053 string fieldImage = string.Empty; 20542055 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2056 { 2057 if (fieldValue.Length == fieldLabel.Length) 2058 { 2059 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 20602061 JSON.pdfData.frameMaterial.Add(new 2062 { 2063 fieldLabel = fieldValue[sharedArrayIndex], 2064 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2065 imageUri = string.Empty 2066 }); 2067 } 2068 } 2069 } 20702071 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")) 2072 { 2073 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2074 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2075 if (categoryFieldIds.Length == 3) 2076 { 2077 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2078 translatedFieldLabel = translatedField.Label; 2079 } 2080 <div class="col-12"> 2081 @{ 2082 string[] colorValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2083 string[] colorLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2084 string colorImagePng = string.Empty; 2085 } 2086208720882089 @if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2090 { 20912092 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 20932094 <div class="row"> 2095 @for (int sharedArrayIndex = 0; sharedArrayIndex < colorValue.Length; sharedArrayIndex++) 2096 { 2097 if (colorValue.Length == colorLabel.Length) 2098 { 2099 colorImagePng = colorValue[sharedArrayIndex] + ".png"; 2100 <div class="col-4 mb-2"> 2101 <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"> 2102 <div> 2103 @colorLabel[sharedArrayIndex] 2104 </div> 2105 </div> 2106 } 2107 } 2108 </div> 2109 } 21102111 </div> 2112 } 2113 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name").Contains("VideoPresentation") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value") != "") 2114 { 2115 <div class="col-12 mb-2"> 2116 <div class="col-12 px-0 mt-1"> 2117 <div class="embed-responsive embed-responsive-16by9"> 2118 <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> 2119 <div class="cookieconsent-optout-marketing"> 2120 <div> 2121 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2122 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2123 </a> 21242125 </div> 2126 </div> 2127 </div> 2128 </div> 2129 </div> 2130 } 2131 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".jpg")) 2132 { 2133 <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)"/> 2134 } 2135 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".pdf")) 2136 { 2137 <div class="col-5 col-lg-3 d-flex"> 2138 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2139 </div> 2140 <div class="col-7 col-lg-9 d-flex flex-column"> 2141 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Replace("../", "/Files/")"> 2142 @Translate("eCom Product = Download PDF - Link", "Download pdf here") 2143 </a> 2144 </div> 2145 } 2146 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Link")) 2147 { 2148 <div class="col-5 col-lg-3 d-flex"> 2149 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2150 </div> 2151 <div class="col-7 col-lg-9 d-flex flex-column"> 2152 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")"> 2153 @Translate("eCom Product - View more - Text", "View more") 2154 </a> 2155 </div> 2156 } 2157 else 2158 { 2159 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2160 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2161 if (categoryFieldIds.Length == 3) 2162 { 2163 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2164 translatedFieldLabel = translatedField.Label; 2165 } 21662167 switch (groupItem.GetString("Ecom:FieldDisplayGroup.ID")) 2168 { 2169 case "11": // Delivery Width 2170 <div class="col-12"> 2171 <div class="row"> 2172 <div class="col-12 col-md-6"> 2173 <p> 2174 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2175 { 2176 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2177 } 2178 else 2179 { 2180 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2181 } 2182 </p> 2183 </div> 2184 <div class="col-12 col-md-6"> 2185 @using Dynamicweb.Admin.dk.dynamicweb.templates 21862187 @{ 2188 string deliveryCarouselClassList = "d-none"; 2189 } 21902191 <div class="e-product-image-container"> 2192 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-delivery"> 2193 <div class="e-product-image-wrapper"> 2194 <div class="carousel-inner"> 2195 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2196 { 2197 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2198 { 2199 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2200 { 2201 if (image.Element.Index == 1 ) 2202 { 2203 isActive = "active"; 2204 } 2205 else 2206 { 2207 isActive = ""; 2208 } 2209 if (image.Index != 0 ) 2210 { 2211 deliveryCarouselClassList = "d-flex"; 2212 } 2213 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-delivery" data-toggle="modal"> 2214 <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 )"> 2215 </div> 2216 } 2217 } 2218 } 22192220 <a class="carousel-control-prev @deliveryCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-delivery"></a> 2221 <a class="carousel-control-next @deliveryCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-delivery"></a> 22222223 </div> 2224 </div> 2225 <ol class="carousel-indicators @deliveryCarouselClassList"> 2226 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2227 { 2228 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2229 { 2230 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2231 { 2232 if (image.Element.Index == 1 ) 2233 { 2234 isActive = "active"; 2235 } 2236 else 2237 { 2238 isActive = ""; 2239 } 2240 <li class="@isActive" data-target="#js-e-product-image-carousel-delivery" data-slide-to="@( image.Index )"></li> 2241 } 2242 } 2243 } 2244 </ol> 2245 </div> 2246 </div> 2247 @using Dynamicweb.Admin.dk.dynamicweb.templates 2248 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-delivery" data-backdrop="false" data-keyboard="true"> 2249 <div class="modal-dialog"> 2250 <div class="modal-content"> 2251 <div class="modal-body"> 22522253 <button type="button" class="close" data-dismiss="modal"> 2254 <i class="material-icons">close</i> 2255 </button> 22562257 <div id="js-e-product-image-modal-carousel-delivery" class="carousel slide" data-keyboard="true" data-interval="false"> 2258 <div class="carousel-inner"> 2259 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2260 { 2261 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2262 { 2263 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2264 { 2265 if (image.Element.Index == 1 ) 2266 { 2267 isActive = "active"; 2268 } 2269 else 2270 { 2271 isActive = ""; 2272 deliveryCarouselClassList = "d-flex"; 2273 } 2274 <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)"> 2275 </div> 2276 } 2277 } 2278 } 2279 </div> 22802281 <ol class="carousel-indicators @deliveryCarouselClassList"> 2282 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2283 { 2284 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2285 { 2286 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2287 { 2288 if (image.Element.Index == 1 ) 2289 { 2290 isActive = "active"; 2291 } 2292 else 2293 { 2294 isActive = ""; 2295 deliveryCarouselClassList = "d-flex"; 2296 } 2297 <li class="@isActive" data-target="#js-e-product-image-modal-carousel-delivery" data-slide-to="@( image.Index + 1 )"> 2298 <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> 2299 </li> 2300 } 2301 } 2302 } 2303 </ol> 23042305 <a class="carousel-control-prev @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="prev"></a> 2306 <a class="carousel-control-next @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="next"></a> 23072308 </div> 2309 </div> 2310 </div> 2311 </div> 2312 </div> 23132314 </div> 2315 </div> 2316 </div> 2317 break; 2318 case "2": // Material 2319 <div class="col-12"> 2320 @{ 2321 string materialImg = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) + ".png"; 23222323 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2324 { 2325 JSON.pdfData.materials.Add( new 2326 { 2327 id = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ), 2328 label = translatedFieldLabel, 2329 text = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" ), 2330 path = string.Format( "/Files/Images/isabella/IsabellaIcons/{0}", materialImg ), 2331 imageUri = string.Empty 2332 } ); 2333 } 23342335 bool isEditor = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName") == "EditorText"; 23362337 } 23382339 @if ( string.IsNullOrEmpty(fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )) == false ) 2340 { 2341 if(isEditor){ 2342 <p class="mb-1">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</p> 2343 } 2344 else 2345 { 2346 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 2347 <div class="d-flex align-items-start mb-3"> 2348 <img src="/Files/Images/isabella/IsabellaIcons/@materialImg" style="width: 45px" class="mr-2"> 2349 <div> 2350 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2351 { 2352 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2353 } 2354 else 2355 { 2356 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2357 } 2358 </div> 2359 </div> 2360 } 236123622363 } 23642365 </div> 2366 break; 2367 case "3": // Measures 2368 if(loopCounter == 0) { 2369 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2370 { 2371 if ( imageCategories.GetString( "Category.SystemName" ) == "MeasureIllustrations" ) 2372 { 2373 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2374 { 2375 <div class="col-12"> 2376 <img src="@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )" alt="" class="col-12 p-0 mb-3"> 2377 </div> 2378 } 2379 } 2380 } 23812382 } 23832384 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc") || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc2")) 2385 { 2386 <div class="col-12 col-md-6"> 2387 <p class="font-weight-bold"> 2388 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2389 { 2390 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2391 } 2392 else 2393 { 2394 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2395 } 2396 </p> 2397 </div> 2398 } 2399 else if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2400 <div class="col-5 col-lg-3 d-flex"> 2401 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2402 </div> 2403 <div class="col-7 col-lg-9 d-flex"> 2404 <p class="mb-0 pb-0"> 2405 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2406 { 2407 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2408 } 2409 else 2410 { 2411 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2412 } 2413 </p><br /> 2414 </div> 24152416 JSON.pdfData.measures.Add( new 2417 { 2418 value = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 2419 name = translatedFieldLabel 2420 } ); 2421 } 2422 break; 2423 case "1": // Details & Features 2424 if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2425 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("VideoPresentation")) { 2426 <div class="col-12 mb-2"> 2427 <div class="col-12 px-0"> 2428 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 24292430 <div class="embed-responsive embed-responsive-16by9"> 2431 <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> 2432 <div class="cookieconsent-optout-marketing"> 2433 <div> 2434 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2435 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2436 </a> 24372438 </div> 2439 </div> 2440 </div> 2441 </div> 2442 </div> 2443 } else { 2444 <div class="col-5 col-lg-3 d-flex"> 2445 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2446 </div> 2447 <div class="col-7 col-lg-9 d-flex flex-column"> 2448 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameGuide" || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameIllustration") { 2449 <a href="@GetString( "Ecom:Product.CategoryField.AccessoriesGeneral.FrameGuide.Value" )">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</a> 2450 } else { 2451 if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2452 { 2453 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2454 } 2455 else 2456 { 2457 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2458 } 2459 } 2460 <br /> 2461 </div> 2462 } 2463 } 2464 break; 2465 case "5": // Assembly 24662467 if(loopCounter == 0) { 2468 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2469 { 2470 if ( imageCategories.GetString( "Category.SystemName" ).Contains("AssemblyIllustrations" )) 2471 { 2472 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2473 { 2474 <div class="col-12 col-lg-8"> 2475 <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"> 2476 </div> 2477 } 2478 } 2479 } 24802481 } 2482 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "AssemblyGuide" && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2483 { 2484 <div class="col-12 mb-3"> 2485 <p class="font-weight-bold mb-1">@Translate( "eCom Product - Download installation instructions - Header", "Opstillingsvejledning" )</p> 2486 <a class="text-primary" href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download> 2487 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download installation instructions - Link", "Download opstillingsvejledning" ) 2488 </a> 2489 </div> 2490 } 2491 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo1") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2492 { 2493 <div class="col-12"> 2494 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo1.Value.Clean" )</p> 2495 <div class="embed-responsive embed-responsive-16by9"> 2496 <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> 2497 <div class="cookieconsent-optout-marketing"> 2498 <div> 2499 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2500 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2501 </a> 25022503 </div> 2504 </div> 2505 </div> 2506 </div> 2507 } 2508 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo2") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2509 { 2510 <div class="col-12"> 2511 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo2.Value.Clean" )</p> 2512 <div class="embed-responsive embed-responsive-16by9"> 2513 <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> 2514 <div class="cookieconsent-optout-marketing"> 2515 <div> 2516 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2517 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2518 </a> 25192520 </div> 2521 </div> 2522 </div> 25232524 </div> 2525 } 2526 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo3") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2527 { 2528 <div class="col-12"> 2529 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 2530 <div class="embed-responsive embed-responsive-16by9"> 2531 <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> 2532 <div class="cookieconsent-optout-marketing"> 2533 <div> 2534 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2535 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2536 </a> 25372538 </div> 2539 </div> 2540 </div> 2541 </div> 2542 } 2543 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 ) 2544 { 2545 <div class="col-5 col-lg-3 d-flex"> 2546 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2547 </div> 2548 <div class="col-7 col-lg-9 d-flex flex-column"> 2549 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2550 { 2551 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2552 } 2553 else 2554 { 2555 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2556 } 2557 </div> 2558 } 2559 break; 2560 default: 2561 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2562 { 2563 <div class="col-5 col-lg-3 d-flex"> 2564 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2565 </div> 2566 <div class="col-7 col-lg-9 d-flex flex-column"> 2567 @if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True") 2568 { 2569 string text = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel"); 2570 if (text.Contains(",")) 2571 { 2572 string[] splitText = text.Split(','); 2573 text = string.Join(", ", splitText); 2574 } 2575 @text<br/> 2576 } 2577 else 2578 { 2579 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br/> 2580 } 2581 </div> 2582 } 2583 break; 2584 } 2585 } 2586 loopCounter++; 2587 } 2588 </div> 2589 </div> 2590 </div> 2591 displayGroupCount++; 2592 } 2593 } 25942595 } 2596 </div> 2597 </div> 2598 </div> 259926002601 @functions 2602 { 2603 public Field GetTranslatedCategoryFieldName(string categoryId, string fieldId) 2604 { 2605 Field result = null; 26062607 Category category = Category.GetCategoryById(categoryId, Dynamicweb.Ecommerce.Common.Context.LanguageID); 26082609 Field field = category.Fields.FirstOrDefault(f => f.Id.Equals(fieldId)); 26102611 if (field != null && string.IsNullOrEmpty(field.Label) == false) 2612 { 26132614 result = field; 2615 } 26162617 return result; 2618 } 2619 } 26202621 </div> 2622 </div> 2623 </div> 26242625 <script> 2626 dataLayer.push({ 2627 "ecommerce": { 2628 "detail": { 2629 "products": [{ 2630 "name": "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2631 "id": "@GetString("Ecom:Product.Number")", 2632 "price": "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()" 2633 }] 2634 } 2635 } 2636 }); 26372638 /*New GA4*/ 2639 dataLayer.push({ 2640 event: 'view_item', 2641 ecommerce: { 2642 items: [ 2643 { 2644 item_name: "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2645 item_id: "@GetString("Ecom:Product.Number")", 2646 price: @eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript().Replace( ",", "" ) 2647 } 2648 ] 2649 } 2650 }); 2651 </script> 26522653 @sectionEnd() 2654265526562657 @if (!disableRelatedProducts) 2658 { 2659 <div> 2660 @using Dynamicweb.SystemTools 26612662 @{ 2663 string boughtWithHeading = Translate("eCom - Recommended Products - Bought With - Heading", "Ofte købt sammen med"); 2664 string boughtWithFallbackHeading = Translate("eCom - Recommended Products - Best Sellers - Heading", "Populære produkter"); 2665 } 26662667 @if(!isOutlet && !isCamplet){ 2668 @sectionStart( sectionClasses: "e-section py-2 bg-septenary-opacity-low border-bottom js-e-recommended-products-container" ) 2669 <div class="col-12 js-e-recommended-products" data-recommendation="boughtWith" data-heading="@boughtWithHeading" data-fallback-heading="@boughtWithFallbackHeading"> 26702671 <div class="js-e-recommended-products-container"> 2672 <div class="e-loading-overlay e-products-loading-overlay js-e-products-loading-overlay is-loading"> 2673 <div class="e-loading-spinner"></div> 2674 </div> 2675 </div> 26762677 </div> 2678 @sectionEnd() 2679 } 26802681 </div> 2682 } 2683268426852686 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) ) == false ) 2687 { 2688 <section class="e-section js-e-section e-theme-secondary mb-0 p p-0 p-mosaic p-mosaic-img-right"> 2689 <div class="container-fluid px-0"> 2690 <div class="e-reveal-done no-gutters row"> 2691 <div class="align-self-center col-12 col-md-6 p-txt-container"> 2692 <h2>@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" )</h2> 2693 @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) 2694 <p> 2695 <a class="arrow-white isabella-arrow text-white" href="@GetString( modelTypeLink )"> 2696 @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" ) 2697 </a> 2698 </p> 2699 </div> 2700 <div class="col-12 col-md-6 e-section-height-md order-md-last p-img-container position-relative"> 2701 <div class="bg-center-middle bg-cover p-img pos-b-0 position-absolute pos-l-0 pos-r-0 pos-t-0" style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeImage.Value.Clean" )&Format=png&Width=1280&Height=0&Quality=75);" title=""></div> 2702 </div> 2703 </div> 2704 </div> 2705 </section> 2706 } 27072708 <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> 2709 <div class="e-loading-overlay e-pdf-loading-overlay js-e-search-loading-overlay"> 2710 <div class="e-loading-spinner"></div> 2711 </div> 2712 <script> 2713 var isabellaProductData = @JsonService.Instance.ToJson( JSON ) 2714 </script> 27152716 @using Dynamicweb.Frontend 2717 @{ 2718 string currencySeparatorDecimal = PageView.Current().Area.CultureInfo.NumberFormat.NumberDecimalSeparator; 2719 string currencySeparatorInteger = PageView.Current().Area.CultureInfo.NumberFormat.NumberGroupSeparator; 2720 string productLink = eProductService.Instance.GetProductLink( GetString("Ecom:Product.PrimaryOrFirstGroupID"), GetString("Ecom:Product.ID") ); 2721 } 27222723 <script type="application/ld+json"> 2724 { 2725 "@@context" : "http://schema.org", 2726 "@@type" : "Product", 2727 "description" : "@GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ).StripHtml()", 2728 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 2729 "name" : "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).StripHtml()", 2730 "image" : "@( HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + GetString("Ecom:Product.ImageDefault.Clean") )", 2731 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )", 2732 "sku" : "@GetString("Ecom:Product.Number")", 2733 "offers" : { 2734 "@@type" : "Offer", 2735 "availability" : @( GetInteger( "Ecom:Product.Stock" ) > 0 ? "\"http://schema.org/InStock\"" : "\"http://schema.org/OutOfStock\"" ), 2736 "price" : "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()", 2737 "priceCurrency" : "@EcomContext.Currency.Code", 2738 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )" 2739 } 2740 } 2741 </script> 27422743 </div> 27442745 @if (!isOutlet && !disableRelatedProducts) 2746 { 2747 <related-products type="RelatedProducts" product-id="@product.Id" variant-id="@product.VariantId"></related-products> 2748 } 27492750 @sectionStart() 275127522753 @using Co3.Espresso.Base.Extensions 2754 @using Co3.Espresso.Website.Models.FrontEnd 2755 @using Co3.Espresso.Website.Services 2756 @using Dynamicweb.Frontend 27572758 <script id="js-e-handlebars-tmpl-recommended-products" type="text/x-handlebars-template"> 27592760 <h4 class="isabella-text-bullets-left mb-3"> 2761 {{heading}} 2762 </h4> 2763 <div class="e-products f"> 27642765 <div class="row"> 2766 {{#each products}} 2767 {{#if pimActive}} 2768 <div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"> 2769 <div class="card border-1 mb-6"> 2770 <a href="{{url}}"> 2771 <img src="{{imageDefault}}" alt="{{name}} {{productType}}" class="col-12 p-0"> 2772 {{#if news}} 2773 <div class="isabella-product-item-news"> 2774 @Translate("Ecom Product - News Badge - Text","Nyhed") 2775 </div> 2776 {{/if}} 2777 </a> 2778 <div class="card-body p-1 p-lg-3"> 2779 <h4 class="e-products-item-name mb-0"> 2780 <a href="{{url}}"> 2781 {{{name}}} 2782 </a> 2783 </h4> 27842785 </div> 2786 </div> 2787 </div> 27882789 {{/if}} 2790 {{/each}} 2791 </div> 2792 </div> 27932794 </script> 279527962797 @SnippetStart("ProductOpenGraph") 2798 @{ 2799 string openGraphTitle = product.Meta.Title; 2800 if (string.IsNullOrEmpty(openGraphTitle)) 2801 { 2802 openGraphTitle = product.Name; 2803 } 2804 string openGraphDescription = product.Meta.Description; 2805 if (string.IsNullOrEmpty(openGraphDescription)) 2806 { 2807 openGraphDescription = product.ShortDescription; 2808 } 2809 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"; 2810 } 2811 <meta property="og:title" content="@openGraphTitle"> 2812 <meta property="og:description" content="@openGraphDescription.StripHtml()"> 2813 <meta property="og:image" content="@openGraphImage"> 2814 @SnippetEnd("ProductOpenGraph")