HAGS Connect

    Krátky blok úvodných informácií o službe HAGS Connect.

    HAGS Connect Prihlásenie
    Moja kolekcia produktov

    Ak chcete pridať produkt, jednoducho kliknite na Pridať do mojej zbierky na stránke produktu. Po pridaní produktov do kolekcie si budete môcť vytlačiť katalóg produktov, stiahnuť návody na inštaláciu, obrázky a súbory DWG alebo požiadať o cenovú ponuku.

      Error executing template "Designs/Hags2024/eCom/Product/Product.cshtml"
      System.Xml.XmlException: There are multiple root elements. Line 1, position 43.
         at System.Xml.XmlTextReaderImpl.Throw(Exception e)
         at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
         at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
         at System.Xml.XmlTextReaderImpl.Read()
         at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
         at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
         at System.Xml.XmlDocument.Load(XmlReader reader)
         at System.Xml.XmlDocument.LoadXml(String xml)
         at Dynamicweb.Modules.Properties.LoadProperty(String xml, Boolean merge)
         at Dynamicweb.Modules.Properties.GetParagraphModuleSettings(Int32 pageId, String paragraphModuleSystemName)
         at HagsWeb.Library.Utilities.DWUtilities.GetProductUrl(Product product, Int32 areaId)
         at HagsWeb.Library.Utilities.DWUtilities.GetProductSearchResultUrl(String SearchResultUrl, Boolean variantsOnly, String languageId, Int32 areaId)
         at CompiledRazorTemplates.Dynamic.RazorEngine_eae3b25298f94cd6adb837706b571fa3.Execute() in B:\Projects\Hags_Dw915\Files\Templates\Designs\Hags2024\eCom\Product\Product.cshtml:line 57
         at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
         at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.DynamicWrapperService.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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
         at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
         at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
         at Dynamicweb.Rendering.Template.RenderRazorTemplate()
      
      1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System; 3 @using System.Globalization; 4 @using System.Collections.Generic; 5 @using System.Linq; 6 @using System.Web.Optimization; 7 @using HagsWeb.Library.Services.FileSystemService; 8 @using HagsWeb.Library.Utilities; 9 @using System.Text.RegularExpressions; 10 @using System.Text; 11 12 13 @* scripts required by this template - this snippet is rendered in the head tag of base.cshtml *@ 14 15 @SnippetStart("productScripts") 16 @* expand this for re-design debugging *@ 17 @* Scripts.Render("~/bundle/ProductFilter") *@ 18 19 @{ 20 string designBaseUrl = GetString("Template:DesignBaseUrl"); 21 string weglotHeader = System.Web.HttpContext.Current.Request.Headers["weglot-language"]; 22 } 23 24 <!--script type="text/javascript" src="@(designBaseUrl)assets/js/functions/variant-filter.js"></script--> 25 <script type="text/javascript" src="@(designBaseUrl)assets/js/functions/product-create-pdf.js?v=1.5"></script> 26 <script type="text/javascript" src="@(designBaseUrl)assets/js/libraries/wheel-zoom/wheel-zoom.min.js"></script> 27 28 @SnippetEnd("productScripts") 29 30 @* for this page we don't want the header to be positioned over the content *@ 31 @*SnippetStart("headerClass")@("in-flow")@SnippetEnd("headerClass")*@ 32 33 @* all the product model query code - sets up the models and variables used in this template *@ 34 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 35 @using Dynamicweb.Content.Items; 36 @using Dynamicweb.Ecommerce.Products; 37 @using HagsWeb.Library.Methods.AssetManager; 38 @using HagsWeb.Library.BusinessObjects.UsersLists; 39 @using HagsWeb.Library.Methods.AssetSearch; 40 @using HagsWeb.Library.Methods.Page; 41 @using HagsWeb.Library.Methods.ProductImages; 42 @using HagsWeb.Library.Methods.ProductProperties; 43 @using HagsWeb.Library.Methods.ProductFilter; 44 @using HagsWeb.Library.Services.IPService; 45 @using HagsWeb.Library.State; 46 @{ 47 Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 48 Item areaItem = Item.GetItemById("Website_Settings", thisPage.Area.Item.Id); 49 string pageUrl = GetGlobalValue("Global:Request.Scheme") + "://" + GetGlobalValue("Global:Request.Host") + thisPage.SearchFriendlyUrl; 50 string themeTag = HagsPages.GetThemeByNavigationTag(GetGlobalValue("Global:Page.Top.ID")); // gets the page ID at the top of the tree this page sits on. 51 var siteSection = HagsPages.GetSiteSection(thisPage.AreaID, thisPage.ID); 52 string salesPhoneNumber = areaItem["Telephone"].ToString(); 53 54 string productNumber = GetString("Ecom:Product.Number"); // The Product NUMBER 55 //int areaId = GetGlobalValue("Global:Area.ID"); 56 57 string canonicalProductUrl = GetGlobalValue("Global:Request.Scheme") + "://" + GetGlobalValue("Global:Request.Host") + HagsWeb.Library.Utilities.DWUtilities.GetProductSearchResultUrl("ProductNumber=" + productNumber, false, "LANG1", thisPage.AreaID); 58 canonicalProductUrl = "<link rel=\"canonical\" href=\"" + canonicalProductUrl + "\" />"; 59 //override the canonical tag added by hagspages 60 Pageview.Meta.AddTag("customCan", canonicalProductUrl); 61 Pageview.Meta.Title = GetString("Ecom:Product.Name") + " | HAGS"; 62 63 string currentCulture = GetGlobalValue("Global:Area.LongLang"); //en-GB, sv-SE 64 string currentCountry = currentCulture.Substring(currentCulture.Length - 2); // GB, SE 65 string currentlanguage = currentCulture.Substring(0, 2); // en, sv "de";// 66 string ipPriceAllowed = string.Empty; 67 68 if (thisPage.AreaID == 2 || thisPage.AreaID == 7) // Sweden and UK 69 { 70 ipPriceAllowed = IPCheck.CountryPriceAllowed(currentCountry); //ZZZ,Hags_GB,Hags_SE and Hags_, Anon_GB, Anon_SE network range checker(Web.config) 71 } 72 73 IEnumerable<ProductAsset> assets = AssetManager_Repository.GetAssets(productNumber, AssetType.All, true); 74 IEnumerable<ProductAsset> allImages = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).ToList(); 75 76 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 77 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 78 79 // New sorting for Product Images, thumbs and hiResDownloads for Zoom Images 80 Tuple<SortedList<int, string[,]>, IEnumerable<ProductAsset>> mainProductImages = ProductImages.MarshallZoomImages(allImages, productNumber); 81 SortedList<int, string[,]> zoomList = mainProductImages.Item1; 82 IEnumerable<ProductAsset> hiResDownloads = mainProductImages.Item2; 83 84 85 // The users Product Collection in session 86 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 87 bool isProductCollection = productCollectionItems.Any(n => n.ProductNumber == productNumber); 88 89 // users Product Collection 90 string collectionData = string.Format("CCAddToMyLists={0}&CCAddToListVariantID={1}&CCAreaID={2}&CCAddToListCulture={3}&CCAddToListLanguageID={4}#{5}", 91 GetString("Ecom:Product.Number"), GetString("Ecom:Product.VariantID"), GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.LanguageID"), siteSection); 92 93 94 // New Age Ranges. Some Template Tags dont work very well in upgraded DW version 9.7.2 95 List<string> ageRanges = new List<string>(); 96 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AgeRange"))) 97 { 98 ageRanges = ProductAgeRanges.GetAgeRanges(GetString("Ecom:Product:Field.AgeRange"), GetString("Ecom:Product.LanguageID")); 99 } 100 101 // New Product Functions. Some Template Tags dont work very well in upgraded DW version 9.7.2 102 List<ResultField> productFunctions = new List<ResultField>(); 103 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductFunctions"))) 104 { 105 productFunctions = ProductFieldValues.GetProductFieldOptions(GetString("Ecom:Product:Field.ProductFunctions"), "ProductFunctions", GetString("Ecom:Product.LanguageID")); 106 } 107 108 // For filtering the variants of this product 109 ResultSet colourOptions = new ResultSet(); 110 ResultSet materialOptions = new ResultSet(); 111 ResultSet anchoringOptions = new ResultSet(); 112 ResultSet optionOptions = new ResultSet(); 113 114 115 string selectedColourVariant = string.Empty; 116 string selectedAnchoringVariant = string.Empty; 117 string selectedAnchoringVariantId = string.Empty; 118 string selectedAnchoringIcon = string.Empty; 119 string selectedMaterialVariant = string.Empty; 120 string selectedOptionVariant = string.Empty; 121 //List<VariantOption> selectedProductOptions = new List<VariantOption>(); 122 123 124 125 if (GetInteger("Ecom:Product.VariantCount") > 0) 126 { 127 foreach (var variantGroup in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) // Remove All Date Variants 128 { 129 int optionsCount = variantGroup.GetLoop("VariantAvailableOptions").Count(); 130 131 if (optionsCount > 0) 132 { 133 if (!string.IsNullOrEmpty("Ecom:Product.SelectedVariantComboID")) // optionsCount == 1 134 { 135 foreach (var availableOption in variantGroup.GetLoop("VariantAvailableOptions")) 136 { 137 138 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "S55") 139 { 140 colourOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 141 142 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 143 { 144 145 colourOptions.Results.Add(new ResultField() { Name = availableOption.GetString("Ecom:VariantOption.Name"), Value = availableOption.GetString("Ecom:VariantOption.ID"), Sort = availableOption.GetInteger("Ecom:VariantOption.SortOrder"), Disabled = false }); 146 147 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 148 { 149 selectedColourVariant = availableOption.GetString("Ecom:VariantOption.Name"); 150 } 151 } 152 } 153 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP1") 154 { 155 materialOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 156 157 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 158 { 159 materialOptions.Results.Add(new ResultField() { Name = availableOption.GetString("Ecom:VariantOption.Name"), Value = availableOption.GetString("Ecom:VariantOption.ID"), Sort = availableOption.GetInteger("Ecom:VariantOption.SortOrder"), Disabled = false }); 160 161 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 162 { 163 selectedMaterialVariant = availableOption.GetString("Ecom:VariantOption.Name"); 164 } 165 } 166 } 167 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP3") 168 { 169 anchoringOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 170 171 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 172 { 173 anchoringOptions.Results.Add(new ResultField() { Name = availableOption.GetString("Ecom:VariantOption.Name"), Value = availableOption.GetString("Ecom:VariantOption.ID"), Sort = availableOption.GetInteger("Ecom:VariantOption.SortOrder"), Disabled = false }); 174 175 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 176 { 177 selectedAnchoringVariant = availableOption.GetString("Ecom:VariantOption.Name"); 178 selectedAnchoringVariantId = availableOption.GetString("Ecom:VariantOption.ID"); 179 selectedAnchoringIcon = availableOption.GetString("Ecom:VariantOption.ID") + ".png"; 180 } 181 } 182 } 183 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP4") 184 { 185 optionOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 186 187 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 188 { 189 optionOptions.Results.Add(new ResultField() { Name = availableOption.GetString("Ecom:VariantOption.Name"), Value = availableOption.GetString("Ecom:VariantOption.ID"), Sort = availableOption.GetInteger("Ecom:VariantOption.SortOrder"), Disabled = false }); 190 191 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 192 { 193 selectedOptionVariant = availableOption.GetString("Ecom:VariantOption.Name"); 194 } 195 } 196 197 } 198 } 199 } 200 } 201 } 202 } 203 204 205 string assemblyInstructionsProductNumber = productNumber; 206 207 // Related Products are only assigned to Master Products, not Variant Products so we need the related Products from the Master to get the full list of 208 // Assembly Instructions 209 Product product = new ProductService().GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), GetString("Ecom:Product.LanguageID")); 210 211 // Check if its a Master product. 212 if (!product.IsVariantMaster) 213 { 214 assemblyInstructionsProductNumber = new ProductService().GetProductsAndVariantsByProduct(product) 215 .FirstOrDefault<Product>(n => string.IsNullOrEmpty(n.VariantId)).Number; 216 } 217 218 // Check if its a Master product. 219 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 220 221 //Tuple<string, string, string, string, string> optionsTuple; 222 string VariantId = string.Empty; 223 if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || !string.IsNullOrEmpty(GetString("Ecom:Product.ProductDefaultVariantComboId")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductVariantFallback"))) 224 { 225 VariantId = string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) ? GetString("Ecom:Product.ProductDefaultVariantComboId") : GetString("Ecom:Product.VariantID"); 226 227 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 228 if (string.IsNullOrEmpty(VariantId)) 229 { 230 VariantId = GetString("Ecom:Product:Field.ProductVariantFallback"); 231 } 232 233 //optionsTuple = ProductFieldValues.GetProductOptions(VariantId, GetString("Ecom:Product.LanguageID")); 234 235 //selectedColourVariant = optionsTuple.Item1; 236 //selectedAnchoringVariant = optionsTuple.Item2; 237 //selectedMaterialVariant = optionsTuple.Item3; 238 //selectedOptionVariant = optionsTuple.Item4; 239 //selectedAnchoringIcon = optionsTuple.Item5; 240 //selectedProductOptions = optionsTuple.Item6; // used to filter related products by the variant values of this product 241 242 } 243 244 // Related Products and their Assembly Instructions 245 List<Product> relatedProducts = new List<Product>(); // Play Functions // Related products are now not required to be shown as a list of products. Gareth 17/02/2020 246 List<Product> relatedComponentProducts = new List<Product>(); 247 List<ProductAsset> relatedProductsAssemblyInstructions = new List<ProductAsset>(); 248 249 string variantOptions = selectedMaterialVariant + " " + selectedAnchoringVariant + " " + selectedOptionVariant + " " + selectedColourVariant; 250 251 if (GetInteger("Ecom:Product.RelatedCount") > 0) 252 { 253 // Play Functions // 254 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 255 { 256 relatedProducts = ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), VariantId, "Product Modules", GetString("Ecom:Product.LanguageID")); 257 } 258 259 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Components") != null) 260 { 261 relatedComponentProducts = ProductFilter.GetRelatedProducts(assemblyInstructionsProductNumber, VariantId, "Product Components", GetString("Ecom:Product.LanguageID")); 262 //// Lookup Assembly Instructions Assets 263 foreach (Product relatedComponentProduct in relatedComponentProducts) 264 { 265 if (relatedComponentProduct != null) 266 { 267 List<ProductAsset> productAssemblyInstructions = AssetManager_Repository.GetAssets(relatedComponentProduct.Number, AssetType.AssemblyInstructions, true); 268 if (productAssemblyInstructions.Any()) 269 { 270 //List<ProductAsset> result = productAssemblyInstructions.Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName == pa.FileName)).ToList(); 271 List<ProductAsset> result = productAssemblyInstructions 272 .Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName.Substring(8, pa2.FileName.Length - 8) == pa.FileName.Substring(8, pa.FileName.Length - 8))).ToList(); 273 result.ForEach(n => n.RelatedProduct = productNumber); 274 relatedProductsAssemblyInstructions.AddRange(result); 275 } 276 } 277 } 278 } 279 } 280 } 281 282 @* these contain helpers for rendering futher down the page *@ 283 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 284 @using Dynamicweb.Rendering; 285 @using System; 286 @using System.Web; 287 @using System.Collections.Generic; 288 @using System.Linq; 289 @using Ionic.Zip; 290 @using System.IO; 291 @using System.Threading; 292 293 @helper GetButton(List<string> files, string sender, string productNumber) 294 { 295 var request = HttpContext.Current.Request.Form; 296 var response = HttpContext.Current.Response; 297 298 if (!string.IsNullOrEmpty(request["ProductNumber"])) 299 { 300 // Currently only used for Product Image download on results page - see also GetDownload.cshtml 301 // To do KOD extract this into a service in Library, also consider Hags\Application\Ajax\UsersProductCollection\UsersProductCollection.aspx.cs(398) 302 if ( files.Any() ) 303 { 304 try 305 { 306 var zipArchives = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Zips"); 307 var transferFolder = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Transfers"); 308 309 // empty the zipArchives folder of zips that are 30 mins old (if any) 310 var oldZips = new DirectoryInfo(zipArchives).EnumerateFiles().Where(f => f.CreationTime < DateTime.Now.AddMinutes(-30)).ToList(); 311 oldZips.ForEach(f => f.Delete()); 312 313 DirectoryInfo Folder = new DirectoryInfo(transferFolder); 314 // Occasionally some files are read only and cannot be deleted so change all files, remove readonly before the delete 315 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 316 Directory.EnumerateFiles(transferFolder).ToList().ForEach(f => System.IO.File.Delete(f)); 317 318 // copy the selected files to the transferFolder and change from ReadOnly to try to prevent access to the path is denied error 319 files.ForEach(f => System.IO.File.Copy(f, Path.Combine(transferFolder, Path.GetFileName(f)), true)); 320 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 321 322 // Set up our new zip folder 323 var downloadFileName = string.Format(request["ProductNumber"] +"_"+ request["ProductName"] +"_Bilder {0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 324 // var downloadFileName = string.Format("Hags_Download_Pack-{0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 325 326 //var zipLocationUrl = "Files/System/UserDownloads/Zips/" + downloadFileName; // Use this to return a link to the folder saved to disk 327 328 HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; // Important - as is AppendHeader, not AddHeader 329 HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 330 331 using (var zip = new ZipFile()) 332 { 333 List<string> fileList = Directory.EnumerateFiles(transferFolder).ToList(); 334 //zip.AddDirectoryByName(subfolderName); 335 foreach (string file in fileList) 336 { 337 zip.AddFile(file, string.Empty); 338 } 339 340 // Save to the OutputStream 341 zip.Save(HttpContext.Current.Response.OutputStream); 342 // Or save the file to the file system using TransmitFile to stream the file without storing to memory 343 //zip.Save(zipArchives + "/" + downloadFileName); 344 } 345 346 // Transmit a file that was created on disk 347 //HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; 348 //HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 349 //HttpContext.Current.Response.TransmitFile(zipArchives + "/" + downloadFileName); 350 351 352 353 } 354 catch (ZipException ze) 355 { 356 string message = ze + "ProductDownload/GetDownloadButton.cshtml ZipException download file error (" + sender + ") - Original File Count: " + files.Count() + "InnerEx: " + ze.InnerException + ""; 357 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 358 log.Info(message); 359 } 360 catch (System.IO.FileNotFoundException notFoundEx) 361 { 362 string message = notFoundEx + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + notFoundEx.Message + " - The File: " + notFoundEx.FileName +""; 363 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 364 log.Info(message); 365 } 366 catch (ThreadAbortException) 367 { 368 // A normal Thread abort after HttpContext.Current.Response.End(); we dont record it 369 } 370 catch (Exception ex) 371 { 372 string message = ex + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + ex.Message + " - The Inner Ex: " + ex.InnerException + ""; 373 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 374 log.Info(message); 375 } 376 finally 377 { 378 HttpContext.Current.Response.End(); 379 } 380 381 } 382 } 383 else 384 { 385 string buttonCaption = string.Empty; 386 if (sender == "Product") 387 { 388 buttonCaption = Translate("ImageDownloads", "Image Downloads"); 389 <button class="images-form btn btn--outline" role="button" 390 data-action-page="Product" 391 data-action-type="Button" 392 data-action-label="Image downloads" 393 data-action-value="@productNumber"> 394 @buttonCaption 395 </button> 396 } 397 if (sender == "AdvancedSearch") 398 { 399 buttonCaption = Translate("DownloadAll", "Download All"); 400 <button class="images-form btn btn--outline" role="button" data-action-type="" data-action-label=""> 401 @buttonCaption 402 </button> 403 } 404 405 406 } 407 } 408 409 410 411 @helper renderPageBreadcrumb(string thisUrl, string currentCulture, string productName, string variantOptions) { 412 413 string[] segments = Array.Empty<string>(); 414 Uri uri = new Uri(thisUrl); 415 if (uri.IsWellFormedOriginalString()) 416 { 417 segments = uri.Segments; 418 } 419 420 @* set up this so we can use it's title case method *@ 421 TextInfo thisTextInfo = new CultureInfo(currentCulture,false).TextInfo; 422 423 string first = segments.FirstOrDefault(); 424 string last = segments.LastOrDefault(); 425 426 if (!string.IsNullOrEmpty(productName)) 427 { 428 string stripSpaces = Regex.Replace(productName, @"\s+", " "); // some product names may have 2 or 3 spaces in them 429 productName = stripSpaces.Replace(" ", "-").ToLower(); 430 } 431 432 string concat = string.Empty; 433 434 StringBuilder sb = new StringBuilder(); 435 sb.Append("<ul class=\"product-nav product-nav--arrows\" role=\"list\">"); 436 437 438 foreach (var item in segments.Select((value,i)=>new{i,value})) 439 { 440 var index = item.i; 441 if (true) 442 { 443 string linkText = item.value.Replace("/",""); 444 concat += item.value; 445 446 if (segments.Length <= 2) // A shorthand URL like www.hags.com/hags-dragonfly or www.hags.de/hags-dragonfly 447 { 448 sb.Append("<li>" + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</li>"); 449 } 450 // Request from the Product List with no Product Name 451 else if (item.value.Equals(last, StringComparison.CurrentCultureIgnoreCase) && string.IsNullOrEmpty(productName)) 452 { 453 sb.Append("<li><a href='" + concat.TrimEnd('/') + "' class=''> " + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 454 break; 455 } 456 // will be either the master product or the variant 457 else if (item.value.Equals(last, StringComparison.CurrentCultureIgnoreCase) && !item.value.Equals(productName, StringComparison.CurrentCultureIgnoreCase)) 458 { 459 linkText = variantOptions.Trim().Replace("Not applicable", "").ToLower(); 460 461 462 sb.Append("<li><a href='" + concat.TrimEnd('/') + "' class=''> " + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 463 } 464 else if (index == 2) 465 { 466 sb.Append("<li><a href='" + concat.TrimEnd('/') + "' class=''>Home</a></li>"); 467 } else if ( index > 2 ) { 468 sb.Append("<li><a href='" + concat.TrimEnd('/') + "' class=''>" + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 469 } 470 } 471 } 472 473 sb.Append("</ul>"); 474 475 @(sb.ToString()) 476 } 477 478 <article class="flow"> 479 480 <nav class="breadcrumb"> 481 <div class="wrapper"> 482 @renderPageBreadcrumb(pageUrl, GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.Name"), variantOptions) 483 </div> 484 </nav> 485 486 487 <section class="product-header"> 488 489 <div class="wrapper flow"> 490 <h1>@GetString("Ecom:Product.Name")</h1> 491 @using System.Web; 492 @using System.Globalization; 493 494 @{ 495 bool centralStock = GetBoolean("Ecom:Product:Field.CentralStock"); 496 bool swedishStock = GetBoolean("Ecom:Product:Field.SwedishStock"); 497 string ipAddress = HttpContext.Current.Request.ServerVariables["remote_addr"]; 498 string weglotLang = System.Web.HttpContext.Current.Request.Headers["weglot-language"]; 499 string productNumberDisplay = productNumber; 500 string formattedCurrency = GetInteger("Ecom:Product.DBPrice").ToString("C", new CultureInfo("sv-SE")); 501 } 502 @if ( weglotLang == "se" || weglotLang == "da" ) 503 { 504 if ( swedishStock ) 505 { 506 productNumberDisplay = productNumber + "-1"; 507 } 508 } 509 else 510 { 511 if (centralStock) 512 { 513 productNumberDisplay = productNumberDisplay + "-2"; 514 } 515 } 516 517 518 <p class="product-number">@productNumberDisplay</p> 519 520 @* 521 <!-- central: @centralStock swedish: @swedishStock --> 522 <!-- Integer DB price: @GetInteger("Ecom:Product.DBPrice") --> 523 <!-- String Price Formatted: @GetString("Ecom:Product.Price.PriceFormatted") --> 524 <!-- String Price: @GetString("Ecom:Product.Price") --> 525 <!-- IP address: @ipAddress --> 526 <!-- Weglot language: @weglotLang --> 527 <!-- formatted currency: @formattedCurrency --> 528 *@ 529 530 </div> 531 532 <div class="wrapper"> 533 534 <div class="fc-zoom"> 535 @*Zoom Product Images*@ 536 @if (zoomList.Count > 0) 537 538 { 539 <div class="fc-zoom__view"> 540 <div class="fc-zoom__target" id="zoom-target-1"> 541 @{ 542 var i = 0; 543 string resizeUrl = "/Admin/Public/GetImage.ashx?Image="; 544 string resizeOptions = "&Crop=0&Format=jpg&Height=350&Compression=75"; 545 } 546 @foreach (var zoomSet in zoomList) 547 { 548 string[,] imgSet = zoomSet.Value; 549 string imgId = string.Format("img_0{0}", zoomSet.Key); 550 string imageUrl = resizeUrl + imgSet[0, 2] + resizeOptions; 551 552 553 if (i == 0) 554 { 555 556 <img class="fc-zoom__img active" id="zoom-full-image-@i" src="@imgSet[0, 2]" data-zoom-image="@imgSet[0, 2]" alt="@GetString("Ecom:Product.Name")"> 557 } 558 else 559 { 560 <img class="fc-zoom__img" id="zoom-full-image-@i" src="@imgSet[0, 2]" data-zoom-image="@imgSet[0, 2]" alt="@GetString("Ecom:Product.Name")"> 561 } 562 i++; 563 } 564 </div> 565 566 <button class="fc-zoom__button fc-zoom__button--in reel-cards__btn" id="zoom-toggle"> 567 <span class="visually-hidden">Toggle Zoom</span> 568 <span class="fc-zoom__icon fc-zoom__icon--in"> 569 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--bigger"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm14.215 100.332 38.614 38.615v-28.357a5 5 0 0 1 10 0v40c0 .389-.045.767-.128 1.13a5.002 5.002 0 0 1-4.93 4.163h-40a5 5 0 1 1 0-10h27.852l-38.48-38.48a5 5 0 0 1 7.072-7.071ZM89.738 43.201a5 5 0 1 1 0 10H61.885l38.48 38.48a5 5 0 0 1-7.072 7.07L54.68 60.138v28.357a5 5 0 1 1-10 0v-40c0-.389.045-.767.128-1.13a5.002 5.002 0 0 1 4.93-4.163h40Z"/></svg> 570 </span> 571 <span class="fc-zoom__icon fc-zoom__icon--out"> 572 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--smaller"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm50.738 97.868a5 5 0 0 1 0 10h-27.853l38.48 38.48a5 5 0 1 1-7.072 7.07l-38.614-38.614v28.357a5 5 0 1 1-10 0v-40c0-.389.045-.767.128-1.13a5.002 5.002 0 0 1 4.93-4.163h40ZM53.215 45.665 91.829 84.28V55.923a5 5 0 1 1 10 0v40c0 .389-.045.767-.128 1.13a5.002 5.002 0 0 1-4.93 4.163h-40a5 5 0 0 1 0-10h27.852l-38.48-38.48a5 5 0 0 1 7.072-7.071Z"/></svg> 573 </span> 574 </button> 575 </div> 576 577 <div class="reel-thumbs fc-zoom__thumbs" id="zoom-gallery"> 578 579 <button 580 class="reel-cards__btn reel-cards__btn--prev" 581 data-action-page="Product" 582 data-action-type="Button" 583 data-action-label="Gallery prev" 584 data-action-value="@productNumber"> 585 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--up"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm0 67.467c4.307 0 8.347 2.08 10.847 5.587l8.714 12.197.739 1.034 1.114 1.559.744 1.042 1.116 1.561.741 1.038 14.745 20.642c2.14 2.993 1.44 7.16-1.553 9.3-2.994 2.14-7.16 1.44-9.3-1.553L106 92.133l-27.907 39.074c-2.14 2.993-6.306 3.693-9.3 1.553-2.993-2.14-3.693-6.307-1.553-9.3l14.745-20.642.741-1.038 1.116-1.561.744-1.042 1.114-1.559.739-1.034 8.714-12.197A13.319 13.319 0 0 1 106 78.8Z"/></svg> 586 <span class="visually-hidden">@Translate("page_Previous", "Previous")</span> 587 </button> 588 589 <div class="reel-thumbs__viewport"> 590 591 <div class="fc-zoom__thumbs-list reel-thumbs__container"> 592 @{ i = 0; } 593 @foreach (var zoomSet in zoomList) 594 { 595 string[,] imgSet = zoomSet.Value; 596 string imgId = string.Format("img_0{0}", zoomSet.Key); 597 <div class="reel-thumbs__frame"> 598 <a class="fc-zoom__link" href="@imgSet[0, 1]" data-image-target="zoom-full-image-@i" data-image="" data-zoom-image="@imgSet[0, 2]"> 599 <img class="fc-zoom__thumb" src="@imgSet[0, 0]" alt="@GetString("Ecom:Product.Name")"> 600 </a> 601 </div> 602 i++; 603 604 } 605 </div> 606 607 </div> 608 609 <button 610 class="reel-cards__btn reel-cards__btn--next" 611 data-action-page="Product" 612 data-action-type="Button" 613 data-action-label="Gallery next" 614 data-action-value="@productNumber"> 615 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--down"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm37.207 68.707c2.993 2.14 3.693 6.307 1.553 9.3l-14.745 20.642-.741 1.038-1.116 1.562-.744 1.041-10.567 14.79A13.319 13.319 0 0 1 106 134c-4.307 0-8.347-2.08-10.847-5.586l-10.567-14.79-.744-1.042-1.116-1.562-.741-1.038L67.24 89.34c-2.14-2.993-1.44-7.16 1.553-9.3 2.994-2.14 7.16-1.44 9.3 1.554L106 120.667l14.79-20.708.834-1.168 12.283-17.197c2.14-2.994 6.306-3.694 9.3-1.554Z"/></svg> 616 <span class="visually-hidden">@Translate("page_Next", "Next")</span> 617 </button> 618 619 620 621 </div> 622 } 623 </div> 624 625 626 </section> 627 628 629 <div class="page-intro wrapper"> 630 631 <div class="page-intro__copy flow"> 632 633 <div class="cluster"> 634 @* add to collection button *@ 635 @if (isProductCollection) 636 { 637 <button type="button" class="btn btn--outline print-hide" data-removeproductlist="@productNumber" data-addproductlist=""> 638 @Translate("RemoveFromCollection", "Remove from my Collection") 639 </button> 640 } 641 else 642 { 643 <button 644 type="button" 645 class="btn btn--outline print-hide" 646 data-removeproductlist="" 647 data-addproductlist="@collectionData" 648 data-action-page="Product" data-action-type="button" data-action-label="Add to collection" data-action-value="@productNumber"> 649 @Translate("AddToCollection", "Add to my collection") 650 </button> 651 } 652 653 @* download images button *@ 654 @if (hiResDownloads.Count() > 0) 655 { 656 List <string> fileList = new List<string>(); 657 foreach (var file in hiResDownloads) 658 { 659 fileList.Add(file.FullPath); 660 } 661 <form method="post" id="downloadImagesForm"> 662 <input type="hidden" name="ProductNumber" value="@productNumber" /> 663 <input type="hidden" name="ProductName" value="@GetString("Ecom:Product.Name")" /> 664 @GetButton(fileList, "Product", productNumber) 665 </form> 666 } 667 668 @* PDF Product sheet button *@ 669 @{ 670 string printShout = Translate("SaveOrPrint", "Save or Print your Product PDF "); 671 string productId = @GetString("Ecom:Product.ID"); 672 string productVariantId = @GetString("Ecom:Product.VariantID"); 673 } 674 <button type="button" id="productSheetButton" data-target="#CreateProductPdf" 675 name="productPublishing" data-productid="@productId" data-productnumber="@productNumber" 676 data-variantid="@productVariantId" data-open-modal="#CreateProductPdf" data-request="technicalsheet" data-shout="@printShout" 677 class="btn btn--outline" 678 data-action-page="Product" data-action-type="button" data-action-label="Create product PDF" data-action-value="@productNumber"> 679 @Translate("ProductSheet", "PDF Product Sheet") 680 </button> 681 682 683 </div> 684 685 @*if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.ShortDescription"))) 686 { 687 <p>@GetString("Ecom:Product.ShortDescription")</p> 688 } 689 *@ 690 691 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.LongDescription"))) 692 { 693 @* 694 string paragraph = GetString("Ecom:Product.LongDescription"); 695 string[] paragraphs = paragraph.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries); 696 foreach (var p in paragraphs) 697 { 698 <p>@p.Trim().</p> 699 } 700 *@ 701 <p>@GetString("Ecom:Product.LongDescription")</p> 702 703 } 704 705 <div class="cluster" title="@Translate(" Anchoring", "Anchoring"): @selectedAnchoringVariant"> 706 707 @if ( GetBoolean("Ecom:Product:Field.CentralStock") && (weglotLang != "se" && weglotLang != "da") ) 708 { 709 <div class="product-icon" title="Leverans ex lager från Sverige"> 710 <img class="product-icon__icon" src="/Files/Images/Other/Playground box/Lorry.jpg" alt="Leverans ex lager från Sverige" /> 711 <p>Fast Delivery</p> 712 </div> 713 } 714 715 @if ( (weglotLang == "se" || weglotLang == "da") && swedishStock ) 716 { 717 <div class="product-icon" title="Leverans ex lager från Sverige"> 718 <img class="product-icon__icon" src="/Files/Images/Other/Playground box/Lorry.jpg" alt="Leverans ex lager från Sverige" /> 719 <p>Fast Delivery</p> 720 </div> 721 } 722 723 724 725 @if (!string.IsNullOrWhiteSpace(selectedAnchoringIcon ?? selectedAnchoringVariant)) 726 { 727 728 <div class="product-icon"> 729 <img class="product-icon__icon" src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" /> 730 @selectedAnchoringVariant 731 </div> 732 } 733 734 </div> 735 736 <p> 737 @(selectedMaterialVariant != "" ? selectedMaterialVariant + " - " : "") 738 @(selectedOptionVariant != "" ? selectedOptionVariant + " - " : "") 739 @(@selectedColourVariant != "" ? selectedColourVariant : "") 740 </p> 741 742 @using System.Web; 743 @using System.Globalization; 744 @using System.IO; 745 @using System.Linq; 746 @using System.Net; 747 @using System.Configuration; 748 749 @{ 750 //string ipAddress = HttpContext.Current.Request.ServerVariables["remote_addr"]; 751 //string weglotLang = System.Web.HttpContext.Current.Request.Headers["weglot-language"]; 752 //string formattedCurrency = GetInteger("Ecom:Product.DBPrice").ToString("C", new CultureInfo("sv-SE")); 753 bool showPrice = false; 754 string ipCountryCode = ""; 755 756 if ( (weglotLang == "se") ) 757 { 758 string ipLookupKey = ConfigurationManager.AppSettings["ExtremeIpLookupApiKey"].ToString(); 759 string ipLookupUrl = "http://extreme-ip-lookup.com/json/" + ipAddress + "?key=" + ipLookupKey; 760 string ipLookupError = ""; 761 762 763 HttpWebRequest ipLookupRequest = (HttpWebRequest)WebRequest.Create(ipLookupUrl); 764 ipLookupRequest.Method = "GET"; // Set method to GET 765 ipLookupRequest.ContentType = "application/json"; 766 767 try 768 { 769 // Get the response from the API 770 using (HttpWebResponse ipLookupResponse = (HttpWebResponse)ipLookupRequest.GetResponse()) 771 { 772 // Check if the response is OK 773 if (ipLookupResponse.StatusCode == HttpStatusCode.OK) 774 { 775 // Read the response stream 776 using (StreamReader reader = new StreamReader(ipLookupResponse.GetResponseStream())) 777 { 778 // Parse the JSON response 779 string jsonResponse = reader.ReadToEnd(); 780 781 // Parse JSON using JObject (from Newtonsoft.Json.Linq) 782 Newtonsoft.Json.Linq.JObject jsonObject = Newtonsoft.Json.Linq.JObject.Parse(jsonResponse); 783 784 // Extract a specific value (assuming the JSON has a field named "desiredField") 785 ipCountryCode = (string)jsonObject["countryCode"]; 786 ipCountryCode = ipCountryCode.ToLower(); 787 } 788 } 789 } 790 } 791 792 catch (Exception ex) 793 { 794 // Handle any errors 795 //set default to au 796 ipCountryCode = ""; 797 ipLookupError = ex.Message; 798 } 799 800 if ( ipCountryCode == "se" ) { 801 showPrice = true; 802 } 803 } 804 805 } 806 807 808 @if ( showPrice ) { 809 810 <p> 811 <span class="ts-3">@formattedCurrency</span> <span>(Excluding VAT)</span> 812 </p> 813 814 } 815 816 <!-- @formattedCurrency --> 817 818 @* 819 <!-- IP address: @ipAddress --> 820 <!-- Weglot language: @weglotLang --> 821 <!-- formatted currency: @formattedCurrency --> 822 *@ 823 824 </div> 825 </div> 826 827 828 829 <section> 830 <div class="wrapper"> 831 832 <div class="center-copy"> 833 834 @{ 835 string[] badges = GetString("Ecom:Product:Field.EnvironmentalBadge.Value").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); 836 } 837 <div> 838 <ul class="badges"> 839 @foreach (var badge in badges) 840 { 841 string altText = ""; 842 843 if (badge == "NSEL") 844 { 845 altText = Translate("CertifiedNordicSwan", "Certified by Nordic Swan"); 846 } 847 848 if ( badge == "BVB8" ) { 849 altText = Translate("BVBGradeAccepted", "Assessed by Byggvarubedömningen, Grade: Accepted"); 850 } 851 852 if ( badge == "BVB7" ) { 853 altText = Translate("BVBGradeRecommended", "Assessed by Byggvarubedömningen, Grade: Recommended"); 854 } 855 856 if ( badge == "SH1" ) { 857 altText = Translate("SundaHusGradeB", "Assessed by SundaHus, Grade: B"); 858 } 859 860 if ( badge == "SH2" ) { 861 altText = Translate("SundaHusGradeA", "Assessed by SundaHus, Grade: A"); 862 } 863 <li class="badges__item"><img src="@(designBaseUrl)assets/img/badges/@(badge).png" alt="@altText" title="@altText" /></li> 864 } 865 </ul> 866 </div> 867 868 <div class="accordians"> 869 870 <section class="accordian"> 871 <div class="wrapper"> 872 873 <h3><button 874 id="accordian-spec" 875 aria-expanded="true" aria-controls="accordian-spec-panel" type="button" 876 class="accordian__button" 877 data-action-page="Product" 878 data-action-type="Text block expand" 879 data-action-label="Specifications" 880 data-action-value="@productNumber"> 881 @Translate("ProductSpecifications", "Product Specifications") 882 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 883 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 884 </button> 885 </h3> 886 887 <div class="accordian__panel" id="accordian-spec-panel"> 888 <div class="accordian__content flow"> 889 890 @if (!String.IsNullOrWhiteSpace(@GetString("Ecom:Product:Field.IPEMA_Specification"))) 891 { 892 string ipemaData = GetString("Ecom:Product:Field.IPEMA_Specification"); 893 // Get IPEMA Product Specification data from a Field on the Product data from Jeeves 894 //System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Load(System.Web.HttpContext.Current.Server.MapPath("~/Files/Templates/eCom/Product/meterial_xml_out_putV2_Edit.xml")); 895 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(ipemaData); 896 897 if (dataXML != null) 898 { 899 @*<h1> @GetString("Ecom:Product.Name") </h1>*@ 900 @*<p>@dataXML</p>*@ 901 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 902 903 var details = from dat in dataXML.Descendants("Item") 904 select new 905 { 906 name = dat.Element("name").Value, 907 enValue = dat.Element("EN_value").Value, 908 astmValue = dat.Element("ASTM_value").Value, 909 csaValue = dat.Element("CSA_value").Value 910 }; 911 912 <table class="table"> 913 <thead> 914 <tr> 915 <th scope="col"></th> 916 <th scope="col">@Translate("Europe","Europe")<br>EN1176</th> 917 <th scope="col">@Translate("USA", "USA")<br>ASTM F1487</th> 918 <th scope="col">@Translate("Canada", "Canada")<br>CSA Z614</th> 919 </tr> 920 </thead> 921 922 <tbody> 923 @foreach (var item in details) 924 { 925 <tr> 926 <td>@item.name</td> 927 <td>@item.enValue</td> 928 <td>@item.astmValue</td> 929 <td>@item.csaValue</td> 930 </tr> 931 } 932 </tbody> 933 </table> 934 935 @*#table-IPEMA Product Spec*@ 936 } 937 938 } else { 939 <table class="table"> 940 <thead> 941 <tr> 942 <th scope="col"></th> 943 <th scope="col"></th> 944 </tr> 945 </thead> 946 <tbody> 947 948 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.NumberOfChildren"))) 949 { 950 <tr> 951 <td>@GetString("Ecom:Product:Field.NumberOfChildren.Name")</td> 952 <td>@GetString("Ecom:Product:Field.NumberOfChildren.Value")</td> 953 </tr> 954 } 955 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 956 { 957 <tr> 958 <td>@GetString("Ecom:Product:Field.AgeRange.Name")</td> 959 <td>@string.Join(", ", ageRanges)</td> 960 </tr> 961 } 962 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 963 { 964 <tr> 965 <td>@GetString("Ecom:Product:Field.AssemblyTime.Name")</td> 966 <td>@GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") @Translate("Hours", "hours")</td> 967 </tr> 968 } 969 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 970 { 971 <tr> 972 <td>@GetString("Ecom:Product:Field.Length.Name").Replace(" (mm)", "")</td> 973 <td>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</td> 974 </tr> 975 } 976 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 977 { 978 <tr> 979 <td>@GetString("Ecom:Product:Field.Width.Name").Replace(" (mm)", "")</td> 980 <td>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</td> 981 </tr> 982 } 983 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 984 { 985 <tr> 986 <td>@GetString("Ecom:Product:Field.Height.Name").Replace(" (mm)", "")</td> 987 <td>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</td> 988 </tr> 989 } 990 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 991 { 992 <tr> 993 <td>@GetString("Ecom:Product:Field.NetWeight.Name")</td> 994 <td>@GetString("Ecom:Product:Field.NetWeight.Value") kg</td> 995 </tr> 996 } 997 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 998 { 999 <tr> 1000 <td>@GetString("Ecom:Product:Field.Volume.Name")</td> 1001 <td>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</td> 1002 </tr> 1003 } 1004 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 1005 { 1006 <tr> 1007 <td>@GetString("Ecom:Product:Field.FallHeight.Name").Replace(" (mm)", "")</td> 1008 <td>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</td> 1009 </tr> 1010 } 1011 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 1012 { 1013 <tr> 1014 <td>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name").Replace(" (mm)", "")</td> 1015 <td>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</td> 1016 </tr> 1017 } 1018 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 1019 { 1020 <tr> 1021 <td>@GetString("Ecom:Product:Field.SafetyAreaLength.Name").Replace(" (mm)", "")</td> 1022 <td>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</td> 1023 </tr> 1024 } 1025 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 1026 { 1027 <tr> 1028 <td>@GetString("Ecom:Product:Field.SafetyArea.Name")</td> 1029 <td>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</td> 1030 </tr> 1031 } 1032 1033 </tbody> 1034 </table> 1035 1036 } 1037 1038 @*SafetyAreaDetails*@ 1039 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value") > 0 && thisPage.AreaID == 1) 1040 { 1041 string safetyAreaPage = DWUtilities.GetPageByNavigationTag("SafetyArea", thisPage.AreaID); 1042 if (!string.IsNullOrEmpty(safetyAreaPage)) 1043 { 1044 <p><a href="@safetyAreaPage" class="print-hide">@Translate("ReadMoreSafetyArea", "Read more about safety areas")</a></p> 1045 } 1046 1047 } 1048 1049 @*Anchoring from Variant*@ 1050 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 1051 { 1052 string anchoringPage = DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.AreaID) + "#" + GetGlobalValue("Global:HagsTheme"); 1053 1054 if (!string.IsNullOrEmpty(anchoringPage)) 1055 { 1056 <p><a href="@anchoringPage" class="btn btn--outline print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a></p> 1057 } 1058 1059 } 1060 1061 @*Guarantee Page for Sweden*@ 1062 @if (thisPage.AreaID == 2) 1063 { 1064 <p><a href="/sv-se/om-hags/garantier" target="_blank" class="print-hide">Läs mer om produktgarantier</a></p> 1065 } 1066 </div> 1067 </div> 1068 </section> 1069 <section class="accordian"> 1070 <div class="wrapper"> 1071 <h3> 1072 <button id="accordian-spec" aria-expanded="true" aria-controls="accordian-spec-panel" type="button" class="accordian__button" data-action-page="Product" data-action-type="Text block expand" data-action-label="Experiences" data-action-value="@productNumber">Play Experiences<span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span><span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span></button> 1073 </h3> 1074 <div class="accordian__panel" id="accordian-spec-panel"> 1075 <div class="accordian__content flow"> 1076 @* Play Value Icons *@ 1077 1078 @if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.PlayValues"))) 1079 { 1080 string[] playValues = GetString("Ecom:Product:Field.PlayValues.Value").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); 1081 1082 var playCategories = new Dictionary<string,List<string>>{}; 1083 1084 1085 var playMap = new Dictionary<string, (string, string)> 1086 { 1087 { "50",("Spinning and Rolling","Physical") }, 1088 { "51",("Sliding","Physical") }, 1089 { "52",("Swinging / Rocking","Physical") }, 1090 { "53",("Climbing","Physical") }, 1091 { "54",("Crawling","Physical") }, 1092 { "55",("Balancing","Physical") }, 1093 { "56",("Jumping / Bouncing","Physical") }, 1094 { "57",("Walking and running","Physical") }, 1095 { "58",("Hanging<br/>(from the arms)","Physical") }, 1096 { "59",("Pointing and touching","Physical") }, 1097 { "60",("Cooperating","Social") }, 1098 { "61",("Sharing","Social") }, 1099 { "62",("Communicating","Social") }, 1100 { "63",("Turn-taking","Social") }, 1101 { "64",("Competing","Social") }, 1102 { "65",("Playing with mathematical concepts","Cognitive") }, 1103 { "66",("Playing with literacy concepts","Cognitive") }, 1104 { "67",("Problem solving","Cognitive") }, 1105 { "68",("Concentrating","Cognitive") }, 1106 { "69",("Remembering","Cognitive") }, 1107 { "70",("Planning / Tactics","Cognitive") }, 1108 { "71",("Growing / Planting","Creative") }, 1109 { "72",("Painting / Drawing / Mark Making","Creative") }, 1110 { "73",("Building / Arranging","Creative") }, 1111 { "74",("Sound making","Creative") }, 1112 { "75",("Imagining / Storytelling","Creative") } 1113 }; 1114 1115 @* Add the values to the play categories *@ 1116 1117 foreach (var value in playValues) 1118 { 1119 string playCategoryName = playMap.ContainsKey(value) ? playMap[value].Item2 : "unknown"; 1120 if (!playCategories.ContainsKey(playCategoryName)) 1121 { 1122 playCategories[playCategoryName] = new List<string>(); 1123 } 1124 playCategories[playCategoryName].Add(value); 1125 } 1126 1127 @* now loop through the category keys - building a list for each key *@ 1128 1129 foreach (var playCategory in playCategories ) 1130 { 1131 <h5 class="ts-0">@playCategory.Key</h5> 1132 <ul class="badges"> 1133 @foreach (var value in playCategory.Value) 1134 { 1135 string playTitle = playMap.ContainsKey(value) ? playMap[value].Item1 : "Unknown"; 1136 string valueImg = value + ".svg"; 1137 <li class="badges__item badges__item--text"> 1138 <img src="@(designBaseUrl)icons/play-values-icons/@valueImg" alt="@playTitle" title="@playTitle" /> 1139 <span>@playTitle</span> 1140 </li> 1141 } 1142 </ul> 1143 } 1144 1145 } 1146 </div> 1147 </div> 1148 </section> 1149 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Material"))) 1150 { 1151 <section class="accordian"> 1152 <div class="wrapper"> 1153 1154 <h3> 1155 <button id="accordian-materials" aria-expanded="true" aria-controls="accordian-materials-panel" type="button" class="accordian__button" 1156 data-action-page="Product" 1157 data-action-type="Text block expand" 1158 data-action-label="Materials" 1159 data-action-value="@productNumber"> 1160 @GetString("Ecom:Product:Field.Material.Name") 1161 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 1162 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 1163 </button> 1164 </h3> 1165 1166 <div class="accordian__panel" id="accordian-materials-panel"> 1167 <div class="accordian__content"> 1168 1169 @{ 1170 1171 string materialData = GetString("Ecom:Product:Field.Material");// Get Material data from a Field on the Product data from Jeeves (not implemented yet) GetString("Ecom:Product:Field.MaterialData"); 1172 if (!string.IsNullOrEmpty(materialData)) 1173 { 1174 //System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Load(System.Web.HttpContext.Current.Server.MapPath("~/Files/Templates/eCom/Product/meterial_xml_out_put.xml")); 1175 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 1176 1177 if (dataXML != null) 1178 { 1179 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 1180 //format.NumberGroupSeparator = ","; //for thousands 1181 //format.NumberDecimalSeparator = "."; //the decimal seperator 1182 1183 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 1184 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 1185 1186 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 1187 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 1188 1189 var details = from dat in dataXML.Descendants("Item") 1190 select new 1191 { 1192 material = dat.Element("material").Value, 1193 //weight = dat.Element("kg").Value,// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 1194 weight = Math.Round(Double.Parse(dat.Element("kg").Value, format), 1).ToString(),// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 1195 percent = Math.Round(Double.Parse(dat.Element("percent").Value, format), 1).ToString() // string.Format("{0:0.00}", Double.Parse(dat.Element("percent").Value)) 1196 }; 1197 1198 <table class="table"> 1199 <thead> 1200 <tr> 1201 <th scope="col">@GetString("Ecom:Product:Field.Material.Name")</th> 1202 <th scope="col">kg</th> 1203 <th scope="col">&#37;</th> 1204 </tr> 1205 </thead> 1206 1207 <tbody> 1208 1209 @foreach (var item in details) 1210 { 1211 <tr> 1212 <td>@item.material</td> 1213 <td>@item.weight</td> 1214 <td>@item.percent</td> 1215 </tr> 1216 } 1217 1218 1219 1220 </tbody> 1221 1222 <tfoot> 1223 <tr> 1224 <td>&nbsp;</td> 1225 <td><strong>@totalweight kg</strong></td> 1226 <td><strong>@totalpercent&#37;</strong></td> 1227 </tr> 1228 </tfoot> 1229 </table> <!--! #table-materials --> 1230 } 1231 } 1232 1233 } 1234 </div> 1235 </div> 1236 </div> 1237 </section> 1238 } 1239 @if (imagesCount + brochCount < assets.Count()) 1240 { 1241 1242 1243 } 1244 1245 @helper renderAccordianPanel(List<ProductAsset> assetList, string assetType, string translationTitle, string fallbackTitle, string extraContent = "", string productNumber = "") 1246 { 1247 1248 <section class="accordian print-hide"> 1249 <div class="wrapper"> 1250 <h3> 1251 <button id="accordian-downloads-@assetType" 1252 aria-expanded="true" aria-controls="accordian-panel-downloads-@assetType" type="button" class="accordian__button" 1253 data-action-page="Product" 1254 data-action-type="Text block expand" 1255 data-action-label="@translationTitle" 1256 data-action-value="@productNumber"> 1257 @Translate(translationTitle, fallbackTitle) 1258 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 1259 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 1260 </button> 1261 </h3> 1262 1263 1264 <div class="accordian__panel" id="accordian-panel-downloads-@assetType"> 1265 <div class="accordian__content"> 1266 <ul class="downloads__list"> 1267 @foreach (ProductAsset asset in assetList) 1268 { 1269 <li> 1270 <a href="@asset.uri" download="@asset.FileName"> 1271 <span>@asset.FileName</span> 1272 </a> 1273 </li> 1274 } 1275 </ul> 1276 1277 @extraContent 1278 </div> 1279 </div> 1280 1281 </div> 1282 </section> 1283 1284 } 1285 1286 @* Certificates *@ 1287 1288 @{ 1289 1290 List<ProductAsset> certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 1291 1292 // Test if we have a filename like "GB_UniMini_1_A-F_1137_Cert_T�V". If so move it to the top of the subset so it shows first in the list. 1293 int index = certAssets.FindIndex(n => n.FileName.Contains("_Cert_T")); 1294 if(index > -1) 1295 { 1296 ProductAsset aTuv = certAssets[index]; 1297 certAssets[index] = certAssets[0]; 1298 certAssets[0] = aTuv; 1299 } 1300 } 1301 1302 @if (certAssets.Count > 0) 1303 { 1304 @renderAccordianPanel(certAssets, "certificates", "Certificates", "Certificates", "", productNumber) 1305 } 1306 1307 @* Assembly Instructions *@ 1308 1309 @{ 1310 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 1311 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 1312 } 1313 1314 @if (assemblyAssets.Count > 0) 1315 { 1316 string extraContent = "<button class=\"productDownloadButton download btn btn--outline\" name=\"download\" data-parent=\"Monteringsanvisningar\""; 1317 extraContent += " data-productnumber=\"" + productNumber + "\" data-productname=\"" + GetString("Ecom:Product.Name") + "\">"; 1318 extraContent += Translate("DownloadInstallationGuides", "Installation Guides") + "</button>"; 1319 1320 @renderAccordianPanel(assemblyAssets, "install-guides", "InstallationGuides", "Installation Guides", extraContent, productNumber) 1321 } 1322 1323 @{ 1324 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1325 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1326 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1327 } 1328 1329 @* Detailed Assembly Instructions *@ 1330 1331 @{ 1332 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1333 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1334 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1335 } 1336 1337 @if (relatedProductsAssemblyInstructions.Count > 0) 1338 { 1339 1340 @renderAccordianPanel(relatedProductsAssemblyInstructions, "detail-guides", "DetailedInstallationGuides", "Detailed Installation Guides", "", productNumber) 1341 } 1342 1343 1344 @{ 1345 List<ProductAsset> inspAssets = new List<ProductAsset>(); 1346 //inspAssets = FileSystem.GetPdfFilesFromDirectoryBySiteCulture("/Files/System/ProductCollectionDownloads/InspectionMaintenance", "_" + currentlanguage.ToUpper()); 1347 inspAssets = FileSystem.GetAllPdfFilesFromDirectory("/Files/System/ProductCollectionDownloads/InspectionMaintenance"); 1348 } 1349 1350 @if (inspAssets != null && inspAssets.Count > 0) 1351 { 1352 @renderAccordianPanel(inspAssets, "insp-maintenance", "InspectionMaintenance", "Inspection & Maintenance", "", productNumber) 1353 } 1354 else 1355 { 1356 <section class="accordian print-hide"> 1357 <div class="wrapper"> 1358 <h3> 1359 <button id="accordian-downloads-insp-maintenance" 1360 aria-expanded="true" aria-controls="accordian-panel-downloads-insp-maintenance" 1361 type="button" class="accordian__button" 1362 data-action-page="Product" 1363 data-action-type="Text block expand" 1364 data-action-label="InspectionMaintenance" 1365 data-action-value="@productNumber"> 1366 @Translate("InspectionMaintenance", "Inspection & Maintenance") 1367 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 1368 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 1369 </button> 1370 </h3> 1371 1372 1373 <div class="accordian__panel" id="accordian-panel-downloads-insp-maintenance"> 1374 <div class="accordian__content"> 1375 <ul class="downloads__list"> 1376 <li> 1377 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Playground Equipment I&M guide_EN.pdf" download="Playground Equipment I&M Guide"> 1378 <span>Playground Equipment I&M Guide</span> 1379 </a> 1380 </li> 1381 <li> 1382 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Sports and fitness I&M guide_EN.pdf" download="Sports and Fitness I&M Guide"> 1383 <span>Sports and Fitness I&M Guide</span> 1384 </a> 1385 </li> 1386 </ul> 1387 </div> 1388 </div> 1389 1390 </div> 1391 </section> 1392 } 1393 1394 @{ 1395 List<ProductAsset> dwgAssets = new List<ProductAsset>(); 1396 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 1397 } 1398 1399 @if (dwgAssets.Count > 0) 1400 { 1401 @renderAccordianPanel(dwgAssets, "dwgs", "DWGFiles", "DWG Files", "", productNumber) 1402 } 1403 1404 1405 <section class="accordian print-hide"> 1406 <div class="wrapper"> 1407 <h3> 1408 <button id="accordian-downloads-general-info" 1409 aria-expanded="true" aria-controls="accordian-panel-downloads-general-info" 1410 type="button" class="accordian__button" 1411 data-action-page="Product" 1412 data-action-type="Text block expand" 1413 data-action-label="GeneralDownloads" 1414 data-action-value="@productNumber"> 1415 @Translate("GeneralInformation", "General Information") 1416 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 1417 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 1418 </button> 1419 </h3> 1420 1421 1422 <div class="accordian__panel" id="accordian-panel-downloads-general-info"> 1423 1424 <div class="accordian__content"> 1425 1426 <ul class="downloads__list"> 1427 @*@if (thisPage.AreaID == 2) 1428 {*@ 1429 <li> 1430 <a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_SE.pdf" download="" target="_blank"> 1431 <span>@Translate("GeneralInformation", "General Information") (SE)</span> 1432 </a> 1433 </li> 1434 <li> 1435 <a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_SE.pdf" download="" target="_blank"> 1436 <span>@Translate("TechnicalInformation", "Technical Information") (SE)</span> 1437 </a> 1438 </li> 1439 @*} 1440 else 1441 {*@ 1442 <li> 1443 <a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_EN.pdf" download="" target="_blank"> 1444 <span>@Translate("GeneralInformation", "General Information") (EN)</span> 1445 </a> 1446 </li> 1447 <li> 1448 <a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_EN.pdf" download="" target="_blank"> 1449 <span>@Translate("TechnicalInformation", "Technical Information") (EN)</span> 1450 </a> 1451 </li> 1452 @*}*@ 1453 </ul> 1454 1455 </div> 1456 </div> 1457 1458 </div> 1459 </section> 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 <section class="accordian de"> 1472 <div class="wrapper"> 1473 <h3> 1474 <button id="accordian-materials" aria-expanded="true" aria-controls="accordian-materials-panel" type="button" class="accordian__button"> 1475 Tender Text Request Form 1476 <span class="accordian__icon accordian__icon--close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--minus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm28.772 87.504a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-57a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h57Z"/></svg></span> 1477 <span class="accordian__icon accordian__icon--open" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" class="h24-icon h24-icon--plus"><path fill="currentColor" fill-rule="evenodd" d="M106 6c55.193 0 100 44.807 100 100s-44.807 100-100 100S6 161.193 6 106 50.807 6 106 6Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C21.936 56.207 11.333 79.875 11.333 106c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C155.793 21.936 132.125 11.333 106 11.333Zm.772 59.504a6.5 6.5 0 0 1 6.5 6.5v21.5h21.5a6.5 6.5 0 0 1 6.5 6.5v1a6.5 6.5 0 0 1-6.5 6.5h-21.5v21.5a6.5 6.5 0 0 1-6.5 6.5h-1a6.5 6.5 0 0 1-6.5-6.5v-21.5h-21.5a6.5 6.5 0 0 1-6.5-6.5v-1a6.5 6.5 0 0 1 6.5-6.5h21.5v-21.5a6.5 6.5 0 0 1 6.5-6.5h1Z"/></svg></span> 1478 </button> 1479 </h3> 1480 <div class="accordian__panel" id="accordian-materials-panel"> 1481 <div class="accordian__content tender-request"> 1482 <form method="post" action="/de/contact/tender-text-thank-you" enctype="multipart/form-data" class="m-form-contact col-sm-8 col-sm-push-2" id="dw-form-48" onsubmit="s=function(e){e.elements['FormCH1_h'].value='a4157f9c59bad4b59c0d66f8b9308194';e.elements['_sys_to_email'].value='';e.setAttribute('action', '/Default.aspx?ID=20057&amp;PID=139114');return true};return s(this);"> 1483 <input type="hidden" name="FormPID" value="139114"> 1484 <input type="hidden" name="FormID" value="48"> 1485 <input type="hidden" name="cmd" value="save"> 1486 <input type="hidden" name="_sys_to_email" value="info@hags.de" autocomplete="off"> 1487 <input type="hidden" name="FormCH1_h" value="" autocomplete="off"> 1488 <input type="hidden" name="FormCH1_f" value="64fcc853b5c7478097280b67d065e694" autocomplete="off"> 1489 <input type="hidden" name="FormCH1_s" value="c4c181d67b4102728a5096ecf8c1929c" autocomplete="off"> 1490 <input type="hidden" name="FormCH1_i" value="6aa5213c54c120933c90ee6f0b7dd4dc" autocomplete="off"> 1491 <input type="hidden" name="a4157f9c59bad4b59c0d66f8b9308194ts" value="E1WX2koSJVNXmGFR8goSJnCuchPB6aG0" style="display:none!important" autocomplete="off"> 1492 <input type="text" name="a4157f9c59bad4b59c0d66f8b9308194description" value="" style="display:none!important" autocomplete="off"> 1493 <input type="text" name="a4157f9c59bad4b59c0d66f8b9308194email" value="mrssmith@dynamicweb.com" style="display:none!important" autocomplete="off"> 1494 <table class="formtable"> 1495 <tbody> 1496 <tr class="labelRow" style="padding-bottom:12px;display:block;"> 1497 <td class="labelCell"> 1498 <p>Complete form form below to request the the relevant product tender text</p> 1499 </td> 1500 </tr> 1501 <tr class="labelRow"> 1502 <td class="labelCell"> 1503 <label for="ArticleNumber"><h6>Article Number: @productNumber</h6></label> 1504 </td> 1505 </tr> 1506 <tr class="labelRow"> 1507 <td class="labelCell"> 1508 <label for="FirstName">First Name </label> 1509 </td> 1510 </tr> 1511 <tr class="fieldRow"> 1512 <td> 1513 <input type="text" id="FirstName" name="FirstName" required="" /></td> 1514 </tr> 1515 <tr class="descriptionRow"> 1516 <td class="descriptionCell"><small></small></td> 1517 </tr> 1518 <tr class="labelRow"> 1519 <td class="labelCell"> 1520 <label for="LastName">Last Name </label> 1521 </td> 1522 </tr> 1523 <tr class="fieldRow"> 1524 <td><input type="text" id="LastName" name="LastName" required="" /></td> 1525 </tr> 1526 <tr class="descriptionRow"> 1527 <td class="descriptionCell"><small></small></td> 1528 </tr> 1529 <tr class="labelRow"> 1530 <td class="labelCell"> 1531 <label for="Email">Email </label> 1532 </td> 1533 </tr> 1534 <tr class="fieldRow"> 1535 <td><input type="email" id="Email" name="Email" required="" /></td> 1536 </tr> 1537 <tr class="descriptionRow"> 1538 <td class="descriptionCell"><small></small></td> 1539 </tr> 1540 <tr class="labelRow"> 1541 <td class="labelCell"> 1542 <label for="Company">Company </label> 1543 </td> 1544 </tr> 1545 <tr class="fieldRow"> 1546 <td><input type="text" id="Company" name="Company" required="" /></td> 1547 </tr> 1548 <tr class="descriptionRow"> 1549 <td class="descriptionCell"><small></small></td> 1550 </tr> 1551 <tr class="labelRow"> 1552 <td class="labelCell"> 1553 <label for="ArticleNumber">Article Number </label> 1554 </td> 1555 </tr> 1556 <tr class="fieldRow"> 1557 <td style="width:100%;display:block;"><input type="text" id="ArticleNumber" name="ArticleNumber" value="@productNumber" style="width:100%;display:block;"></td> 1558 </tr> 1559 <tr class="descriptionRow"> 1560 <td class="descriptionCell"><small></small></td> 1561 </tr> 1562 <tr class="fieldRow"> 1563 <td><input type="submit" id="SendRequest" name="SendRequest" value="Submit" class="submit" /></td> 1564 </tr> 1565 <tr class="descriptionRow"> 1566 <td class="descriptionCell"><small></small></td> 1567 </tr> 1568 </tbody> 1569 </table> 1570 <input type="hidden" name="SendRequest" value="Submit" /> 1571 </form> 1572 </div> 1573 </div> 1574 </div> 1575 </section> 1576 @*IncludeFile("partials/add-to-collection.cshtml")*@ 1577 </div> 1578 1579 </div> 1580 </div> 1581 </section> 1582 1583 <script type="text/javascript"> 1584 var __ss_noform = __ss_noform || []; 1585 __ss_noform.push(['baseURI', 'https://app-3QNUK2ISME.marketingautomation.services/webforms/receivePostback/MzawMLE0MzQ3BgA/']); 1586 __ss_noform.push(['endpoint', 'f1f4eefa-cc8e-4621-a197-e153223a10a6']); 1587 </script><script type="text/javascript" src="https://koi-3QNUK2ISME.marketingautomation.services/client/noform.js?ver=1.24" ></script> 1588 1589 <div class="center-copy contact"> 1590 1591 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 1592 { 1593 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.AreaID); 1594 <p class="print-hide call-out"><span>@Translate("ContactUs", "Contact Us") <a href="@contactUsLink">@Translate("ContactForm", "Contact Form")</a></span></p> 1595 } 1596 </div> 1597 1598 1599 1600 <form id="product-hidden-fields"> 1601 <input type="hidden" id="productVariantId" value="@GetString("Ecom:Product.VariantID")"> 1602 <input type="hidden" id="productCollectionData" value="@collectionData"> 1603 </form> 1604 1605 1606 <section class="print-hide flow section-bg-light products-variants"> 1607 1608 @if (GetLoop("VariantCombinations").Count() > 0) 1609 { 1610 <div class="wrapper flow"> 1611 <h5>@Translate("ProductOptions", "Product Options") (<span id="resultCount">@GetLoop("VariantCombinations").Count()</span>)</h5> 1612 1613 1614 <form class="form-inline"> 1615 <div id="filter-variants" class="cluster"> 1616 1617 @if (anchoringOptions.Results.Count() > 0) 1618 { 1619 <div class="form-group"> 1620 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 1621 <select class="form-control variant-filter" id="filter-anchoring" name="anchoring" 1622 data-action-page="product" data-action-type="Variant filter" 1623 data-action-label="Anchoring" data-action-value="@productNumber"> 1624 1625 @if (anchoringOptions.Results.Count() > 1) 1626 { 1627 <option value="any">@Translate("Any", "Any")</option> 1628 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 1629 { 1630 <option value="@anchor.Value">@anchor.Name</option> 1631 } 1632 } 1633 else 1634 { 1635 ResultField result = anchoringOptions.Results.FirstOrDefault(); 1636 <option value="any">@Translate("Any", "Any")</option> 1637 <option value="@result.Value">@result.Name</option> 1638 } 1639 1640 </select> 1641 </div> 1642 } 1643 1644 @if (colourOptions.Results.Count() > 0) 1645 { 1646 <div class="form-group"> 1647 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 1648 <select class="form-control variant-filter" id="filter-colour" name="colour" 1649 data-action-page="product" data-action-type="Variant filter" 1650 data-action-label="Colour" data-action-value="@productNumber"> 1651 1652 @if (colourOptions.Results.Count() > 1) 1653 { 1654 <option value="any">@Translate("Any", "Any")</option> 1655 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 1656 { 1657 <option value="@colour.Value">@colour.Name</option> 1658 } 1659 } 1660 else 1661 { 1662 ResultField result = colourOptions.Results.FirstOrDefault(); 1663 <option value="@result.Value">@result.Name</option> 1664 } 1665 </select> 1666 </div> 1667 } 1668 1669 @if (optionOptions.Results.Count() > 0) 1670 { 1671 <div class="form-group"> 1672 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 1673 <select class="form-control variant-filter" id="filter-options" name="options" 1674 data-action-page="product" data-action-type="Variant filter" 1675 data-action-label="Options" data-action-value="@productNumber"> 1676 1677 @if (optionOptions.Results.Count() > 1) 1678 { 1679 <option value="any">@Translate("Any", "Any")</option> 1680 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 1681 { 1682 <option value="@option.Value">@option.Name</option> 1683 } 1684 } 1685 else 1686 { 1687 ResultField result = optionOptions.Results.FirstOrDefault(); 1688 <option value="@result.Value">@result.Name</option> 1689 } 1690 </select> 1691 </div> 1692 } 1693 1694 </div> 1695 </form> 1696 1697 1698 </div> 1699 1700 <div class="wrapper"> 1701 <div class="grid" id="variants-list"> 1702 1703 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1704 { 1705 var colourOption = string.Empty; 1706 var optionOption = string.Empty; 1707 var anchorOption = string.Empty; 1708 var materialOption = string.Empty; 1709 var colourId = string.Empty; 1710 var optionId = string.Empty; 1711 var anchorId = string.Empty; 1712 var materialId = string.Empty; 1713 var selectedVariant = string.Empty; 1714 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1715 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1716 1717 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1718 { 1719 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1720 { 1721 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1722 { 1723 1724 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1725 { 1726 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1727 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1728 } 1729 1730 } 1731 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1732 { 1733 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1734 { 1735 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1736 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1737 } 1738 } 1739 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1740 { 1741 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1742 { 1743 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1744 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1745 } 1746 } 1747 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1748 { 1749 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1750 { 1751 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1752 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1753 } 1754 } 1755 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1756 { 1757 selectedVariant = "selected-variant"; 1758 } 1759 } 1760 1761 } 1762 1763 <div class="product-card @selectedVariant" data-filter-colour="@colourId" data-filter-anchoring="@anchorId" data-filter-options="@optionId"> 1764 1765 <div class="product-card__img-silo"> 1766 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1767 { 1768 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="product-card__img" /></a> 1769 } 1770 else 1771 { 1772 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="product-card__img" /> 1773 } 1774 </div> 1775 1776 1777 <div class="product-card__copy"> 1778 1779 @if (thisPage.AreaID == 7) /*UK*/ 1780 { 1781 string ukId = ProductFieldValues.GetUkProductNumber(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), thisPage.Area.EcomLanguageId); 1782 <h5 class="product-card__heading"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@ukId.ToString()</a></h5> 1783 } 1784 else 1785 { 1786 <h5 class="product-card__heading"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@variantCombinations.GetString("Ecom:VariantCombination.Product.Number")</a></h5> 1787 } 1788 1789 <p>@optionOption @colourOption - @anchorOption</p> 1790 1791 <!--<a class="" href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")" role="button">@Translate("ProductDetails", "Product Details")</a>--> 1792 </div> 1793 </div> 1794 1795 } 1796 </div> 1797 1798 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1799 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1800 </div> 1801 </div> 1802 1803 } 1804 </section> 1805 1806 @*IncludeFile("partials/related-products.cshtml")*@ 1807 1808 1809 1810 1811 1812 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1813 @using System.Collections.Generic 1814 @using HagsWeb.Library.BusinessObjects.UsersLists 1815 1816 @{ 1817 Layout = null; 1818 } 1819 <dialog id="CreateProductPdf" class="modal modal--full"> 1820 1821 <div class="modal__body"> 1822 1823 <div class="modal__header"> 1824 1825 <div class="modal__close"> 1826 <button type="button" class="action-btn js-modal-close-target" data-target-id="CreateProductPdf"> 1827 <span class="visually-hidden">Close</span> 1828 <svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg" class="h24-icon h24-icon--close"><path d="M100 0c55.193 0 100 44.807 100 100s-44.807 100-100 100S0 155.193 0 100 44.807 0 100 0Zm0 5.333c-26.124 0-49.792 10.603-66.928 27.74C15.936 50.207 5.333 73.875 5.333 100c0 26.124 10.603 49.792 27.74 66.928 17.135 17.136 40.803 27.739 66.927 27.739 26.124 0 49.792-10.603 66.928-27.74 17.136-17.135 27.739-40.803 27.739-66.927 0-26.124-10.603-49.792-27.74-66.928C149.793 15.936 126.125 5.333 100 5.333Zm25.105 78.865L110.17 99.664l15.466 14.935a6.5 6.5 0 0 1 .16 9.191l-.694.72a6.5 6.5 0 0 1-9.191.16l-15.466-14.935-14.935 15.466a6.5 6.5 0 0 1-9.191.16l-.72-.694a6.5 6.5 0 0 1-.16-9.191l14.935-15.466-15.466-14.935a6.5 6.5 0 0 1-.16-9.191l.694-.72a6.5 6.5 0 0 1 9.191-.16L100.1 89.939l14.935-15.466a6.5 6.5 0 0 1 9.191-.16l.72.694a6.5 6.5 0 0 1 .16 9.191Z" fill="currentColor" fill-rule="evenodd"/></svg> 1829 </button> 1830 </div> 1831 1832 1833 <h4 class="modal-title" id="CreateCatalogModalLabel"> 1834 @Translate("YourProductSheet", "Your Product Sheet") 1835 </h4> 1836 1837 </div> 1838 1839 <div class="modal__main"> 1840 1841 <div id="div_CreateCatalog" class="modal__product-pdf"> 1842 1843 <div id="pdfwaiting" style="display:block;text-align:center"> 1844 <span id="CreateProductPdfLabel" style="display: inline-block;margin: 10px 10px 0 0;padding: 5px 10px"></span> 1845 <img src="Files/Templates/Designs/HagsCore/res/img/loader/ajax-loader.gif" style="margin:auto;display:block;" /> 1846 </div> 1847 1848 <div id="productPdfViewerloader" class="modal__embed-silo"> 1849 </div> 1850 1851 <div id="CreatePdfMessage"></div> 1852 </div> 1853 1854 1855 </div> 1856 1857 <div class="modal__footer"> 1858 1859 <div class="m-search-advanced-buttons cluster cluster--dialog"> 1860 <a href="" class="btn btn--outline" id="pdfPrintSheet" target="_blank" type="button">@Translate("Print", "Print")</a> 1861 <a href="" class="btn btn--outline" id="pdfDownloadSheet" download type="button">@Translate("Download", "Download")</a> 1862 <button class="btn btn--outline js-modal-close-target" data-target-id="CreateProductPdf" type="button">@Translate("Close", "Close")</button> 1863 </div> 1864 1865 </div> 1866 1867 </div> 1868 1869 </dialog> 1870 @*ProductPdfHelper(productCollectionItems, GetString("Ecom:Product.LanguageID"))*@ 1871 1872

      Záruky

      Zistite, na čo sa vzťahuje poistenie.

      Sprievodca údržbou

      Ako sa starať o svoje výrobky.

      Možnosti farieb a ukotvenia

      Preskúmajte svoje možnosti.

      }