Error executing template "Designs/isabella/eCom/Product/espresso.cshtml" System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Co3.Isabella.Dw.DAL.Repositories.ProductRepository.GetPrices(String[] productNumbers, String dataAreaId, String currencyCode, String countryCode, String command) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\DAL\Repositories\ProductRepository.cs:line 192 at Co3.Isabella.Dw.Services.PriceService.GetPrices(String[] productNumbers, String dataAreaId, String currencyCode, String countryCode, String command) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 44 at Co3.Isabella.Dw.Services.PriceService.GetItemPrices(String productNumber, String dataAreaId, String currencyCode, String countryCode, String command) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 124 at Co3.Isabella.Dw.Services.PriceService.GetProductPrice(String productNumber, Double quantity, String dataAreaId, String currencyCode, String countryCode, String command) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 83 at Co3.Isabella.Dw.Services.PriceService.GetProductPrice(Product product, Double quantity, String dataAreaId, String currencyCode, String countryCode, String command) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\PriceService.cs:line 62 at Co3.Isabella.Dw.Providers.PriceProvider.FindPrice(Product product, Double quantity, String variantID, Currency currency, String unitID, User user) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Providers\PriceProvider.cs:line 45 at Dynamicweb.Ecommerce.Prices.PriceProvider.FindPrice(PriceContext context, PriceProductSelection selection) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPriceInternal(PriceProvider provider, PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.FindPrice(PriceContext context, PriceProductSelection selection, Boolean isInformative) at Dynamicweb.Ecommerce.Prices.PriceManager.GetPrice(PriceContext context, Product product, String unitId, Int64 stockLocationId) at Dynamicweb.Ecommerce.Products.Product.GetPrice(PriceContext context) at Co3.Isabella.Dw.Services.ProductService.GetPrice(Product product) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 435 at Co3.Isabella.Dw.Services.ProductService.GetPrice(String productId, String variantId, String languageId) in C:\Data\Development\git\isabella-master\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 475 at CompiledRazorTemplates.Dynamic.RazorEngine_161420a1b3844482bcce30807083cdca.GetPriceByRelatedProductItem(Product item, Boolean isUserAuthenticated, Boolean allowBuyIfOutOfStock, Boolean hidePrice) at CompiledRazorTemplates.Dynamic.RazorEngine_161420a1b3844482bcce30807083cdca.Execute() 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"); 441 string isProductOutlet = GetString("Ecom:Product.VariantID"); 442443 if (isOutlet && !GetBoolean("Ecom:Product:Field.IsOutlet")) 444 { 445 HttpContext.Current.Response.Redirect("/"); 446 } 447448 <script>console.log("%cTEXT", "background: rebeccapurple; color: white", @Newtonsoft.Json.JsonConvert.SerializeObject(Values));</script> 449450 } 451452 @sectionEnd() 453454 <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"> 455 @*@if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == false ) 456 { 457 <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"> 458 <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> 459 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 460 <div class="isabella-product-item-news"> 461 @Translate("Ecom Product - News Badge - Text","Nyhed") 462 </div> 463 } 464 <a class="hidden-sm-down js-p-banner-next-section-link p-banner-next-section-link" href=""> 465 <i class="material-icons p-banner-next-section-link-icon">keyboard_arrow_down</i> 466 </a> 467 </section> 468 }*@ 469470 @sectionStart( sectionClasses: "e-section py-2 isabella-camplet-dark" ) 471 <div class="col-12"> 472 <div class="row"> 473 <div class="col-12 col-md-6"> 474 @using Dynamicweb.Admin.dk.dynamicweb.templates 475 @using WebSupergoo.ImageGlue6 476 @using System.Text.RegularExpressions; 477478 @{ 479 string moodCarouselClassList = "d-none"; 480 int currentIndex = 0; 481 string productVideo = GetString( "Ecom:Product:Field.Video" ); 482 string productVideo2 = GetString( "Ecom:Product:Field.Video2" ); 483484 var YoutubeShowControls = "True"; 485 var YoutubeShowTitle = ""; 486 var YoutubeShowLogo = "False"; 487 var YoutubeShowRelated = "False"; 488489 var Url = productVideo; 490 var UrlRegex = new Regex( @"^.*((youtu.be\/|vimeo.com\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*" ); 491492 Match videoUrlMatch = UrlRegex.Match( Url ); 493 Match videoUrlMatch2 = UrlRegex.Match( productVideo2 ); 494 var EmbedUrl = String.Empty; 495 var EmbedUrl2 = String.Empty; 496497 if( videoUrlMatch.Success && videoUrlMatch.Groups.Count >= 8 ) { 498 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" ); 499 } 500 if( videoUrlMatch2.Success && videoUrlMatch2.Groups.Count >= 8 ) { 501 EmbedUrl2 = string.Format( "https://www.youtube.com/embed/{0}?rel=0&controls={1}&showinfo={2}&modestbranding={3}&rel={4}", videoUrlMatch2.Groups[ 7 ].Value, YoutubeShowControls == "True" ? "1" : "0", YoutubeShowTitle == "True" ? "1" : "0", YoutubeShowLogo == "True" ? "0" : "1", YoutubeShowRelated == "True" ? "1" : "0" ); 502 } 503504 var videoUrlID = videoUrlMatch.Groups[ 7 ].Value; 505 var videoUrlID2 = videoUrlMatch2.Groups[ 7 ].Value; 506 } 507508 @if ( GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value" ) == true ) 509 { 510 <div class="e-product-image-container position-relative isabella-product-image-container-mood"> 511 @if(GetBoolean( "Ecom:Product.CategoryField.ProductsGeneral.News.Value" ) == true ) { 512 <div class="isabella-product-item-news zi-sticky"> 513 @Translate("Ecom Product - News Badge - Text","Nyhed") 514 </div> 515 } 516 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 517 <div class="e-product-image-wrapper"> 518 <div class="carousel-inner"> 519 <div class="active carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 520 <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"> 521 </div> 522523 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 524 { 525 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 526 { 527 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 528 { 529 if ( image.Index != null ) 530 { 531 moodCarouselClassList = "d-flex"; 532 } 533 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 534 <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)"> 535 </div> 536 } 537 } 538 } 539 @if ( !string.IsNullOrEmpty( productVideo ) ) 540 { 541 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 542 <div class="embed-responsive embed-responsive-16by9"> 543 <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> 544 </div> 545 </div> 546 } 547 @if ( !string.IsNullOrEmpty( productVideo2 ) ) 548 { 549 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 550 <div class="embed-responsive embed-responsive-16by9"> 551 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@EmbedUrl2" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 552 </div> 553 </div> 554 } 555556557 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 558 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 559560 </div> 561 </div> 562563 @* 564 <ol class="carousel-indicators @moodCarouselClassList"> 565 <li data-target="#js-e-product-image-carousel" class="active" data-slide-to="0"></li> 566 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 567 { 568 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 569 { 570 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 571 { 572 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 573 } 574 } 575 } 576 </ol> 577 *@ 578579 @{ 580 currentIndex = 0; 581 } 582583 @* 584 <ol class="carousel-indicators @moodCarouselClassList"> 585 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 586 <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> 587 </li> 588 @foreach ( LoopItem imageCategories in GetLoop("ImageCategories") ) 589 { 590 if ( imageCategories.GetString("Category.SystemName") == "MoodImages" ) 591 { 592 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop("Category.Images").WithIndex() ) 593 { 594 <li data-target="#js-e-product-image-carousel" data-slide-to="@(image.Index + 1)"></li> 595 int imageIndex = image.Index + 1; 596 currentIndex = imageIndex; 597 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 598 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 599 <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> 600 </li> 601 } 602 } 603 } 604 </ol> 605 *@ 606607 <ol class="carousel-indicators @moodCarouselClassList"> 608 <li class="active" data-target="#js-e-product-image-carousel" data-slide-to="0"> 609 <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> 610 </li> 611612 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 613 { 614 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 615 { 616 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 617 { 618 int imageIndex = image.Index + 1; 619 currentIndex = imageIndex; 620 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 621 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 622 <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> 623 </li> 624 } 625 } 626 } 627 @if ( !string.IsNullOrEmpty( productVideo ) ) 628 { 629 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 630 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 631 </li> 632 } 633 @if ( !string.IsNullOrEmpty( productVideo2 ) ) 634 { 635 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 2 )"> 636 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID2/maxresdefault.webp)"></span> 637 </li> 638 } 639640 </ol> 641642643644 </div> 645 </div> 646 } 647 else 648 { 649650 <div class="e-product-image-container isabella-product-image-container-mood"> 651 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel"> 652 <div class="e-product-image-wrapper"> 653 <div class="carousel-inner"> 654655 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 656 { 657 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 658 { 659 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 660 { 661 if ( image.Element.Index == 1 ) 662 { 663 isActive = "active"; 664 } 665 else 666 { 667 isActive = ""; 668 } 669 if ( image.Index != 0 ) 670 { 671 moodCarouselClassList = "d-flex"; 672 } 673 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 674 <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 )"> 675 </div> 676 } 677 } 678 } 679 @if ( !string.IsNullOrEmpty( productVideo ) ) { 680 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 681 <div class="embed-responsive embed-responsive-16by9"> 682 <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> 683 </div> 684 </div> 685 } 686 @if ( !string.IsNullOrEmpty( productVideo2 ) ) { 687 <div class="carousel-item" data-target="#js-e-product-image-modal-mood" data-toggle="modal"> 688 <div class="embed-responsive embed-responsive-16by9"> 689 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@EmbedUrl2" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 690 </div> 691 </div> 692 } 693694 <a class="carousel-control-prev @moodCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel"></a> 695 <a class="carousel-control-next @moodCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel"></a> 696697 </div> 698 </div> 699700 @{ 701 currentIndex = 0; 702 } 703704 <ol class="carousel-indicators @moodCarouselClassList"> 705706707 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 708 { 709 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 710 { 711 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 712 { 713 int imageIndex = image.Index; 714 currentIndex = imageIndex; 715 string cssClassActive = imageIndex == 0 ? "active" : string.Empty; 716 <li class="@cssClassActive" data-target="#js-e-product-image-carousel" data-slide-to="@imageIndex"> 717 <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> 718 </li> 719 } 720 } 721 } 722 @if ( !string.IsNullOrEmpty( productVideo ) ) 723 { 724 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 1 )"> 725 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID/maxresdefault.webp)"></span> 726 </li> 727 } 728 @if ( !string.IsNullOrEmpty( productVideo2 ) ) 729 { 730 <li class="isabella-video-thumb" data-target="#js-e-product-image-carousel" data-slide-to="@( currentIndex + 2 )"> 731 <span style="background-image: url(https://img.youtube.com/vi_webp/@videoUrlID2/maxresdefault.webp)"></span> 732 </li> 733 } 734735 </ol> 736737738739740741 </div> 742 </div> 743 } 744745746 @using Dynamicweb.Admin.dk.dynamicweb.templates 747 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-mood" data-backdrop="false" data-keyboard="true"> 748 <div class="modal-dialog"> 749 <div class="modal-content"> 750 <div class="modal-body"> 751752 <button type="button" class="close" data-dismiss="modal"> 753 <i class="material-icons">close</i> 754 </button> 755756 <div id="js-e-product-image-modal-carousel-mood" class="carousel slide" data-keyboard="true" data-interval="false"> 757 <div class="carousel-inner"> 758759 <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)"> 760 </div> 761 @foreach (LoopItem imageCategories in GetLoop("ImageCategories")) 762 { 763 if (imageCategories.GetString("Category.SystemName") == "MoodImages") 764 { 765 foreach (ElementWithIndex<LoopItem> image in imageCategories.GetLoop("Category.Images").WithIndex()) 766 { 767 if (image.Element.Index == 1) 768 { 769 isActive = "active"; 770 } 771 else 772 { 773 isActive = ""; 774 } 775 <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)"> 776 </div> 777 } 778 } 779 } 780 </div> 781782 <ol class="carousel-indicators @moodCarouselClassList"> 783 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="0"> 784 <span style="background-image:url(/admin/public/getimage.ashx?Crop=0&Image=@productImage&Format=jpg&Width=50&Height=&Quality=75)"></span> 785 </li> 786 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 787 { 788 if ( imageCategories.GetString( "Category.SystemName" ) == "MoodImages" ) 789 { 790 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 791 { 792 if (image.Element.Index == 1 ) 793 { 794 isActive = "active"; 795 } 796 else 797 { 798 isActive = ""; 799 } 800 <li class="" data-target="#js-e-product-image-modal-carousel-mood" data-slide-to="@( image.Index + 1 )"> 801 <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> 802 </li> 803 } 804 } 805 } 806 </ol> 807808 <a class="carousel-control-prev @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="prev"></a> 809 <a class="carousel-control-next @moodCarouselClassList" data-target="#js-e-product-image-modal-carousel-mood" data-slide="next"></a> 810811 </div> 812 </div> 813 </div> 814 </div> 815 </div> 816817 </div> 818 <div class="col-12 col-md-6"> 819 <div class="e-product-text-container"> 820 <h1 class="e-product-name"> 821 @eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 822823 </h1> 824 <div class="e-product-text mb-3"> 825 @GetString("Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value") 826 </div> 827828829 @if (string.IsNullOrEmpty(GetString("Ecom:Product.CategoryField.ModelType.ModelTypeName.Value")) == false) 830 { 831 <p class="mb-4"> 832 <a class="arrow-primary isabella-arrow" href="@GetString(modelTypeLink)"> 833 @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") 834 </a> 835 </p> 836 } 837 </div> 838 </div> 839 </div> 840 </div> 841 @sectionEnd() 842843 @sectionStart( sectionClasses: "e-section pb-2 isabella-camplet-dark" ) 844 <div class="col-12"> 845 <div class="row"> 846 <div class="col-12 col-md-6 mb-3 mb-md-0 order-md-2"> 847 @using System.Runtime.Remoting.Contexts 848 @using System.Text.RegularExpressions 849 @using Co3.Espresso.Base.Extensions 850 @using Co3.Espresso.Website.Services 851 @using Dynamicweb.Ecommerce.Extensibility.Provider 852 @using Dynamicweb.Ecommerce.Products 853 @using Dynamicweb.Frontend 854 @using Co3.Isabella.Data.DAL.Models 855 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 856 @using Dynamicweb.Content.Items 857 @using Dynamicweb.Ecommerce.International 858 @using Dynamicweb.Ecommerce.Orders 859 @using Dynamicweb.Security.UserManagement 860 @using Newtonsoft.Json 861 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 862863 @{ 864 double colli = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 865 double value = GetDouble("Ecom:Product:Field.Multiplum.Value.Raw"); 866867 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 868 IsabellaStock stockObject = isabellaProduct.Stock; 869 StockStatus mainStockStatus = stockObject.Status; 870 double stock = stockObject.Stock; 871 bool allowBuyIfOutOfStock = false; 872 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 873874 bool canBuyIfOutOfStock = true; 875 double totalStockMainAndRelated = 0; 876877 bool pimActive = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.PIMActive.Value"); 878 bool lockColliB2c = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2C.Value"); 879 bool lockColliB2b = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.LockColliB2B.Value"); 880 bool hidePriceFieldValue = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.HidePrice.Value"); 881 bool userCanBuy = false; 882 bool lockColli = false; 883884 bool isIsabellaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsabellaProduct.Value"); 885 bool isCampletProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.CampletProduct.Value"); 886 bool isVillaProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.VillaProduct.Value"); 887 bool isAccessorieProduct = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.IsAccessory.Value"); 888889 bool isNoBuyB2C = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value"); 890 bool isNoBuyB2B = GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value"); 891892 string userDealerType = string.Empty; 893894 bool isDiscontinued = pimActive == false; 895 bool hasRelatedProducts = false; 896897 totalStockMainAndRelated += stock; 898899 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 900901 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && shopType == "Hybrid"; 902 bool isNoBuyWithPricesShop = noBuyB2BandB2C && shopType == "NoBuy"; 903904 bool hidePrice = Co3.Isabella.Dw.Services.ProductService.Instance.HidePrice(product); 905906907 if (isUserAuthenticated == false) 908 { 909 if (mainStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) 910 { 911 canBuyIfOutOfStock = false; 912 } 913 userCanBuy = true; 914 } 915 else 916 { 917 Item item = null; 918 if ( !string.IsNullOrEmpty(PageView.Current().User.ItemType)) 919 { 920 item = Dynamicweb.Services.Items.GetItem(PageView.Current().User.ItemType, PageView.Current().User.ItemId); 921 } 922923924 if (item != null && item.ContainsKey("Type") && item["Type"] != null) 925 { 926 userDealerType = item["Type"].ToString(); 927 } 928 if (string.IsNullOrEmpty(userDealerType)) 929 { 930 userDealerType = string.Empty; 931 } 932933934 if (isIsabellaProduct && userDealerType.Contains("Isabella") == true) 935 { 936 userCanBuy = true; 937 } 938 else if (isCampletProduct && userDealerType.Contains("Camplet") == true) 939 { 940 userCanBuy = true; 941 } 942 else if (isVillaProduct && userDealerType.Contains("Villa") == true) 943 { 944 userCanBuy = true; 945 } 946 } 947948 if (isUserAuthenticated == false && lockColliB2c == true) 949 { 950 lockColli = true; 951 } 952 else if (isUserAuthenticated == true && lockColliB2b == true) 953 { 954 lockColli = true; 955 } 956957 if (colli == 0) 958 { 959 colli = 0; 960 value = 1; 961 } 962 Dictionary<string, RelatedProductInfo> temp = Co3.Isabella.Dw.Services.ProductService.Instance.GetRelatedProducts(product); 963964 string howItWorksPage = Espresso.Page.Area.Item["Product_Page_HowItWorks"]?.ToString().ToLower().Replace("default.aspx?id=", ""); 965 object findDealerLink = Espresso.Page.Area.Item["FindDealer"]?.ToString(); 966967 if (isHybridShop || isNoBuyWithPricesShop) 968 { 969 userCanBuy = false; 970 canBuyIfOutOfStock = false; 971 } 972973 } 974975 <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"> 976 <input name="CartCmd" type="hidden" value="addMulti"> 977 <input name="Redirect" type="hidden" value=""> 978 <input name="Name" type="hidden" value="@eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"))"> 979 <input name="Number" type="hidden" value="@GetString("Ecom:Product.Number")"> 980 @if (hidePrice == false) 981 { 982 <input name="Price" type="hidden" value="@Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price.ToJavaScript()"> 983 } 984985 <input name="OrderContext" type="hidden" value="@OrderContext"> 986 <input name="ProductCurrencyCode" type="hidden" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 987 <h3 class="mb-1 mt-1">@Translate("eCom Product - Add To Cart Form Table - Choose product - Heading", "Vælg Produkt")</h3> 988 @if (pimActive == false) 989 { 990 <div class="alert alert-danger"> 991 <p class="m-0"> 992 @Translate("eCom Product - Add To Cart Form Table - Model Discontinued - Text", "Denne model er udgået, nedenfor kan du købe tilbehør") 993 </p> 994 </div> 995 } 996997 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 998 { 999 <div class="alert alert-danger @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 1000 <p class="m-0"> 1001 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1002 { 1003 @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") 1004 } 1005 else 1006 { 1007 @Translate("eCom Product - Add To Cart Form Table - Model Out of Stock - Text", "Denne model er udsolgt, nedenfor kan du købe tilbehør") 1008 } 1009 </p> 1010 </div> 1011 } 10121013 <div class="table-container" role="table"> 10141015 <div class="flex-table header" role="rowgroup"> 1016 <div class="first flex-row w-40" role="columnheader"></div> 1017 @if (noBuyB2BandB2C == false) 1018 { 1019 <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> 1020 <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> 1021 } 1022 @if ((isHybridShop == true && hidePrice == false) || isNoBuyWithPricesShop) 1023 { 1024 <div class="flex-row w-40" role="columnheader"> 1025 @Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris") 1026 </div> 1027 } 1028 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 1029 </div> 1030 <div class="flex-table js-isabella-product-form-row" role="rowgroup"> 1031 <div class="align-self-center first flex-row w-40" role="cell"> 1032 @eProductService.Instance.GetName(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1033 <br/> 1034 <span class="text-muted">@GetString("Ecom:Product.Number")</span> 1035 </div> 1036 @if (noBuyB2BandB2C == false) 1037 { 1038 <div class="align-self-center center flex-row w-10" role="cell"> 1039 @if (isDiscontinued == false && noBuyB2BandB2C == false) 1040 { 1041 @GetProductStockByStatus(product, allowBuyIfOutOfStock) 1042 } 1043 </div> 1044 } 1045 @if (noBuyB2BandB2C == false) 1046 { 1047 <div class="align-self-center center flex-row w-30" role="cell"> 1048 @if (isDiscontinued == false) 1049 { 1050 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1051 <div class="d-flex flex-column"> 1052 @if (!noBuyB2BandB2C && !hidePrice) 1053 { 1054 <div @(priceCheck <= 0 ? "hidden" : string.Empty)> 1055 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1056 </div> 1057 } 1058 @if (noBuyB2BandB2C) 1059 { 1060 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1061 } 1062 else if (mainStockStatus == StockStatus.InStockAtRemote) 1063 { 1064 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1065 } 1066 else if (canBuyIfOutOfStock == false && allowBuyIfOutOfStock == false) 1067 { 1068 <p class="m-0 text-danger">@Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt")</p> 1069 } 1070 </div> 1071 } 10721073 </div> 1074 } 1075 else if (isHybridShop || isNoBuyWithPricesShop) 1076 { 1077 double priceCheck = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")).Price; 1078 if (!hidePrice || isNoBuyWithPricesShop) 1079 { 1080 <div class="align-self-center center flex-row w-40" role="cell"> 1081 <div class="d-flex flex-column small"> 1082 <span> 1083 @if (priceCheck > 0) 1084 { 1085 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1086 } 1087 else 1088 { 1089 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Missing Price - Text", "Pris mangler")</p> 1090 } 1091 </span> 10921093 </div> 1094 </div> 1095 } 1096 } 1097 <div class="align-self-center flex-row w-20 ml-auto" role="cell"> 1098 @if (isDiscontinued == false && canBuyIfOutOfStock == true) 1099 { 1100 <input name="ProductID0" type="hidden" value="@GetString("Ecom:Product.ID")"> 1101 <input id="ProductLoopCounter0" name="ProductLoopCounter0" type="hidden" value="0"> 1102 <input name="VariantID0" type="hidden" value=""> 1103 if (noBuyB2BandB2C || isHybridShop || isNoBuyWithPricesShop) 1104 { 1105 @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")) 1106 } 1107 else 1108 { 1109 if (lockColli) 1110 { 1111 <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" oninput="onInputRequiredAddOn(event)"> 1112 } 1113 else 1114 { 1115 <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" oninput="onInputRequiredAddOn(event)"> 1116 } 11171118 <script> 1119 function onInputRequiredAddOn(objEvent){ 1120 const children = document.querySelectorAll('.js-required-add-on-child-quantity'); 1121 if(children.length > 0){ 1122 children.forEach((item) =>{ 1123 item.value = objEvent.target.value; 1124 }) 1125 } 1126 } 1127 </script> 1128 } 1129 } 1130 else 1131 { 1132 <p class="m-0 text-danger"> 1133 @if (canBuyIfOutOfStock == false && isDiscontinued == false) 1134 { 1135 @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")) 1136 } 1137 else if (isDiscontinued == true) 1138 { 1139 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1140 } 11411142 </p> 1143 } 1144 </div> 1145 </div> 1146 </div> 11471148 @if (temp != null) 1149 { 1150 int relatedCounter = 1; 1151 <div class="accordion" id="relatedProductsCollapse"> 11521153 @foreach (string key in temp.Keys) 1154 { 1155 if (string.IsNullOrEmpty(key) == false) 1156 { 1157 bool doValidateFrame = !isHybridShop || key == "Frames" || key == "AccessoriesWithFrames"; 11581159 bool keyHasVisibleProducts = false; 11601161 if (temp[key].RelatedProducts != null) 1162 { 1163 foreach (var rp in temp[key].RelatedProducts) 1164 { 1165 if (rp.Products == null) 1166 { 1167 continue; 1168 } 11691170 foreach (var p in rp.Products) 1171 { 1172 bool isRequiredAddOn = p.GetProductFieldValue<bool>("IsRequiredAddOn"); 1173 if (!isRequiredAddOn && p.ShowInProductList) 1174 { 1175 keyHasVisibleProducts = true; 1176 break; 1177 } 1178 } 11791180 if (keyHasVisibleProducts) 1181 { 1182 break; 1183 } 1184 } 1185 } 11861187 <div class="border-top isabella-product-form-heading py-1 @(!keyHasVisibleProducts ? "d-none" : string.Empty)" id="isabella-product-form-heading-@key" data-key="@key"> 1188 <h4 class="mb-0"> 1189 <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"> 11901191 @{ 1192 object header = temp[key].Name; 11931194 if (header != null) 1195 { 1196 @header.ToString() 1197 } 1198 } 11991200 <i class="order-last p-accordion-toggle-icon-img"> </i> 12011202 </a> 1203 </h4> 1204 </div> 120512061207 <div id="isabella-product-form-collapse-@key" class="js-related-collapse collapse @((key == "Frames") ? "show" : string.Empty) @(!keyHasVisibleProducts ? "d-none" : 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"> 1208 <div class="px-1 table-container" role="table"> 1209 <div class="flex-table header" role="rowgroup"> 1210 <div class="first flex-row w-40 " role="columnheader"></div> 1211 @if (noBuyB2BandB2C == false) 1212 { 1213 <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> 1214 <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> 1215 } 1216 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1217 { 1218 <div class="flex-row w-40" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Recommended Retail Price Text", "Vejl. Pris")</div> 1219 } 1220 <div class="flex-row w-20 ml-auto" role="columnheader">@Translate("eCom Product - Add To Cart Form Table - Quantity Text", "Antal")</div> 1221 </div> 12221223 @{ 1224 bool showAcceptRow = true; 1225 } 12261227 @if (temp[key] != null) 1228 { 1229 List<string> usedProductIds = new List<string>(); 1230 foreach (RelatedProduct relatedProduct in temp[key].RelatedProducts) 1231 { 1232 double totalPackagePrice = 0; 1233 double totalPackageColli = 0; 1234 bool totalIsInStock = true; 1235 string relatedPackageName = string.Empty; 1236 string fallbackProductName = string.Empty; 1237 string productItemDescription = string.Empty; 1238 string stockStatus = string.Empty; 1239 bool isPimActive = true; 1240 bool canBuyRelatedIfOutOfStock = true; 1241 StockStatus _tempStockStatus = new StockStatus(); 1242 bool isGroup = string.IsNullOrEmpty(relatedProduct.Name) == false; 1243 bool relatedStockStatusForGroupAtRemote = false; 1244 hasRelatedProducts = relatedProduct.Products.Any(); 124512461247 Dictionary<string, dynamic> packs = new Dictionary<string, dynamic>(); 12481249 if (isGroup == true) 1250 { 1251 var visibleProducts = relatedProduct.Products.Where(p => p.ShowInProductList).ToList(); 1252 if (!visibleProducts.Any()) 1253 { 1254 continue; 1255 } 1256 <div class="flex-table js-isabella-product-form-row" role="rowgroup" data-group="true"> 1257 <div class="align-self-center first flex-row w-40" role="cell"> 12581259 @foreach (Product item in visibleProducts) 1260 { 12611262 if (!item.ShowInProductList) 1263 { 1264 continue; 1265 } 1266 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1267 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1268 string parentLineInputName = string.Format("EcomOrderLineFieldInput_ParentLine{0}", relatedCounter); 1269 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1270 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 1271 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1272 fallbackProductName = item.Name; 12731274 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1275 bool isRequiredAddOn = item.GetProductFieldValue<bool>("IsRequiredAddOn"); 1276 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1277 StockStatus relatedStockStatus = relatedStockObject.Status; 1278 double relatedStock = relatedStockObject.Stock; 12791280 if (relatedStockStatus == StockStatus.OutOfStock) 1281 { 1282 _tempStockStatus = relatedStockStatus; 1283 } 12841285 if (usedProductIds.Contains(item.Id)) 1286 { 1287 continue; 1288 } 12891290 usedProductIds.Add(item.Id); 129112921293 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 129412951296 if (isHybridShop || (isUserAuthenticated == false && relatedStockStatus == StockStatus.OutOfStock && allowBuyIfOutOfStock == false) || isNoBuyWithPricesShop) 1297 { 1298 canBuyRelatedIfOutOfStock = false; 1299 showAcceptRow = false; 1300 _tempStockStatus = relatedStockStatus; 1301 } 1302 if (_tempStockStatus != StockStatus.OutOfStock) 1303 { 1304 stockStatus = GetProductStockByStatus(item, allowBuyIfOutOfStock); 1305 } 13061307 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1308 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 13091310 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1311 totalStockMainAndRelated += relatedStock; 1312 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1313 { 1314 totalIsInStock = false; 1315 } 13161317 if (isRequiredAddOn) 1318 { 1319 showAcceptRow = false; 1320 } 132113221323 totalPackagePrice += itemPrice; 13241325 if (isPimActive == true && canBuyRelatedIfOutOfStock == true) 1326 { 1327 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1328 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1329 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1330 <input class="@(isRequiredAddOn ? "js-required-add-on-child-quantity" : "js-isabella-related-product-child-quantity-input")" 1331 name="@quantiInputName" 1332 type="hidden" 1333 value="@(isRequiredAddOn ? 1 : 0)"> 13341335 <input name="@parentLineInputName" type="hidden" value="@GetString("Ecom:Product.ID")"> 1336 } 1337 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1338 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 1339 relatedCounter++; 13401341 packs[relatedPackageName] = new 1342 { 1343 isPimActive = isPimActive, 1344 canBuyRelatedIfOutOfStock = canBuyRelatedIfOutOfStock, 1345 noBuyB2BandB2C = noBuyB2BandB2C, 1346 isHybridShop = isHybridShop, 1347 relatedStockStatus = relatedStockStatus, 1348 totalIsInStock = totalIsInStock, 1349 noBuyB2C = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C"), 1350 noBuyB2B = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B") 1351 }; 1352 } 1353 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1354 { 1355 @relatedPackageName 1356 } 1357 else 1358 { 1359 @fallbackProductName 1360 } 13611362 @{ 1363 dynamic pack = new { }; 1364 } 13651366 @if (packs.ContainsKey(relatedPackageName)) 1367 { 1368 pack = packs[relatedPackageName]; 1369 } 1370137113721373 @if (!string.IsNullOrEmpty(productItemDescription)) 1374 { 1375 <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> 1376 } 13771378 </div> 13791380 @if (noBuyB2BandB2C == false) 1381 { 1382 <div class="align-self-center center flex-row w-10" role="cell"> 1383 @if (!noBuyB2BandB2C) 1384 { 1385 @stockStatus 1386 } 1387 </div> 1388 } 13891390 @if (noBuyB2BandB2C == false) 1391 { 1392 <div class="align-self-center center flex-row w-30 " role="cell"> 1393 <div class="d-flex flex-column"> 1394 @if (!noBuyB2BandB2C && !hidePrice) 1395 { 1396 <div> 1397 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1398 </div> 1399 } 1400 @if (noBuyB2BandB2C) 1401 { 1402 <p class="m-0 text-danger">@Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online")</p> 1403 } 1404 else if (relatedStockStatusForGroupAtRemote) 1405 { 1406 <p class="m-0 text-muted">@Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager")</p> 1407 } 1408 </div> 1409 </div> 1410 } 1411 @if ((isHybridShop && !hidePrice) || isNoBuyWithPricesShop) 1412 { 1413 <div class="align-self-center center flex-row w-40 " role="cell"> 1414 <div class="d-flex flex-column"> 1415 <div class="small"> 1416 @eProductService.Instance.GetPriceFormatted(totalPackagePrice) 1417 </div> 1418 </div> 1419 </div> 1420 } 1421 <div class="align-self-center center flex-row w-20 ml-auto" role="cell"> 14221423 @if (isPimActive == true && (canBuyRelatedIfOutOfStock || pack.relatedStockStatus != StockStatus.OutOfStock) == true && (noBuyB2BandB2C == false || isUserAuthenticated == false && pack.noBuyB2C == false || isUserAuthenticated == true && pack.noBuyB2B == false)) 1424 { 1425 if (isHybridShop || isNoBuyWithPricesShop) 1426 { 1427 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1428 } 1429 else 1430 { 1431 <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"> 1432 } 1433 } 1434 else 1435 { 1436 <p class="m-0 text-danger align-self-center"> 1437 @if (canBuyRelatedIfOutOfStock == false) 1438 { 1439 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv")) 1440 } 1441 else if (isPimActive == false) 1442 { 1443 @Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået") 1444 } 1445 else 1446 { 1447 @GetPdfOnlyQuantityInput(totalPackagePrice, key, Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")) 1448 } 1449 </p> 1450 } 145114521453 </div> 14541455 </div> 14561457 } 1458 else 1459 { 1460 var visibleProducts = relatedProduct.Products.Where(p => p.ShowInProductList).ToList(); 14611462 foreach (Product item in visibleProducts) 1463 { 1464 if (!item.ShowInProductList) 1465 { 1466 continue; 1467 } 1468 string productIdInputName = string.Format("ProductID{0}", relatedCounter); 1469 string variantIdInputName = string.Format("VariantID{0}", relatedCounter); 1470 string quantiInputName = string.Format("Quantity{0}", relatedCounter); 1471 string parentLineInputName = string.Format("EcomOrderLineFieldInput_ParentLine{0}", relatedCounter); 1472 string loopCountInputName = string.Format("ProductLoopCounter{0}", relatedCounter); 14731474 IsabellaProduct relatedIsabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1475 //bool isRequiredAddOn = relatedIsabellaProduct.IsRequiredAddOn; 1476 bool isRequiredAddOn = item.GetProductFieldValue<bool>("IsRequiredAddOn"); 1477 IsabellaStock relatedStockObject = relatedIsabellaProduct.Stock; 1478 StockStatus relatedStockStatus = relatedStockObject.Status; 1479 double relatedStock = relatedStockObject.Stock; 14801481 fallbackProductName = item.Name; 1482 relatedPackageName = item.GetCategoryValue("RelatedProducts", "RelatedPackageName") != null ? item.GetCategoryValue("RelatedProducts", "RelatedPackageName").ToString() : string.Empty; 1483 productItemDescription = item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText") != null ? item.GetCategoryValue("AccessoriesGeneral", "AccessoriesPopUpText").ToString() : string.Empty; 1484 totalStockMainAndRelated += relatedStock; 1485 totalStockMainAndRelated += item.Stock; 1486 if (totalIsInStock == true && relatedStockStatus == StockStatus.OutOfStock) 1487 { 1488 totalIsInStock = false; 1489 } 14901491 <div class="flex-table js-isabella-product-form-row @(isRequiredAddOn ? "d-none" : string.Empty)" 1492 role="rowgroup"> 1493 <div class="align-self-center first flex-row w-40" role="cell"> 1494 @if (isPimActive == true) 1495 { 1496 <input id="@loopCountInputName" type="hidden" value="@relatedCounter" name="@loopCountInputName"> 1497 <input name="@productIdInputName" type="hidden" value="@item.Id"> 1498 <input name="@variantIdInputName" type="hidden" value="@item.VariantId"> 1499 <input name="@parentLineInputName" type="hidden" value="@GetString("Ecom:Product.ID")"> 1500 <input class="@(isRequiredAddOn ? "js-required-add-on-child-quantity" : "js-isabella-related-product-child-quantity-input")" name="@quantiInputName" type="hidden" value="@(isRequiredAddOn ? 1 : 0)"> 1501 } 1502 <input class="js-related-product-id" type="hidden" value="@key@relatedCounter"> 1503 <input class="js-related-product-name" type="hidden" value="@(string.IsNullOrEmpty(relatedPackageName) == false ? relatedPackageName : fallbackProductName)"> 15041505 @if (string.IsNullOrEmpty(relatedPackageName) == false) 1506 { 1507 @relatedPackageName 1508 } 1509 else 1510 { 1511 @fallbackProductName 1512 } 1513 @if (key != "Frames" && key != "AccessoriesWithFrames") 1514 { 1515 <br/> 1516 <span class="text-muted">@item.Number</span> 1517 } 1518151915201521 @if (!string.IsNullOrEmpty(productItemDescription)) 1522 { 1523 <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> 1524 } 1525 </div> 15261527 @if (noBuyB2BandB2C == false) 1528 { 1529 <div class="align-self-center center flex-row w-10 " role="cell"> 1530 @GetProductStockByStatus(item, allowBuyIfOutOfStock) 1531 </div> 1532 } 1533 @if (noBuyB2BandB2C == false) 1534 { 1535 <div class="align-self-center center flex-row w-30" role="cell"> 1536 <div class="d-flex flex-column"> 1537 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1538 </div> 1539 </div> 1540 } 1541 @if (isHybridShop) 1542 { 1543 <div class="align-self-center center flex-row w-40" role="cell"> 1544 <div class="d-flex flex-column"> 1545 @GetPriceByRelatedProductItem(item, isUserAuthenticated, allowBuyIfOutOfStock, hidePrice) 1546 </div> 1547 </div> 1548 } 1549 @if (isNoBuyWithPricesShop) 1550 { 1551 <div class="align-self-center center flex-row w-40" role="cell"> 1552 <div class="d-flex flex-column"> 1553 @GetPriceByRelatedProductItem(item, false, false, false) 1554 </div> 1555 </div> 1556 } 1557 <div class="flex-row align-self-center w-20 ml-auto" role="cell"> 1558 @GetQuantityInputByRelatedProductItem(item, isUserAuthenticated, key, lockColli) 1559 </div> 1560 </div> 1561 relatedCounter++; 15621563 if (isRequiredAddOn) 1564 { 1565 showAcceptRow = false; 1566 } 1567 } 1568 } 15691570 } 157115721573 } 1574 @if ((key == "Frames" || key == "AccessoriesWithFrames") && showAcceptRow) 1575 { 1576 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()"> 1577 <div class="form-group js-isabella-accept-no-frame-row" style="display: @(key == "AccessoriesWithFrames" ? "none" : "block")"> 1578 <div class="form-check"> 1579 <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"> 1580 <label class="form-check-label pl-1 d-inline" for="acceptNoFrame-@key"> 1581 @Translate("eCom Product - Add To Cart Form Table - Confirm No Frame - Text", "Jeg bekræfter hermed, at jeg ikke ønsker et stel") 1582 </label> 1583 </div> 1584 </div> 1585 </div> 1586 } 1587 </div> 15881589 </div> 1590 } 1591 } 1592 </div> 1593 } 15941595 <div class="border-top mt-0 table-container" role="table"> 1596 @if(!hidePrice){ 1597 <div class="flex-table mt-1 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 1598 <div class="align-self-center first flex-row h4 w-50" role="cell"> 1599 @Translate("eCom Product - Add To Cart Form Table - Total Price Text", "I alt") 1600 </div> 1601 <div class="flex-row h3 text-right w-50" role="cell"> 1602 <div class="js-isabella-calculated-price"> 1603 @if (isDiscontinued == false) 1604 { 1605 if (isUserAuthenticated == true) 1606 { 1607 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true) 1608 { 1609 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1610 } 1611 else 1612 { 1613 @eProductService.Instance.GetPriceFormatted(0) 1614 } 1615 } 1616 else 1617 { 1618 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true) 1619 { 1620 if (mainStockStatus == StockStatus.OutOfStock) 1621 { 1622 @eProductService.Instance.GetPriceFormatted(0) 1623 } 1624 else 1625 { 1626 @Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID")) 1627 } 1628 } 1629 else 1630 { 1631 @eProductService.Instance.GetPriceFormatted(0) 1632 } 1633 } 1634 } 1635 else 1636 { 1637 @eProductService.Instance.GetPriceFormatted(0) 1638 } 16391640 </div> 1641 </div> 1642 </div> 1643 } 1644 @{ 1645 bool isNoBuy = userCanBuy == false 1646 || (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") == true && isUserAuthenticated == false) 1647 || (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") == true && isUserAuthenticated == true); 1648 } 1649 <div class="flex-table @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" role="rowgroup"> 16501651 @if (!isNoBuy) 1652 { 1653 if (!isOutlet) 1654 { 1655 <div class="align-self-center first flex-row w-50" role="cell"> 1656 @if (!string.IsNullOrEmpty(howItWorksPage)) 1657 { 1658 <a class="text-underline" data-target="#howItWorksModal" data-toggle="modal"> 1659 @if (isUserAuthenticated == false) 1660 { 1661 @Translate("eCom Product - How It works Modal - Button Text", "Sådan fungerer det") 1662 } 1663 else 1664 { 1665 @Translate("eCom Product - How It works Modal B2B - Button Text", "Sådan fungerer det") 1666 } 1667 </a> 1668 } 1669 </div> 1670 } 1671 else 1672 { 1673 <div class="align-self-center first flex-row w-50" role="cell"></div> 1674 } 1675 } 167616771678 @if (!hidePrice) 1679 { 16801681 string divClasses = "flex-row" + (isNoBuy ? " text-left w-100" : " text-right w-50"); 16821683 <div class="@divClasses" role="cell"> 16841685 @if (noBuyB2BandB2C == false && userCanBuy == true) 1686 { 1687 if (GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1688 { 1689 if (totalStockMainAndRelated == 0) 1690 { 1691 <p class="m-0 "></p> 1692 } 1693 else 1694 { 1695 if ((isDiscontinued == true && hasRelatedProducts == false) || shopType == "B2C") 1696 { 1697 <p class="m-0 "></p> 1698 } 1699 else 1700 { 1701 if (!isOutlet) 1702 { 1703 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Klik og hent - Button", "Klik og hent")</button> 1704 } 1705 else 1706 { 1707 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Order - Button", "Order now")</button> 1708 } 17091710 } 1711 } 1712 } 17131714 if ((GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2B.Value") != true && isUserAuthenticated == true) || shopType == "B2C" && GetBoolean("Ecom:Product.CategoryField.ProductsGeneral.NoBuyB2C.Value") != true && isUserAuthenticated == false) 1715 { 1716 <button class="btn btn-block btn-success" type="submit">@Translate("eCom Product - Add To Cart - Button", "Add to cart")</button> 1717 } 1718 } 1719 @if (isNoBuy) 1720 { 1721 <h4 class="mb-0 text-primary">@Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online")</h4> 1722 } 17231724 </div> 1725 } 1726 </div> 1727 @if (!isOutlet) 1728 { 1729 <div class="flex-table" role="rowgroup"> 1730 @if (!isNoBuy) 1731 { 1732 <div class="align-self-center first flex-row w-50 pr-1" role="cell"> 1733 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1734 { 1735 @Translate("Product page - Not On Stock Info B2B - Text", "B2B relevant text") 1736 } 1737 else 1738 { 1739 @Translate("Product page - Not On Stock Info - Start Text", "Er varen ikke på lager kontakt Isabellas salgsafdeling på") 1740 <span class="text-primary">@Translate("Product page - Contact Phone - Number", "76497292")</span> 1741 @Translate("Product page - Not On Stock Info - End Textr", "eller send en mail") 1742 } 1743 </div> 1744 } 1745 else 1746 { 1747 <div class="align-self-center first flex-row w-50 pr-1" role="cell"></div> 1748 } 17491750 <div class="flex-row text-right w-50" role="cell"> 1751 @if (!string.IsNullOrEmpty(PageView.Current().Area.Domain)) 1752 { 1753 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer B2B - Link", "Find forhandler")</a> 1754 } 1755 else 1756 { 1757 <a href="@findDealerLink" class="btn btn-block btn-secondary">@Translate("Product Page - Find Dealer - Link", "Find forhandler")</a> 1758 } 1759 </div> 1760 <div class="mt-2 p-0 col-12"> 1761 @if ( isUserAuthenticated == true ) 1762 { 1763 <div class="col-12"> 1764 <div class="row"> 1765 <div class="col-6"> 1766 @using Dynamicweb.Frontend 1767 <div class="dropdown"> 1768 <a class="dropdown-toggle" data-toggle="dropdown"> 1769 <i class="material-icons material-icons-large">playlist_add</i> @Translate( "eCom Product - Add to favorites - Link", "Add to favorites" ) 1770 </a> 1771 <div class="dropdown-menu pt-0"> 1772 <h4 class="dropdown-header">@Translate( "eCom Product - Add to favorite list - Heading", "Add to ..." )</h4> 1773 <form action="" class="js-e-product-cc-list-form mt-1"> 1774 @foreach ( LoopItem listType in GetLoop( "CustomerCenter.ListTypes" ) ) 1775 { 1776 foreach ( LoopItem list in listType.GetLoop( "CustomerCenter.ProductLists" ) ) 1777 { 1778 <div class="dropdown-item"> 1779 <label class="custom-checkbox custom-control m-0"> 1780 <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" )"> 1781 <span class="custom-control-indicator"></span> 1782 <span class="custom-control-description">@list.GetString( "Ecom:CustomerCenter.List.Name" )</span> 1783 </label> 1784 </div> 1785 } 1786 } 1787 </form> 1788 <div class="dropdown-divider"></div> 1789 <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> 1790 </div> 1791 </div> 179217931794 </div> 1795 <div class="col-6"> 1796 <p> 1797 <a class="text-dark" href="@signBuilderUrl"> 1798 <i class="e-nav-pageicon material-icons">image</i> @Translate( "eCom Product - SignBuilder - Text", "Opret prisskilt (pdf)" )</a> 1799 </p> 1800 </div> 1801 </div> 1802 </div> 1803 } 1804 <div class="col-12"> 1805 <p> 1806 <a class="js-isabella-product-details-pdf-generate text-primary" href="#"> 1807 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download PDF - Text", "Hent produkt-PDF" )</a> 1808 </p> 1809 </div> 18101811 </div> 1812 </div> 1813 } 18141815 </div> 1816 </form> 18171818 <!-- Modal --> 1819 <div aria-hidden="true" aria-labelledby="howItWorksModalLabel" class="fade modal" id="howItWorksModal" role="dialog" tabindex="-1"> 1820 <div class="modal-dialog" role="document"> 1821 <div class="modal-content"> 1822 <div class="modal-body"> 1823 @if (!string.IsNullOrEmpty(howItWorksPage)) 1824 { 1825 @RenderPageContent(int.Parse(howItWorksPage)) 1826 } 1827 </div> 1828 </div> 1829 </div> 1830 </div> 183118321833 @functions 1834 { 183518361837 public string GetPriceByRelatedProductItem(Product item, bool isUserAuthenticated, bool allowBuyIfOutOfStock, bool hidePrice) 1838 { 1839 string returnValue = string.Empty; 1840 bool isPimActive = false; 1841 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 18421843 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1844 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 18451846 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1847 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1848 string textNoBuy = Translate("eCom Product - No Buy Online - Text - Short", "Ingen salg online"); 1849 string textNotInStock = Translate("eCom Product - Add To Cart Form Table - Sold Out - Text", "Udsolgt"); 1850 string textAtRemote = Translate("eCom Product - Add To Cart Form Table - At Remote - Text", "På fjernlager"); 18511852 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1853 IsabellaStock stockObject = isabellaProduct.Stock; 1854 StockStatus stockStatus = stockObject.Status; 185518561857 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1858 { 1859 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1860 } 18611862 if (isPimActive) 1863 { 1864 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 18651866 if (hidePrice) 1867 { 1868 return ""; 1869 } 18701871 if (noBuyB2BandB2C) 1872 { 1873 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1874 } 1875 else 1876 { 1877 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1878 if (allowBuyIfOutOfStock == true) 1879 { 1880 return returnValue; 1881 } 18821883 if ((isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1884 { 1885 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNoBuy); 1886 } 1887 else if (stockStatus == StockStatus.OutOfStock) 1888 { 1889 returnValue += string.Format("<p class=\"m-0 text-danger\">{0}</p>", textNotInStock); 1890 } 1891 else if (stockStatus == StockStatus.InStockAtRemote) 1892 { 1893 returnValue += string.Format("<p class=\"m-0 text-muted\">{0}</p>", textAtRemote); 1894 } 1895 } 1896 if (isHybridShop || isNoBuyWithPricesShop) 1897 { 1898 returnValue = string.Format("<div>{0}</div>", Co3.Espresso.Website.Services.ProductService.Instance.GetPriceFormatted(itemPrice)); 1899 } 1900 } 1901 return returnValue; 1902 } 19031904 public string GetQuantityInputByRelatedProductItem(Product item, bool isUserAuthenticated, string itemKey, bool lockColli) 1905 { 1906 string returnValue = string.Empty; 1907 bool isPimActive = false; 1908 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1909 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1910 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 19111912 if (item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 1913 { 1914 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 1915 } 19161917 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(item); 1918 IsabellaStock stockObject = isabellaProduct.Stock; 1919 StockStatus stockStatus = stockObject.Status; 19201921 bool allowBuyIfOutOfStock = false; 1922 bool.TryParse(PageView.Current().Area.Item["AllowBuyOutofstock"]?.ToString(), out allowBuyIfOutOfStock); 19231924 double itemPrice = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice(item.Id, item.VariantId).Price; 1925 string noBuyB2CRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2C")?.ToString(); 1926 string noBuyB2BRelated = item.GetCategoryValue("ProductsGeneral", "NoBuyB2B")?.ToString(); 1927 string textNoBuy = Translate("eCom Product - No Buy Online - Text", "Denne varer kan ikke købes online"); 1928 string textNotInStockInput = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1929 if (isPimActive && stockStatus != StockStatus.OutOfStock || allowBuyIfOutOfStock == true) 1930 { 1931 if (noBuyB2BandB2C || (isUserAuthenticated == false && noBuyB2CRelated == "True") || (isUserAuthenticated == true && noBuyB2BRelated == "True")) 1932 { 1933 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1934 } 1935 else 1936 { 1937 bool isRequiredAddOn = item.GetProductFieldValue<bool>("IsRequiredAddOn"); 1938 string isRequiredAddOnClass = isRequiredAddOn ? "js-required-add-on-child-quantity" : string.Empty; 1939 if (lockColli) 1940 { 1941 isRequiredAddOnClass += " js-isabella-colli-quanitity"; 1942 } 1943 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}\">", isRequiredAddOnClass, itemPrice, itemKey); 1944 } 1945 } 1946 else 1947 { 1948 if (isPimActive == false) 1949 { 1950 returnValue = string.Format("<p class=\"m-0 text-danger\">{0}</p>", Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået")); 1951 } 1952 else 1953 { 1954 if (noBuyB2BandB2C || isUserAuthenticated == false) 1955 { 1956 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, noBuyB2BandB2C ? textNoBuy : textNotInStockInput); 1957 } 1958 else 1959 { 1960 if (noBuyB2BandB2C || noBuyB2BRelated == "True") 1961 { 1962 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1963 } 1964 else 1965 { 1966 bool isRequiredAddOn = item.GetProductFieldValue<bool>("IsRequiredAddOn"); 1967 string isRequiredAddOnClass = isRequiredAddOn ? "js-required-add-on-child-quantity" : string.Empty; 1968 if (lockColli) 1969 { 1970 isRequiredAddOnClass += " js-isabella-colli-quanitity"; 1971 } 1972 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}\">", isRequiredAddOnClass, itemPrice, itemKey); 1973 } 1974 } 1975 } 1976 } 1977 if (isHybridShop || isNoBuyWithPricesShop) 1978 { 1979 returnValue = GetPdfOnlyQuantityInput(itemPrice, itemKey, textNoBuy); 1980 } 1981 return returnValue; 1982 } 19831984 public string GetPdfOnlyQuantityInput(double itemPrice, string itemKey, string popoverText) 1985 { 1986 bool isUserAuthenticated = PageView.Current().User != null; 1987 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 1988 bool isHybridShop = noBuyB2BandB2C && isUserAuthenticated && PageView.Current().Area.Item["ShopType"]?.ToString() == "Hybrid"; 1989 bool isNoBuyWithPricesShop = noBuyB2BandB2C && PageView.Current().Area.Item["ShopType"]?.ToString() == "NoBuy"; 1990 if (isHybridShop) 1991 { 1992 popoverText = Translate("eCom Product - Add To Cart Form Table - Sold Out - Input - Text", "Udsolgt - kan ikke lægges i kurv"); 1993 } 1994 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); 1995 } 19961997 public bool ShouldShowStock(Product item) 1998 { 1999 bool returnValue = false; 20002001 bool isPimActive = false; 20022003 if (item != null && item.GetCategoryValue("ProductsGeneral", "PIMActive") != null) 2004 { 2005 isPimActive = (bool)item.GetCategoryValue("ProductsGeneral", "PIMActive"); 2006 } 20072008 returnValue = isPimActive; 20092010 return returnValue; 2011 } 20122013 public string GetProductStockByStatus(Product product, bool allowBuyIfOutOfStock) 2014 { 2015 string returnValue = string.Empty; 20162017 bool noBuyB2BandB2C = PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"] != null && (bool)PageView.Current().Area.Item["EcommerceNoBuyB2CB2B"]; 201820192020 if (product != null) 2021 { 2022 IsabellaProduct isabellaProduct = Co3.Isabella.Dw.Services.ProductService.Instance.GetIsabellaProduct(product); 2023 IsabellaStock stockObject = isabellaProduct.Stock; 2024 StockStatus stockStatus = stockObject.Status; 20252026 if (ShouldShowStock(product) == false || allowBuyIfOutOfStock == true) 2027 { 2028 return returnValue; 2029 } 20302031 switch (stockStatus.ToString()) 2032 { 2033 case "InStock": 2034 returnValue = "<span class=\"text-success\">●</span>"; 2035 break; 2036 case "InStockAtRemote": 2037 returnValue = "<span class=\"text-warning\">●</span>"; 2038 break; 2039 case "OutOfStock": 2040 returnValue = "<span class=\"text-danger\">●</span>"; 2041 break; 2042 } 2043 } 2044 else 2045 { 2046 returnValue = "<span class=\"text-danger\">●</span>"; 2047 } 20482049 if (noBuyB2BandB2C) 2050 { 2051 returnValue = ""; 2052 } 20532054 return returnValue; 2055 } 2056 } 2057 </div> 2058 <div class="col-12 col-md-6 order-md-1"> 2059 @using Co3.Espresso.Base.Extensions 2060 @using Co3.Espresso.Website.Services 2061 @using Dynamicweb.Admin.dk.dynamicweb.templates 2062 @using Dynamicweb.Ecommerce.Products 2063 @using Dynamicweb.Ecommerce.Products.Categories 2064 @using Dynamicweb.Ecommerce.Products.FieldDisplayGroups 2065 @using Dynamicweb.Frontend 2066 @using ProductService = Co3.Isabella.Dw.Services.ProductService 20672068 @{ 2069 //Hard coded group ID's from Model Display Groups // 2070 List< string > modelDisplayGroupIds = new List< string >(); 2071 modelDisplayGroupIds.Add("7"); 2072 List< LoopItem > modelDisplayGroupList = new List< LoopItem >(); 2073 } 20742075 <div class="col-12 p p-accordion p-0"> 2076 <div class="p-accordion-container "> 2077 <div class="border-bottom e-reveal-done mb-0 p-accordion-item"> 20782079 @{ 2080 int displayGroupCount = 0; 2081 } 20822083 @foreach (LoopItem groupItem in GetLoop("FieldDisplayGroups")) 2084 { 20852086 string displayGroupId = groupItem.GetString("Ecom:FieldDisplayGroup.ID"); 20872088 if (modelDisplayGroupIds.Contains(groupItem.GetString("Ecom:FieldDisplayGroup.ID"))) 2089 { 2090 modelDisplayGroupList.Add(groupItem); 2091 } 2092 else 2093 { 2094 List<LoopItem> fieldItems = new List<LoopItem>(); 2095 bool hasValues = false; 20962097 foreach (LoopItem fieldItem in groupItem.GetLoop("Fields")) 2098 { 2099 fieldItems.Add(fieldItem); 2100 if (!string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value"))) 2101 { 2102 hasValues = true; 2103 } 2104 } 21052106 if (hasValues == true) 2107 { 2108 <div class="p-accordion-toggle"> 2109 <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"> 2110 <span class="font-weight-bold line-height-sm my-0 p-accordion-toggle-text text-auto">@groupItem.GetString("Ecom:FieldDisplayGroup.Name")</span> 2111 <i class="order-last p-accordion-toggle-icon-img"> </i> 2112 </p> 2113 </div> 2114 <div class="collapse @(displayGroupCount == 0 ? "show" : string.Empty)" id="accordion-id-@displayGroupId"> 2115 <div class="pb-2"> 2116 <div class="row"> 2117 @{ 2118 int loopCounter = 0; 2119 } 212021212122 @foreach (LoopItem fieldItem in fieldItems) 2123 { 2124 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("Color")) 2125 { 2126 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2127 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2128 string fieldImage = string.Empty; 21292130 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2131 { 2132 if (fieldValue.Length == fieldLabel.Length) 2133 { 2134 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 21352136 JSON.pdfData.colors.Add(new 2137 { 2138 fieldLabel = fieldValue[sharedArrayIndex], 2139 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2140 imageUri = string.Empty 2141 }); 2142 } 2143 } 2144 } 21452146 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMatch")) 2147 { 2148 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2149 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2150 string fieldImage = string.Empty; 21512152 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2153 { 2154 if (fieldValue.Length == fieldLabel.Length) 2155 { 2156 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 21572158 JSON.pdfData.frameMatch.Add(new 2159 { 2160 fieldLabel = fieldValue[sharedArrayIndex], 2161 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2162 imageUri = string.Empty 2163 }); 2164 } 2165 } 2166 } 21672168 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("MiscFrameMaterial")) 2169 { 2170 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2171 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2172 string fieldImage = string.Empty; 21732174 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2175 { 2176 if (fieldValue.Length == fieldLabel.Length) 2177 { 2178 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 21792180 JSON.pdfData.miscFrameMaterial.Add(new 2181 { 2182 fieldLabel = fieldValue[sharedArrayIndex], 2183 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2184 imageUri = string.Empty 2185 }); 2186 } 2187 } 2188 } 21892190 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Contains("FrameMaterial")) 2191 { 2192 string[] fieldValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2193 string[] fieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2194 string fieldImage = string.Empty; 21952196 for (int sharedArrayIndex = 0; sharedArrayIndex < fieldValue.Length; sharedArrayIndex++) 2197 { 2198 if (fieldValue.Length == fieldLabel.Length) 2199 { 2200 fieldImage = fieldValue[sharedArrayIndex] + ".png"; 22012202 JSON.pdfData.frameMaterial.Add(new 2203 { 2204 fieldLabel = fieldValue[sharedArrayIndex], 2205 path = string.Format("/Files/Images/isabella/IsabellaIcons/{0}", fieldImage), 2206 imageUri = string.Empty 2207 }); 2208 } 2209 } 2210 } 22112212 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")) 2213 { 2214 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2215 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2216 if (categoryFieldIds.Length == 3) 2217 { 2218 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2219 translatedFieldLabel = translatedField.Label; 2220 } 2221 <div class="col-12"> 2222 @{ 2223 string[] colorValue = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Split(','); 2224 string[] colorLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel").Split(','); 2225 string colorImagePng = string.Empty; 2226 } 2227222822292230 @if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2231 { 22322233 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 22342235 <div class="row"> 2236 @for (int sharedArrayIndex = 0; sharedArrayIndex < colorValue.Length; sharedArrayIndex++) 2237 { 2238 if (colorValue.Length == colorLabel.Length) 2239 { 2240 colorImagePng = colorValue[sharedArrayIndex] + ".png"; 2241 <div class="col-4 mb-2"> 2242 <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"> 2243 <div> 2244 @colorLabel[sharedArrayIndex] 2245 </div> 2246 </div> 2247 } 2248 } 2249 </div> 2250 } 22512252 </div> 2253 } 2254 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name").Contains("VideoPresentation") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value") != "") 2255 { 2256 <div class="col-12 mb-2"> 2257 <div class="col-12 px-0 mt-1"> 2258 <div class="embed-responsive embed-responsive-16by9"> 2259 <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> 2260 <div class="cookieconsent-optout-marketing"> 2261 <div> 2262 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2263 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2264 </a> 22652266 </div> 2267 </div> 2268 </div> 2269 </div> 2270 </div> 2271 } 2272 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".jpg")) 2273 { 2274 <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)"/> 2275 } 2276 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Filemanager") && fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Contains(".pdf")) 2277 { 2278 <div class="col-5 col-lg-3 d-flex"> 2279 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2280 </div> 2281 <div class="col-7 col-lg-9 d-flex flex-column"> 2282 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value").Replace("../", "/Files/")"> 2283 @Translate("eCom Product = Download PDF - Link", "Download pdf here") 2284 </a> 2285 </div> 2286 } 2287 else if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName").Contains("Link")) 2288 { 2289 <div class="col-5 col-lg-3 d-flex"> 2290 <p class="font-weight-bold mb-0 pb-0">@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name")</p> 2291 </div> 2292 <div class="col-7 col-lg-9 d-flex flex-column"> 2293 <a href="@fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")"> 2294 @Translate("eCom Product - View more - Text", "View more") 2295 </a> 2296 </div> 2297 } 2298 else 2299 { 2300 string translatedFieldLabel = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Name"); 2301 string[] categoryFieldIds = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Id").Split('|'); 2302 if (categoryFieldIds.Length == 3) 2303 { 2304 Field translatedField = GetTranslatedCategoryFieldName(categoryFieldIds[1], categoryFieldIds[2]); 2305 translatedFieldLabel = translatedField.Label; 2306 } 23072308 switch (groupItem.GetString("Ecom:FieldDisplayGroup.ID")) 2309 { 2310 case "11": // Delivery Width 2311 <div class="col-12"> 2312 <div class="row"> 2313 <div class="col-12 col-md-6"> 2314 <p> 2315 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2316 { 2317 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2318 } 2319 else 2320 { 2321 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2322 } 2323 </p> 2324 </div> 2325 <div class="col-12 col-md-6"> 2326 @using Dynamicweb.Admin.dk.dynamicweb.templates 23272328 @{ 2329 string deliveryCarouselClassList = "d-none"; 2330 } 23312332 <div class="e-product-image-container"> 2333 <div class="carousel slide" data-interval="false" data-ride="carousel" id="js-e-product-image-carousel-delivery"> 2334 <div class="e-product-image-wrapper"> 2335 <div class="carousel-inner"> 2336 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2337 { 2338 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2339 { 2340 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2341 { 2342 if (image.Element.Index == 1 ) 2343 { 2344 isActive = "active"; 2345 } 2346 else 2347 { 2348 isActive = ""; 2349 } 2350 if (image.Index != 0 ) 2351 { 2352 deliveryCarouselClassList = "d-flex"; 2353 } 2354 <div class="carousel-item @isActive" data-target="#js-e-product-image-modal-delivery" data-toggle="modal"> 2355 <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 )"> 2356 </div> 2357 } 2358 } 2359 } 23602361 <a class="carousel-control-prev @deliveryCarouselClassList" data-slide="prev" data-target="#js-e-product-image-carousel-delivery"></a> 2362 <a class="carousel-control-next @deliveryCarouselClassList" data-slide="next" data-target="#js-e-product-image-carousel-delivery"></a> 23632364 </div> 2365 </div> 2366 <ol class="carousel-indicators @deliveryCarouselClassList"> 2367 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2368 { 2369 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2370 { 2371 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2372 { 2373 if (image.Element.Index == 1 ) 2374 { 2375 isActive = "active"; 2376 } 2377 else 2378 { 2379 isActive = ""; 2380 } 2381 <li class="@isActive" data-target="#js-e-product-image-carousel-delivery" data-slide-to="@( image.Index )"></li> 2382 } 2383 } 2384 } 2385 </ol> 2386 </div> 2387 </div> 2388 @using Dynamicweb.Admin.dk.dynamicweb.templates 2389 <div class="modal modal-fullscreen fade e-product-image-modal" id="js-e-product-image-modal-delivery" data-backdrop="false" data-keyboard="true"> 2390 <div class="modal-dialog"> 2391 <div class="modal-content"> 2392 <div class="modal-body"> 23932394 <button type="button" class="close" data-dismiss="modal"> 2395 <i class="material-icons">close</i> 2396 </button> 23972398 <div id="js-e-product-image-modal-carousel-delivery" class="carousel slide" data-keyboard="true" data-interval="false"> 2399 <div class="carousel-inner"> 2400 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2401 { 2402 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2403 { 2404 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2405 { 2406 if (image.Element.Index == 1 ) 2407 { 2408 isActive = "active"; 2409 } 2410 else 2411 { 2412 isActive = ""; 2413 deliveryCarouselClassList = "d-flex"; 2414 } 2415 <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)"> 2416 </div> 2417 } 2418 } 2419 } 2420 </div> 24212422 <ol class="carousel-indicators @deliveryCarouselClassList"> 2423 @foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2424 { 2425 if ( imageCategories.GetString( "Category.SystemName" ) == "DeliveryWithGallery" ) 2426 { 2427 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2428 { 2429 if (image.Element.Index == 1 ) 2430 { 2431 isActive = "active"; 2432 } 2433 else 2434 { 2435 isActive = ""; 2436 deliveryCarouselClassList = "d-flex"; 2437 } 2438 <li class="@isActive" data-target="#js-e-product-image-modal-carousel-delivery" data-slide-to="@( image.Index + 1 )"> 2439 <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> 2440 </li> 2441 } 2442 } 2443 } 2444 </ol> 24452446 <a class="carousel-control-prev @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="prev"></a> 2447 <a class="carousel-control-next @deliveryCarouselClassList" data-target="#js-e-product-image-modal-carousel-delivery" data-slide="next"></a> 24482449 </div> 2450 </div> 2451 </div> 2452 </div> 2453 </div> 24542455 </div> 2456 </div> 2457 </div> 2458 break; 2459 case "2": // Material 2460 <div class="col-12"> 2461 @{ 2462 string materialImg = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) + ".png"; 24632464 if ( string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2465 { 2466 JSON.pdfData.materials.Add( new 2467 { 2468 id = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ), 2469 label = translatedFieldLabel, 2470 text = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.OptionLabel" ), 2471 path = string.Format( "/Files/Images/isabella/IsabellaIcons/{0}", materialImg ), 2472 imageUri = string.Empty 2473 } ); 2474 } 24752476 bool isEditor = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.TypeName") == "EditorText"; 24772478 } 24792480 @if ( string.IsNullOrEmpty(fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )) == false ) 2481 { 2482 if(isEditor){ 2483 <p class="mb-1">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</p> 2484 } 2485 else 2486 { 2487 <p class="font-weight-bold mb-1">@translatedFieldLabel</p> 2488 <div class="d-flex align-items-start mb-3"> 2489 <img src="/Files/Images/isabella/IsabellaIcons/@materialImg" style="width: 45px" class="mr-2"> 2490 <div> 2491 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2492 { 2493 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2494 } 2495 else 2496 { 2497 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2498 } 2499 </div> 2500 </div> 2501 } 250225032504 } 25052506 </div> 2507 break; 2508 case "3": // Measures 2509 if(loopCounter == 0) { 2510 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2511 { 2512 if ( imageCategories.GetString( "Category.SystemName" ) == "MeasureIllustrations" ) 2513 { 2514 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2515 { 2516 <div class="col-12"> 2517 <img src="@image.Element.GetString( "Ecom:Product:Detail.Image.Clean" )" alt="" class="col-12 p-0 mb-3"> 2518 </div> 2519 } 2520 } 2521 } 25222523 } 25242525 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc") || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("MeasureDesc2")) 2526 { 2527 <div class="col-12 col-md-6"> 2528 <p class="font-weight-bold"> 2529 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2530 { 2531 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2532 } 2533 else 2534 { 2535 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2536 } 2537 </p> 2538 </div> 2539 } 2540 else if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2541 <div class="col-5 col-lg-3 d-flex"> 2542 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2543 </div> 2544 <div class="col-7 col-lg-9 d-flex"> 2545 <p class="mb-0 pb-0"> 2546 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2547 { 2548 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2549 } 2550 else 2551 { 2552 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2553 } 2554 </p><br /> 2555 </div> 25562557 JSON.pdfData.measures.Add( new 2558 { 2559 value = fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ), 2560 name = translatedFieldLabel 2561 } ); 2562 } 2563 break; 2564 case "1": // Details & Features 2565 if (string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false) { 2566 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("VideoPresentation")) { 2567 <div class="col-12 mb-2"> 2568 <div class="col-12 px-0"> 2569 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 25702571 <div class="embed-responsive embed-responsive-16by9"> 2572 <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> 2573 <div class="cookieconsent-optout-marketing"> 2574 <div> 2575 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2576 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2577 </a> 25782579 </div> 2580 </div> 2581 </div> 2582 </div> 2583 </div> 2584 } else { 2585 <div class="col-5 col-lg-3 d-flex"> 2586 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2587 </div> 2588 <div class="col-7 col-lg-9 d-flex flex-column"> 2589 @if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameGuide" || fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "FrameIllustration") { 2590 <a href="@GetString( "Ecom:Product.CategoryField.AccessoriesGeneral.FrameGuide.Value" )">@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )</a> 2591 } else { 2592 if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2593 { 2594 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2595 } 2596 else 2597 { 2598 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2599 } 2600 } 2601 <br /> 2602 </div> 2603 } 2604 } 2605 break; 2606 case "5": // Assembly 26072608 if(loopCounter == 0) { 2609 foreach ( LoopItem imageCategories in GetLoop( "ImageCategories" ) ) 2610 { 2611 if ( imageCategories.GetString( "Category.SystemName" ).Contains("AssemblyIllustrations" )) 2612 { 2613 foreach ( ElementWithIndex< LoopItem > image in imageCategories.GetLoop( "Category.Images" ).WithIndex() ) 2614 { 2615 <div class="col-12 col-lg-8"> 2616 <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"> 2617 </div> 2618 } 2619 } 2620 } 26212622 } 2623 if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ) == "AssemblyGuide" && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2624 { 2625 <div class="col-12 mb-3"> 2626 <p class="font-weight-bold mb-1">@Translate( "eCom Product - Download installation instructions - Header", "Opstillingsvejledning" )</p> 2627 <a class="text-primary" href="@fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" )" download> 2628 <i class="material-icons material-icons-large">vertical_align_bottom</i> @Translate( "eCom Product - Download installation instructions - Link", "Download opstillingsvejledning" ) 2629 </a> 2630 </div> 2631 } 2632 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo1") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2633 { 2634 <div class="col-12"> 2635 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo1.Value.Clean" )</p> 2636 <div class="embed-responsive embed-responsive-16by9"> 2637 <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> 2638 <div class="cookieconsent-optout-marketing"> 2639 <div> 2640 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2641 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2642 </a> 26432644 </div> 2645 </div> 2646 </div> 2647 </div> 2648 } 2649 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo2") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2650 { 2651 <div class="col-12"> 2652 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo2.Value.Clean" )</p> 2653 <div class="embed-responsive embed-responsive-16by9"> 2654 <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> 2655 <div class="cookieconsent-optout-marketing"> 2656 <div> 2657 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2658 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2659 </a> 26602661 </div> 2662 </div> 2663 </div> 26642665 </div> 2666 } 2667 else if ( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Id" ).Contains("AssemblyVideo3") && string.IsNullOrEmpty( fieldItem.GetString( "Ecom:FieldDisplayGroup.Field.Value" ) ) == false ) 2668 { 2669 <div class="col-12"> 2670 <p class="font-weight-bold">@GetString( "Ecom:Product.CategoryField.TentCamVillaGeneral.AssemblyLabelVideo3.Value.Clean" )</p> 2671 <div class="embed-responsive embed-responsive-16by9"> 2672 <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> 2673 <div class="cookieconsent-optout-marketing"> 2674 <div> 2675 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 2676 @Translate("CookieBot - Video - accept marketing-cookies", "Venligst acceptere marketing-cookies for at se denne video") 2677 </a> 26782679 </div> 2680 </div> 2681 </div> 2682 </div> 2683 } 2684 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 ) 2685 { 2686 <div class="col-5 col-lg-3 d-flex"> 2687 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2688 </div> 2689 <div class="col-7 col-lg-9 d-flex flex-column"> 2690 @if ( fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True" ) 2691 { 2692 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel")<br /> 2693 } 2694 else 2695 { 2696 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br /> 2697 } 2698 </div> 2699 } 2700 break; 2701 default: 2702 if (string.IsNullOrEmpty(fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")) == false) 2703 { 2704 <div class="col-5 col-lg-3 d-flex"> 2705 <p class="font-weight-bold mb-0 pb-0">@translatedFieldLabel</p> 2706 </div> 2707 <div class="col-7 col-lg-9 d-flex flex-column"> 2708 @if (fieldItem.GetString("Ecom:FieldDisplayGroup.Field.IsList") == "True") 2709 { 2710 string text = fieldItem.GetString("Ecom:FieldDisplayGroup.Field.OptionLabel"); 2711 if (text.Contains(",")) 2712 { 2713 string[] splitText = text.Split(','); 2714 text = string.Join(", ", splitText); 2715 } 2716 @text<br/> 2717 } 2718 else 2719 { 2720 @fieldItem.GetString("Ecom:FieldDisplayGroup.Field.Value")<br/> 2721 } 2722 </div> 2723 } 2724 break; 2725 } 2726 } 2727 loopCounter++; 2728 } 2729 </div> 2730 </div> 2731 </div> 2732 displayGroupCount++; 2733 } 2734 } 27352736 } 2737 </div> 2738 </div> 2739 </div> 274027412742 @functions 2743 { 2744 public Field GetTranslatedCategoryFieldName(string categoryId, string fieldId) 2745 { 2746 Field result = null; 27472748 Category category = Category.GetCategoryById(categoryId, Dynamicweb.Ecommerce.Common.Context.LanguageID); 27492750 Field field = category.Fields.FirstOrDefault(f => f.Id.Equals(fieldId)); 27512752 if (field != null && string.IsNullOrEmpty(field.Label) == false) 2753 { 27542755 result = field; 2756 } 27572758 return result; 2759 } 2760 } 27612762 </div> 2763 </div> 2764 </div> 27652766 <script> 2767 dataLayer.push({ 2768 "ecommerce": { 2769 "detail": { 2770 "products": [{ 2771 "name": "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2772 "id": "@GetString("Ecom:Product.Number")", 2773 "price": "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()" 2774 }] 2775 } 2776 } 2777 }); 27782779 /*New GA4*/ 2780 dataLayer.push({ 2781 event: 'view_item', 2782 ecommerce: { 2783 items: [ 2784 { 2785 item_name: "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) )", 2786 item_id: "@GetString("Ecom:Product.Number")", 2787 price: @eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript().Replace( ",", "" ) 2788 } 2789 ] 2790 } 2791 }); 2792 </script> 27932794 @sectionEnd() 279527962797 @* 2798 @if (!disableRelatedProducts) 2799 { 2800 <div> 2801 @using Dynamicweb.SystemTools 28022803 @{ 2804 string boughtWithHeading = Translate("eCom - Recommended Products - Bought With - Heading", "Ofte købt sammen med"); 2805 string boughtWithFallbackHeading = Translate("eCom - Recommended Products - Best Sellers - Heading", "Populære produkter"); 2806 } 28072808 @if(!isOutlet && !isCamplet){ 2809 @sectionStart( sectionClasses: "e-section py-2 bg-septenary-opacity-low border-bottom js-e-recommended-products-container" ) 2810 <div class="col-12 js-e-recommended-products" data-recommendation="boughtWith" data-heading="@boughtWithHeading" data-fallback-heading="@boughtWithFallbackHeading"> 28112812 <div class="js-e-recommended-products-container"> 2813 <div class="e-loading-overlay e-products-loading-overlay js-e-products-loading-overlay is-loading"> 2814 <div class="e-loading-spinner"></div> 2815 </div> 2816 </div> 28172818 </div> 2819 @sectionEnd() 2820 } 28212822 </div> 2823 } 2824 *@ 28252826282728282829 @if ( string.IsNullOrEmpty( GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) ) == false ) 2830 { 2831 <section class="e-section js-e-section e-theme-secondary mb-0 p p-0 p-mosaic p-mosaic-img-right"> 2832 <div class="container-fluid px-0"> 2833 <div class="e-reveal-done no-gutters row"> 2834 <div class="align-self-center col-12 col-md-6 p-txt-container"> 2835 <h2>@GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeName.OptionLabel" )</h2> 2836 @GetString( "Ecom:Product.CategoryField.ModelType.ModelTypeDesc.Value.Clean" ) 2837 <p> 2838 <a class="arrow-white isabella-arrow text-white" href="@GetString( modelTypeLink )"> 2839 @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" ) 2840 </a> 2841 </p> 2842 </div> 2843 <div class="col-12 col-md-6 e-section-height-md order-md-last p-img-container position-relative"> 2844 <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> 2845 </div> 2846 </div> 2847 </div> 2848 </section> 2849 } 28502851 <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> 2852 <div class="e-loading-overlay e-pdf-loading-overlay js-e-search-loading-overlay"> 2853 <div class="e-loading-spinner"></div> 2854 </div> 2855 <script> 2856 var isabellaProductData = @JsonService.Instance.ToJson( JSON ) 2857 </script> 28582859 @using Dynamicweb.Frontend 2860 @{ 2861 string currencySeparatorDecimal = PageView.Current().Area.CultureInfo.NumberFormat.NumberDecimalSeparator; 2862 string currencySeparatorInteger = PageView.Current().Area.CultureInfo.NumberFormat.NumberGroupSeparator; 2863 string productLink = eProductService.Instance.GetProductLink( GetString("Ecom:Product.PrimaryOrFirstGroupID"), GetString("Ecom:Product.ID") ); 2864 } 28652866 <script type="application/ld+json"> 2867 { 2868 "@@context" : "http://schema.org", 2869 "@@type" : "Product", 2870 "description" : "@GetString( "Ecom:Product.CategoryField.ProductsGeneral.ProductIntroText.Value" ).StripHtml()", 2871 "mpn" : "@GetString("Ecom:Product.Number").StripHtml()", 2872 "name" : "@eProductService.Instance.GetName( GetString( "Ecom:Product.ID" ), GetString( "Ecom:Product.VariantID" ) ).StripHtml()", 2873 "image" : "@( HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + GetString("Ecom:Product.ImageDefault.Clean") )", 2874 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )", 2875 "sku" : "@GetString("Ecom:Product.Number")", 2876 "offers" : { 2877 "@@type" : "Offer", 2878 "availability" : @( GetInteger( "Ecom:Product.Stock" ) > 0 ? "\"http://schema.org/InStock\"" : "\"http://schema.org/OutOfStock\"" ), 2879 "price" : "@eProductService.Instance.GetPrice( GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID") ).Price.ToJavaScript()", 2880 "priceCurrency" : "@EcomContext.Currency.Code", 2881 "url" : "@SearchEngineFriendlyURLs.GetFriendlyUrl( productLink )" 2882 } 2883 } 2884 </script> 28852886 </div> 28872888 @if (!isOutlet && !disableRelatedProducts) 2889 { 2890 <related-products type="RelatedProducts" product-id="@product.Id" variant-id="@product.VariantId"></related-products> 2891 } 28922893 @sectionStart() 289428952896 @using Co3.Espresso.Base.Extensions 2897 @using Co3.Espresso.Website.Models.FrontEnd 2898 @using Co3.Espresso.Website.Services 2899 @using Dynamicweb.Frontend 29002901 <script id="js-e-handlebars-tmpl-recommended-products" type="text/x-handlebars-template"> 29022903 <h4 class="isabella-text-bullets-left mb-3"> 2904 {{heading}} 2905 </h4> 2906 <div class="e-products f"> 29072908 <div class="row"> 2909 {{#each products}} 2910 {{#if pimActive}} 2911 <div class="col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"> 2912 <div class="card border-1 mb-6"> 2913 <a href="{{url}}"> 2914 <img src="{{imageDefault}}" alt="{{name}} {{productType}}" class="col-12 p-0"> 2915 {{#if news}} 2916 <div class="isabella-product-item-news"> 2917 @Translate("Ecom Product - News Badge - Text","Nyhed") 2918 </div> 2919 {{/if}} 2920 </a> 2921 <div class="card-body p-1 p-lg-3"> 2922 <h4 class="e-products-item-name mb-0"> 2923 <a href="{{url}}"> 2924 {{{name}}} 2925 </a> 2926 </h4> 29272928 </div> 2929 </div> 2930 </div> 29312932 {{/if}} 2933 {{/each}} 2934 </div> 2935 </div> 29362937 </script> 293829392940 @SnippetStart("ProductOpenGraph") 2941 @{ 2942 string openGraphTitle = product.Meta.Title; 2943 if (string.IsNullOrEmpty(openGraphTitle)) 2944 { 2945 openGraphTitle = product.Name; 2946 } 2947 string openGraphDescription = product.Meta.Description; 2948 if (string.IsNullOrEmpty(openGraphDescription)) 2949 { 2950 openGraphDescription = product.ShortDescription; 2951 } 2952 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"; 2953 } 2954 <meta property="og:title" content="@openGraphTitle"> 2955 <meta property="og:description" content="@openGraphDescription.StripHtml()"> 2956 <meta property="og:image" content="@openGraphImage"> 2957 @SnippetEnd("ProductOpenGraph")