HAGS Connect

A brief block of introductory copy about HAGS Connect.

HAGS Connect Login
My Product Collection

To add a product simply click on Add to my collection on any product page. Once you have added products to a collection you will be able to print a product catalogue, download installation guides, images and DWG files or request a quote.

Error executing template "Designs/Hags2024/eCom/Product/Product.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_b121d2d654384cf7ab6df0913111af4b.<>c.<Execute>b__4_19(XElement dat) in B:\Projects\Hags_Dw915\Files\Templates\Designs\Hags2024\eCom\Product\Product.cshtml:line 768
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at CompiledRazorTemplates.Dynamic.RazorEngine_b121d2d654384cf7ab6df0913111af4b.Execute() in B:\Projects\Hags_Dw915\Files\Templates\Designs\Hags2024\eCom\Product\Product.cshtml:line 787
   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 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 Dynamicweb.Content.Items; 8 @using Dynamicweb.Ecommerce.Products; 9 @using HagsWeb.Library.Methods.AssetManager; 10 @using HagsWeb.Library.BusinessObjects.UsersLists; 11 @using HagsWeb.Library.Methods.AssetSearch; 12 @using HagsWeb.Library.Methods.Page; 13 @using HagsWeb.Library.Methods.ProductImages; 14 @using HagsWeb.Library.Methods.ProductProperties; 15 @using HagsWeb.Library.Methods.ProductFilter; 16 @using HagsWeb.Library.Services.IPService; 17 @using HagsWeb.Library.Services.FileSystemService; 18 @using HagsWeb.Library.Utilities; 19 @using HagsWeb.Library.State; 20 @using System.Text.RegularExpressions; 21 @using System.Text; 22 23 24 @* scripts required by this template - this snippet is rendered in the head tag of base.cshtml *@ 25 @SnippetStart("productScripts") 26 @* expand this for re-design debugging *@ 27 @* Scripts.Render("~/bundle/ProductFilter") *@ 28 29 @{ 30 string designBaseUrl = GetString("Template:DesignBaseUrl"); 31 } 32 33 <!--script type="text/javascript" src="@(designBaseUrl)assets/js/functions/variant-filter.js"></script--> 34 <script type="text/javascript" src="@(designBaseUrl)assets/js/functions/product-create-pdf.js"></script> 35 <script type="text/javascript" src="@(designBaseUrl)assets/js/libraries/wheel-zoom/wheel-zoom.min.js"></script> 36 37 <script> 38 $(document).ready(function () { 39 40 if ( typeof dataLayer != "undefined" ) { 41 42 $("#productDownloadButton").on("click", function () { 43 dataLayer.push({ 'event': 'product_download' }); 44 //console.log("download event"); 45 }); 46 $("#downloadImagesForm").on("submit", function () { 47 dataLayer.push({ 'event': 'image_download' }); 48 //console.log("image event"); 49 }); 50 $("#productSheetButton").on("click", function () { 51 dataLayer.push({ 'event': 'print_productsheet' }); 52 //console.log("sheet event"); 53 }); 54 $("a[data-addproductlist]").on("click", function () { 55 dataLayer.push({ 'event': 'add_to_collection' }); 56 //console.log("collection event"); 57 }); 58 59 } 60 61 }); 62 </script> 63 @SnippetEnd("productScripts") 64 65 @* for this page we don't want the header to be positioned over the content *@ 66 @*SnippetStart("headerClass")@("in-flow")@SnippetEnd("headerClass")*@ 67 68 @* all the product model query code - sets up the models and variables used in this template *@ 69 @{ 70 Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 71 Item areaItem = Item.GetItemById("Website_Settings", thisPage.Area.Item.Id); 72 string pageUrl = GetGlobalValue("Global:Request.Scheme") + "://" + GetGlobalValue("Global:Request.Host") + thisPage.SearchFriendlyUrl; 73 string themeTag = HagsPages.GetThemeByNavigationTag(GetGlobalValue("Global:Page.Top.ID")); // gets the page ID at the top of the tree this page sits on. 74 var siteSection = HagsPages.GetSiteSection(thisPage.AreaID, thisPage.ID); 75 string salesPhoneNumber = areaItem["Telephone"].ToString(); 76 77 string productNumber = GetString("Ecom:Product.Number"); // The Product NUMBER 78 //int areaId = GetGlobalValue("Global:Area.ID"); 79 80 string canonicalProductUrl = HagsWeb.Library.Utilities.DWUtilities.GetProductSearchResultUrl("ProductNumber=" + productNumber, false, "LANG1", thisPage.AreaID); 81 canonicalProductUrl = "<link rel=\"canonical\" href=\"" + canonicalProductUrl + "\" />"; 82 //override the canonical tag added by hagspages 83 Pageview.Meta.AddTag("customCan", canonicalProductUrl); 84 Pageview.Meta.Title = GetString("Ecom:Product.Name") + " | HAGS"; 85 86 string currentCulture = GetGlobalValue("Global:Area.LongLang"); //en-GB, sv-SE 87 string currentCountry = currentCulture.Substring(currentCulture.Length - 2); // GB, SE 88 string currentlanguage = currentCulture.Substring(0, 2); // en, sv "de";// 89 string ipPriceAllowed = string.Empty; 90 91 if (thisPage.AreaID == 2 || thisPage.AreaID == 7) // Sweden and UK 92 { 93 ipPriceAllowed = IPCheck.CountryPriceAllowed(currentCountry); //ZZZ,Hags_GB,Hags_SE and Hags_, Anon_GB, Anon_SE network range checker(Web.config) 94 } 95 96 IEnumerable<ProductAsset> assets = AssetManager_Repository.GetAssets(productNumber, AssetType.All, true); 97 IEnumerable<ProductAsset> allImages = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).ToList(); 98 99 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 100 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 101 102 // New sorting for Product Images, thumbs and hiResDownloads for Zoom Images 103 Tuple<SortedList<int, string[,]>, IEnumerable<ProductAsset>> mainProductImages = ProductImages.MarshallZoomImages(allImages, productNumber); 104 SortedList<int, string[,]> zoomList = mainProductImages.Item1; 105 IEnumerable<ProductAsset> hiResDownloads = mainProductImages.Item2; 106 107 108 // The users Product Collection in session 109 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 110 bool isProductCollection = productCollectionItems.Any(n => n.ProductNumber == productNumber); 111 112 // users Product Collection 113 string collectionData = string.Format("CCAddToMyLists={0}&CCAddToListVariantID={1}&CCAreaID={2}&CCAddToListCulture={3}&CCAddToListLanguageID={4}#{5}", 114 GetString("Ecom:Product.Number"), GetString("Ecom:Product.VariantID"), GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.LanguageID"), siteSection); 115 116 117 // New Age Ranges. Some Template Tags dont work very well in upgraded DW version 9.7.2 118 List<string> ageRanges = new List<string>(); 119 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AgeRange"))) 120 { 121 ageRanges = ProductAgeRanges.GetAgeRanges(GetString("Ecom:Product:Field.AgeRange"), GetString("Ecom:Product.LanguageID")); 122 } 123 124 // New Product Functions. Some Template Tags dont work very well in upgraded DW version 9.7.2 125 List<ResultField> productFunctions = new List<ResultField>(); 126 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductFunctions"))) 127 { 128 productFunctions = ProductFieldValues.GetProductFieldOptions(GetString("Ecom:Product:Field.ProductFunctions"), "ProductFunctions", GetString("Ecom:Product.LanguageID")); 129 } 130 131 // For filtering the variants of this product 132 ResultSet colourOptions = new ResultSet(); 133 ResultSet materialOptions = new ResultSet(); 134 ResultSet anchoringOptions = new ResultSet(); 135 ResultSet optionOptions = new ResultSet(); 136 137 138 string selectedColourVariant = string.Empty; 139 string selectedAnchoringVariant = string.Empty; 140 string selectedAnchoringVariantId = string.Empty; 141 string selectedAnchoringIcon = string.Empty; 142 string selectedMaterialVariant = string.Empty; 143 string selectedOptionVariant = string.Empty; 144 //List<VariantOption> selectedProductOptions = new List<VariantOption>(); 145 146 147 148 if (GetInteger("Ecom:Product.VariantCount") > 0) 149 { 150 foreach (var variantGroup in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) // Remove All Date Variants 151 { 152 int optionsCount = variantGroup.GetLoop("VariantAvailableOptions").Count(); 153 154 if (optionsCount > 0) 155 { 156 if (!string.IsNullOrEmpty("Ecom:Product.SelectedVariantComboID")) // optionsCount == 1 157 { 158 foreach (var availableOption in variantGroup.GetLoop("VariantAvailableOptions")) 159 { 160 161 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "S55") 162 { 163 colourOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 164 165 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 166 { 167 168 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 }); 169 170 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 171 { 172 selectedColourVariant = availableOption.GetString("Ecom:VariantOption.Name"); 173 } 174 } 175 } 176 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP1") 177 { 178 materialOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 179 180 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 181 { 182 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 }); 183 184 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 185 { 186 selectedMaterialVariant = availableOption.GetString("Ecom:VariantOption.Name"); 187 } 188 } 189 } 190 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP3") 191 { 192 anchoringOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 193 194 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 195 { 196 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 }); 197 198 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 199 { 200 selectedAnchoringVariant = availableOption.GetString("Ecom:VariantOption.Name"); 201 selectedAnchoringVariantId = availableOption.GetString("Ecom:VariantOption.ID"); 202 selectedAnchoringIcon = availableOption.GetString("Ecom:VariantOption.ID") + ".png"; 203 } 204 } 205 } 206 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP4") 207 { 208 optionOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 209 210 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 211 { 212 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 }); 213 214 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 215 { 216 selectedOptionVariant = availableOption.GetString("Ecom:VariantOption.Name"); 217 } 218 } 219 220 } 221 } 222 } 223 } 224 } 225 } 226 227 228 string assemblyInstructionsProductNumber = productNumber; 229 230 // 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 231 // Assembly Instructions 232 Product product = new ProductService().GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), GetString("Ecom:Product.LanguageID")); 233 234 // Check if its a Master product. 235 if (!product.IsVariantMaster) 236 { 237 assemblyInstructionsProductNumber = new ProductService().GetProductsAndVariantsByProduct(product) 238 .FirstOrDefault<Product>(n => string.IsNullOrEmpty(n.VariantId)).Number; 239 } 240 241 // Check if its a Master product. 242 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 243 244 //Tuple<string, string, string, string, string> optionsTuple; 245 string VariantId = string.Empty; 246 if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || !string.IsNullOrEmpty(GetString("Ecom:Product.ProductDefaultVariantComboId")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductVariantFallback"))) 247 { 248 VariantId = string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) ? GetString("Ecom:Product.ProductDefaultVariantComboId") : GetString("Ecom:Product.VariantID"); 249 250 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 251 if (string.IsNullOrEmpty(VariantId)) 252 { 253 VariantId = GetString("Ecom:Product:Field.ProductVariantFallback"); 254 } 255 256 //optionsTuple = ProductFieldValues.GetProductOptions(VariantId, GetString("Ecom:Product.LanguageID")); 257 258 //selectedColourVariant = optionsTuple.Item1; 259 //selectedAnchoringVariant = optionsTuple.Item2; 260 //selectedMaterialVariant = optionsTuple.Item3; 261 //selectedOptionVariant = optionsTuple.Item4; 262 //selectedAnchoringIcon = optionsTuple.Item5; 263 //selectedProductOptions = optionsTuple.Item6; // used to filter related products by the variant values of this product 264 265 } 266 267 // Related Products and their Assembly Instructions 268 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 269 List<Product> relatedComponentProducts = new List<Product>(); 270 List<ProductAsset> relatedProductsAssemblyInstructions = new List<ProductAsset>(); 271 272 string variantOptions = selectedMaterialVariant + " " + selectedAnchoringVariant + " " + selectedOptionVariant + " " + selectedColourVariant; 273 274 if (GetInteger("Ecom:Product.RelatedCount") > 0) 275 { 276 // Play Functions // 277 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 278 { 279 relatedProducts = ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), VariantId, "Product Modules", GetString("Ecom:Product.LanguageID")); 280 } 281 282 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Components") != null) 283 { 284 relatedComponentProducts = ProductFilter.GetRelatedProducts(assemblyInstructionsProductNumber, VariantId, "Product Components", GetString("Ecom:Product.LanguageID")); 285 //// Lookup Assembly Instructions Assets 286 foreach (Product relatedComponentProduct in relatedComponentProducts) 287 { 288 if (relatedComponentProduct != null) 289 { 290 List<ProductAsset> productAssemblyInstructions = AssetManager_Repository.GetAssets(relatedComponentProduct.Number, AssetType.AssemblyInstructions, true); 291 if (productAssemblyInstructions.Any()) 292 { 293 //List<ProductAsset> result = productAssemblyInstructions.Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName == pa.FileName)).ToList(); 294 List<ProductAsset> result = productAssemblyInstructions 295 .Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName.Substring(8, pa2.FileName.Length - 8) == pa.FileName.Substring(8, pa.FileName.Length - 8))).ToList(); 296 result.ForEach(n => n.RelatedProduct = productNumber); 297 relatedProductsAssemblyInstructions.AddRange(result); 298 } 299 } 300 } 301 } 302 } 303 } 304 305 @* these contain helpers for rendering futher down the page *@ 306 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 307 @using Dynamicweb.Rendering; 308 @using System; 309 @using System.Web; 310 @using System.Collections.Generic; 311 @using System.Linq; 312 @using Ionic.Zip; 313 @using System.IO; 314 @using System.Threading; 315 316 @helper GetButton(List<string> files, string sender) 317 { 318 var request = HttpContext.Current.Request.Form; 319 var response = HttpContext.Current.Response; 320 321 if (!string.IsNullOrEmpty(request["ProductNumber"])) 322 { 323 // Currently only used for Product Image download on results page - see also GetDownload.cshtml 324 // To do KOD extract this into a service in Library, also consider Hags\Application\Ajax\UsersProductCollection\UsersProductCollection.aspx.cs(398) 325 if ( files.Any() ) 326 { 327 try 328 { 329 var zipArchives = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Zips"); 330 var transferFolder = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Transfers"); 331 332 // empty the zipArchives folder of zips that are 30 mins old (if any) 333 var oldZips = new DirectoryInfo(zipArchives).EnumerateFiles().Where(f => f.CreationTime < DateTime.Now.AddMinutes(-30)).ToList(); 334 oldZips.ForEach(f => f.Delete()); 335 336 DirectoryInfo Folder = new DirectoryInfo(transferFolder); 337 // Occasionally some files are read only and cannot be deleted so change all files, remove readonly before the delete 338 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 339 Directory.EnumerateFiles(transferFolder).ToList().ForEach(f => System.IO.File.Delete(f)); 340 341 // copy the selected files to the transferFolder and change from ReadOnly to try to prevent access to the path is denied error 342 files.ForEach(f => System.IO.File.Copy(f, Path.Combine(transferFolder, Path.GetFileName(f)), true)); 343 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 344 345 // Set up our new zip folder 346 var downloadFileName = string.Format(request["ProductNumber"] +"_"+ request["ProductName"] +"_Bilder {0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 347 // var downloadFileName = string.Format("Hags_Download_Pack-{0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 348 349 //var zipLocationUrl = "Files/System/UserDownloads/Zips/" + downloadFileName; // Use this to return a link to the folder saved to disk 350 351 HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; // Important - as is AppendHeader, not AddHeader 352 HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 353 354 using (var zip = new ZipFile()) 355 { 356 List<string> fileList = Directory.EnumerateFiles(transferFolder).ToList(); 357 //zip.AddDirectoryByName(subfolderName); 358 foreach (string file in fileList) 359 { 360 zip.AddFile(file, string.Empty); 361 } 362 363 // Save to the OutputStream 364 zip.Save(HttpContext.Current.Response.OutputStream); 365 // Or save the file to the file system using TransmitFile to stream the file without storing to memory 366 //zip.Save(zipArchives + "/" + downloadFileName); 367 } 368 369 // Transmit a file that was created on disk 370 //HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; 371 //HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 372 //HttpContext.Current.Response.TransmitFile(zipArchives + "/" + downloadFileName); 373 374 375 376 } 377 catch (ZipException ze) 378 { 379 string message = ze + "ProductDownload/GetDownloadButton.cshtml ZipException download file error (" + sender + ") - Original File Count: " + files.Count() + "InnerEx: " + ze.InnerException + ""; 380 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 381 log.Info(message); 382 } 383 catch (System.IO.FileNotFoundException notFoundEx) 384 { 385 string message = notFoundEx + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + notFoundEx.Message + " - The File: " + notFoundEx.FileName +""; 386 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 387 log.Info(message); 388 } 389 catch (ThreadAbortException) 390 { 391 // A normal Thread abort after HttpContext.Current.Response.End(); we dont record it 392 } 393 catch (Exception ex) 394 { 395 string message = ex + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + ex.Message + " - The Inner Ex: " + ex.InnerException + ""; 396 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 397 log.Info(message); 398 } 399 finally 400 { 401 HttpContext.Current.Response.End(); 402 } 403 404 } 405 } 406 else 407 { 408 string buttonCaption = string.Empty; 409 if (sender == "Product") 410 { 411 buttonCaption = Translate("ImageDownloads", "Image Downloads"); 412 } 413 if (sender == "AdvancedSearch") 414 { 415 buttonCaption = Translate("DownloadAll", "Download All"); 416 } 417 418 <button class="images-form btn btn--outline" role="button"> 419 @buttonCaption 420 </button> 421 } 422 } 423 424 425 426 @helper renderPageBreadcrumb(string thisUrl, string currentCulture, string productName, string variantOptions) { 427 428 string[] segments = Array.Empty<string>(); 429 Uri uri = new Uri(thisUrl); 430 if (uri.IsWellFormedOriginalString()) 431 { 432 segments = uri.Segments; 433 } 434 435 @* set up this so we can use it's title case method *@ 436 TextInfo thisTextInfo = new CultureInfo(currentCulture,false).TextInfo; 437 438 string first = segments.FirstOrDefault(); 439 string last = segments.LastOrDefault(); 440 441 if (!string.IsNullOrEmpty(productName)) 442 { 443 string stripSpaces = Regex.Replace(productName, @"\s+", " "); // some product names may have 2 or 3 spaces in them 444 productName = stripSpaces.Replace(" ", "-").ToLower(); 445 } 446 447 string concat = string.Empty; 448 449 StringBuilder sb = new StringBuilder(); 450 sb.Append("<ul class=\"product-nav product-nav--arrows\" role=\"list\">"); 451 452 453 foreach (var item in segments.Select((value,i)=>new{i,value})) 454 { 455 var index = item.i; 456 if (true) 457 { 458 string linkText = item.value.Replace("/",""); 459 concat += item.value; 460 461 if (segments.Length <= 2) // A shorthand URL like www.hags.com/hags-dragonfly or www.hags.de/hags-dragonfly 462 { 463 sb.Append("<li>" + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</li>"); 464 } 465 // Request from the Product List with no Product Name 466 else if (item.value.Equals(last, StringComparison.CurrentCultureIgnoreCase) && string.IsNullOrEmpty(productName)) 467 { 468 sb.Append("<li><a href='" + concat + "' class=''> " + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 469 break; 470 } 471 // will be either the master product or the variant 472 else if (item.value.Equals(last, StringComparison.CurrentCultureIgnoreCase) && !item.value.Equals(productName, StringComparison.CurrentCultureIgnoreCase)) 473 { 474 linkText = variantOptions.Trim().Replace("Not applicable", "").ToLower(); 475 476 477 sb.Append("<li><a href='" + concat + "' class=''> " + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 478 } 479 else if (index == 2) 480 { 481 sb.Append("<li><a href='" + concat + "' class=''>Home</a></li>"); 482 } else if ( index > 2 ) { 483 sb.Append("<li><a href='" + concat + "' class=''>" + thisTextInfo.ToTitleCase(linkText.Replace("-", " ")) + "</a></li>"); 484 } 485 } 486 } 487 488 sb.Append("</ul>"); 489 490 @(sb.ToString()) 491 } 492 493 <article class="flow"> 494 495 <nav class="breadcrumb"> 496 <div class="wrapper"> 497 @renderPageBreadcrumb(pageUrl, GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.Name"), variantOptions) 498 </div> 499 </nav> 500 501 502 <section class="product-header"> 503 504 <div class="wrapper flow"> 505 <h1>@GetString("Ecom:Product.Name")</h1> 506 @if (GetBoolean("Ecom:Product:Field.CentralStock")) 507 { 508 <p class="product-number">@productNumber-2</p> 509 } 510 else 511 { 512 <p class="product-number">@productNumber</p> 513 } 514 515 </div> 516 517 <div class="wrapper"> 518 519 <div class="fc-zoom"> 520 @*Zoom Product Images*@ 521 @if (zoomList.Count > 0) 522 523 { 524 <div class="fc-zoom__view"> 525 <div class="fc-zoom__target" id="zoom-target-1"> 526 @{ 527 var i = 0; 528 string resizeUrl = "/Admin/Public/GetImage.ashx?Image="; 529 string resizeOptions = "&Crop=0&Format=jpg&Height=350&Compression=75"; 530 } 531 @foreach (var zoomSet in zoomList) 532 { 533 string[,] imgSet = zoomSet.Value; 534 string imgId = string.Format("img_0{0}", zoomSet.Key); 535 string imageUrl = resizeUrl + imgSet[0, 2] + resizeOptions; 536 537 538 if (i == 0) 539 { 540 541 <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")"> 542 } 543 else 544 { 545 <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")"> 546 } 547 i++; 548 } 549 </div> 550 551 <button class="fc-zoom__button fc-zoom__button--in reel-cards__btn" id="zoom-toggle"> 552 <span class="visually-hidden">Toggle Zoom</span> 553 <span class="fc-zoom__icon fc-zoom__icon--in"> 554 <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> 555 </span> 556 <span class="fc-zoom__icon fc-zoom__icon--out"> 557 <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> 558 </span> 559 </button> 560 </div> 561 562 <div class="reel-thumbs fc-zoom__thumbs" id="zoom-gallery"> 563 564 <button class="reel-cards__btn reel-cards__btn--prev"> 565 <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> 566 <span class="visually-hidden">@Translate("page_Previous", "Previous")</span> 567 </button> 568 569 <div class="reel-thumbs__viewport"> 570 571 <div class="fc-zoom__thumbs-list reel-thumbs__container"> 572 @{ i = 0; } 573 @foreach (var zoomSet in zoomList) 574 { 575 string[,] imgSet = zoomSet.Value; 576 string imgId = string.Format("img_0{0}", zoomSet.Key); 577 <div class="reel-thumbs__frame"> 578 <a class="fc-zoom__link" href="@imgSet[0, 1]" data-image-target="zoom-full-image-@i" data-image="" data-zoom-image="@imgSet[0, 2]"> 579 <img class="fc-zoom__thumb" src="@imgSet[0, 0]" alt="@GetString("Ecom:Product.Name")"> 580 </a> 581 </div> 582 i++; 583 584 } 585 </div> 586 587 </div> 588 589 <button class="reel-cards__btn reel-cards__btn--next"> 590 <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> 591 <span class="visually-hidden">@Translate("page_Next", "Next")</span> 592 </button> 593 594 595 596 </div> 597 } 598 </div> 599 600 601 </section> 602 603 604 <div class="page-intro wrapper"> 605 606 <div class="page-intro__copy flow"> 607 608 <div class="cluster"> 609 @* add to collection button *@ 610 @if (isProductCollection) 611 { 612 <button type="button" class="btn btn--outline print-hide" data-removeproductlist="@productNumber" data-addproductlist=""> 613 @Translate("RemoveFromCollection", "Remove from my Collection") 614 </button> 615 } 616 else 617 { 618 <button type="button" class="btn btn--outline print-hide" data-removeproductlist="" data-addproductlist="@collectionData"> 619 @Translate("AddToCollection", "Add to my collection") 620 </button> 621 } 622 623 @* download images button *@ 624 @if (hiResDownloads.Count() > 0) 625 { 626 List <string> fileList = new List<string>(); 627 foreach (var file in hiResDownloads) 628 { 629 fileList.Add(file.FullPath); 630 } 631 <form method="post" id="downloadImagesForm"> 632 <input type="hidden" name="ProductNumber" value="@productNumber" /> 633 <input type="hidden" name="ProductName" value="@GetString("Ecom:Product.Name")" /> 634 @GetButton(fileList, "Product") 635 </form> 636 } 637 638 @* PDF Product sheet button *@ 639 @{ 640 string printShout = Translate("SaveOrPrint", "Save or Print your Product PDF "); 641 string productId = @GetString("Ecom:Product.ID"); 642 string productVariantId = @GetString("Ecom:Product.VariantID"); 643 } 644 <button type="button" id="productSheetButton" data-target="#CreateProductPdf" 645 name="productPublishing" data-productid="@productId" data-productnumber="@productNumber" 646 data-variantid="@productVariantId" data-open-modal="#CreateProductPdf" data-request="technicalsheet" data-shout="@printShout" class="btn btn--outline"> 647 @Translate("ProductSheet", "PDF Product Sheet") 648 </button> 649 650 651 </div> 652 653 @*if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.ShortDescription"))) 654 { 655 <p>@GetString("Ecom:Product.ShortDescription")</p> 656 } 657 *@ 658 659 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.LongDescription"))) 660 { 661 @* 662 string paragraph = GetString("Ecom:Product.LongDescription"); 663 string[] paragraphs = paragraph.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries); 664 foreach (var p in paragraphs) 665 { 666 <p>@p.Trim().</p> 667 } 668 *@ 669 <p>@GetString("Ecom:Product.LongDescription")</p> 670 671 } 672 673 <div class="cluster" title="@Translate(" Anchoring", "Anchoring"): @selectedAnchoringVariant"> 674 675 @if (GetBoolean("Ecom:Product:Field.CentralStock")) 676 { 677 <div class="product-icon" title="Leverans ex lager från Sverige"> 678 <img class="product-icon__icon" src="/Files/Images/Other/Playground box/Lorry.jpg" alt="Leverans ex lager från Sverige" /> 679 <p>@Translate("CentralStock", "Central Stock")</p> 680 </div> 681 } 682 683 @if (!string.IsNullOrWhiteSpace(selectedAnchoringIcon ?? selectedAnchoringVariant)) 684 { 685 686 <div class="product-icon"> 687 <img class="product-icon__icon" src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" /> 688 @selectedAnchoringVariant 689 </div> 690 } 691 692 </div> 693 694 <p> 695 @(selectedMaterialVariant != "" ? selectedMaterialVariant + " - " : "") 696 @(selectedOptionVariant != "" ? selectedOptionVariant + " - " : "") 697 @(@selectedColourVariant != "" ? selectedColourVariant : "") 698 </p> 699 700 </div> 701 </div> 702 703 704 705 <section> 706 <div class="wrapper"> 707 708 <div class="center-copy"> 709 710 @{ 711 string[] badges = GetString("Ecom:Product:Field.EnvironmentalBadge.Value").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); 712 } 713 <div> 714 <ul class="badges"> 715 @foreach (var badge in badges) 716 { 717 string altText = ""; 718 719 if ( badge == "BVB8" ) { 720 altText = Translate("BVBGradeAccepted", "Assessed by Byggvarubedömningen, Grade: Accepted"); 721 } 722 723 if ( badge == "BVB7" ) { 724 altText = Translate("BVBGradeRecommended", "Assessed by Byggvarubedömningen, Grade: Recommended"); 725 } 726 727 if ( badge == "SH1" ) { 728 altText = Translate("SundaHusGradeB", "Assessed by SundaHus, Grade: B"); 729 } 730 731 if ( badge == "SH2" ) { 732 altText = Translate("SundaHusGradeA", "Assessed by SundaHus, Grade: A"); 733 } 734 <li class="badges__item"><img src="@(designBaseUrl)assets/img/badges/@(badge).png" alt="@altText" title="@altText" /></li> 735 } 736 </ul> 737 </div> 738 739 <div class="accordians"> 740 741 <section class="accordian"> 742 <div class="wrapper"> 743 744 <h3><button id="accordian-spec" aria-expanded="true" aria-controls="accordian-spec-panel" type="button" class="accordian__button"> 745 @Translate("ProductSpecifications", "Product Specifications") 746 <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> 747 <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> 748 </button> 749 </h3> 750 751 <div class="accordian__panel" id="accordian-spec-panel"> 752 <div class="accordian__content flow"> 753 754 @if (!String.IsNullOrWhiteSpace(@GetString("Ecom:Product:Field.IPEMA_Specification"))) 755 { 756 string ipemaData = GetString("Ecom:Product:Field.IPEMA_Specification"); 757 // Get IPEMA Product Specification data from a Field on the Product data from Jeeves 758 //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")); 759 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(ipemaData); 760 761 if (dataXML != null) 762 { 763 @*<h1> @GetString("Ecom:Product.Name") </h1>*@ 764 @*<p>@dataXML</p>*@ 765 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 766 767 var details = from dat in dataXML.Descendants("Item") 768 select new 769 { 770 name = dat.Element("name").Value, 771 enValue = dat.Element("EN_value").Value, 772 astmValue = dat.Element("ASTM_value").Value, 773 csaValue = dat.Element("CSA_value").Value 774 }; 775 776 <table class="table"> 777 <thead> 778 <tr> 779 <th scope="col"></th> 780 <th scope="col">@Translate("Europe","Europe")<br>EN1176</th> 781 <th scope="col">@Translate("USA", "USA")<br>ASTM F1487</th> 782 <th scope="col">@Translate("Canada", "Canada")<br>CSA Z614</th> 783 </tr> 784 </thead> 785 786 <tbody> 787 @foreach (var item in details) 788 { 789 <tr> 790 <td>@item.name</td> 791 <td>@item.enValue</td> 792 <td>@item.astmValue</td> 793 <td>@item.csaValue</td> 794 </tr> 795 } 796 </tbody> 797 </table> 798 799 @*#table-IPEMA Product Spec*@ 800 } 801 802 } else { 803 <table class="table"> 804 <thead> 805 <tr> 806 <th scope="col"></th> 807 <th scope="col"></th> 808 </tr> 809 </thead> 810 <tbody> 811 812 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.NumberOfChildren"))) 813 { 814 <tr> 815 <td>@GetString("Ecom:Product:Field.NumberOfChildren.Name")</td> 816 <td>@GetString("Ecom:Product:Field.NumberOfChildren.Value")</td> 817 </tr> 818 } 819 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 820 { 821 <tr> 822 <td>@GetString("Ecom:Product:Field.AgeRange.Name")</td> 823 <td>@string.Join(", ", ageRanges)</td> 824 </tr> 825 } 826 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 827 { 828 <tr> 829 <td>@GetString("Ecom:Product:Field.AssemblyTime.Name")</td> 830 <td>@GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") @Translate("Hours", "hours")</td> 831 </tr> 832 } 833 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 834 { 835 <tr> 836 <td>@GetString("Ecom:Product:Field.Length.Name").Replace(" (mm)", "")</td> 837 <td>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</td> 838 </tr> 839 } 840 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 841 { 842 <tr> 843 <td>@GetString("Ecom:Product:Field.Width.Name").Replace(" (mm)", "")</td> 844 <td>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</td> 845 </tr> 846 } 847 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 848 { 849 <tr> 850 <td>@GetString("Ecom:Product:Field.Height.Name").Replace(" (mm)", "")</td> 851 <td>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</td> 852 </tr> 853 } 854 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 855 { 856 <tr> 857 <td>@GetString("Ecom:Product:Field.NetWeight.Name")</td> 858 <td>@GetString("Ecom:Product:Field.NetWeight.Value") kg</td> 859 </tr> 860 } 861 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 862 { 863 <tr> 864 <td>@GetString("Ecom:Product:Field.Volume.Name")</td> 865 <td>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</td> 866 </tr> 867 } 868 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 869 { 870 <tr> 871 <td>@GetString("Ecom:Product:Field.FallHeight.Name").Replace(" (mm)", "")</td> 872 <td>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</td> 873 </tr> 874 } 875 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 876 { 877 <tr> 878 <td>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name").Replace(" (mm)", "")</td> 879 <td>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</td> 880 </tr> 881 } 882 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 883 { 884 <tr> 885 <td>@GetString("Ecom:Product:Field.SafetyAreaLength.Name").Replace(" (mm)", "")</td> 886 <td>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</td> 887 </tr> 888 } 889 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 890 { 891 <tr> 892 <td>@GetString("Ecom:Product:Field.SafetyArea.Name")</td> 893 <td>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</td> 894 </tr> 895 } 896 897 </tbody> 898 </table> 899 900 } 901 902 @*SafetyAreaDetails*@ 903 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value") > 0 && thisPage.AreaID == 1) 904 { 905 string safetyAreaPage = DWUtilities.GetPageByNavigationTag("SafetyArea", thisPage.AreaID); 906 if (!string.IsNullOrEmpty(safetyAreaPage)) 907 { 908 <p><a href="@safetyAreaPage" class="print-hide">@Translate("ReadMoreSafetyArea", "Read more about safety areas")</a></p> 909 } 910 911 } 912 913 @*Anchoring from Variant*@ 914 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 915 { 916 string anchoringPage = DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.AreaID) + "#" + GetGlobalValue("Global:HagsTheme"); 917 918 if (!string.IsNullOrEmpty(anchoringPage)) 919 { 920 <p><a href="@anchoringPage" class="btn btn--outline print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a></p> 921 } 922 923 } 924 925 @*Guarantee Page for Sweden*@ 926 @if (thisPage.AreaID == 2) 927 { 928 <p><a href="/sv-se/om-hags/garantier" target="_blank" class="print-hide">Läs mer om produktgarantier</a></p> 929 } 930 </div> 931 </div> 932 </section> 933 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Material"))) 934 { 935 <section class="accordian"> 936 <div class="wrapper"> 937 938 <h3> 939 <button id="accordian-materials" aria-expanded="true" aria-controls="accordian-materials-panel" type="button" class="accordian__button"> 940 @GetString("Ecom:Product:Field.Material.Name") 941 <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> 942 <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> 943 </button> 944 </h3> 945 946 <div class="accordian__panel" id="accordian-materials-panel"> 947 <div class="accordian__content"> 948 949 @{ 950 951 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"); 952 if (!string.IsNullOrEmpty(materialData)) 953 { 954 //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")); 955 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 956 957 if (dataXML != null) 958 { 959 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 960 //format.NumberGroupSeparator = ","; //for thousands 961 //format.NumberDecimalSeparator = "."; //the decimal seperator 962 963 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 964 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 965 966 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 967 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 968 969 var details = from dat in dataXML.Descendants("Item") 970 select new 971 { 972 material = dat.Element("material").Value, 973 //weight = dat.Element("kg").Value,// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 974 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 975 percent = Math.Round(Double.Parse(dat.Element("percent").Value, format), 1).ToString() // string.Format("{0:0.00}", Double.Parse(dat.Element("percent").Value)) 976 }; 977 978 <table class="table"> 979 <thead> 980 <tr> 981 <th scope="col">@GetString("Ecom:Product:Field.Material.Name")</th> 982 <th scope="col">kg</th> 983 <th scope="col">&#37;</th> 984 </tr> 985 </thead> 986 987 <tbody> 988 989 @foreach (var item in details) 990 { 991 <tr> 992 <td>@item.material</td> 993 <td>@item.weight</td> 994 <td>@item.percent</td> 995 </tr> 996 } 997 998 999 1000 </tbody> 1001 1002 <tfoot> 1003 <tr> 1004 <td>&nbsp;</td> 1005 <td><strong>@totalweight kg</strong></td> 1006 <td><strong>@totalpercent&#37;</strong></td> 1007 </tr> 1008 </tfoot> 1009 </table> <!--! #table-materials --> 1010 } 1011 } 1012 1013 } 1014 </div> 1015 </div> 1016 </div> 1017 </section> 1018 } 1019 @if (imagesCount + brochCount < assets.Count()) 1020 { 1021 1022 1023 } 1024 1025 @helper renderAccordianPanel(List<ProductAsset> assetList, string assetType, string translationTitle, string fallbackTitle, string extraContent = "" ) { 1026 1027 <section class="accordian print-hide"> 1028 <div class="wrapper"> 1029 <h3> 1030 <button id="accordian-downloads-@assetType" aria-expanded="true" aria-controls="accordian-panel-downloads-@assetType" type="button" class="accordian__button"> 1031 @Translate(translationTitle, fallbackTitle) 1032 <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> 1033 <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> 1034 </button> 1035 </h3> 1036 1037 1038 <div class="accordian__panel" id="accordian-panel-downloads-@assetType"> 1039 <div class="accordian__content"> 1040 <ul class="downloads__list"> 1041 @foreach (ProductAsset asset in assetList) 1042 { 1043 1044 <li> 1045 <a href="@asset.uri" download="@asset.FileName"> 1046 <span>@asset.FileName</span> 1047 </a> 1048 </li> 1049 } 1050 </ul> 1051 1052 @extraContent 1053 </div> 1054 </div> 1055 1056 </div> 1057 </section> 1058 1059 } 1060 1061 @* Certificates *@ 1062 1063 @{ 1064 List<ProductAsset> certAssets = new List<ProductAsset>(); 1065 1066 if (thisPage.AreaID == 1) // For Global get all certificates 1067 { 1068 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 1069 } 1070 else 1071 { 1072 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith(currentCountry + "_")).ToList(); 1073 } 1074 1075 if (certAssets.Count() == 0) // if none are found try to get EN certificates 1076 { 1077 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("EN_")).ToList(); 1078 } 1079 if (certAssets.Count() == 0) // if none are found try to get GB certificates 1080 { 1081 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("GB_")).ToList(); 1082 } 1083 } 1084 1085 1086 @if (certAssets.Count > 0) 1087 { 1088 @renderAccordianPanel(certAssets, "certificates", "Certificates", "Certificates") 1089 } 1090 1091 1092 @* Assembly Instructions *@ 1093 1094 @{ 1095 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 1096 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 1097 } 1098 1099 @if (assemblyAssets.Count > 0) 1100 { 1101 string extraContent = "<button class=\"productDownloadButton download btn btn--outline\" name=\"download\" data-parent=\"Monteringsanvisningar\""; 1102 extraContent += " data-productnumber=\"" + productNumber + "\" data-productname=\"" + GetString("Ecom:Product.Name") +"\">"; 1103 extraContent += Translate("DownloadInstallationGuides", "Installation Guides") + "</button>"; 1104 1105 @renderAccordianPanel(assemblyAssets, "install-guides", "InstallationGuides", "Installation Guides", extraContent) 1106 } 1107 1108 @{ 1109 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1110 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1111 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1112 } 1113 1114 @* Detailed Assembly Instructions *@ 1115 1116 @{ 1117 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1118 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1119 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1120 } 1121 1122 @if (relatedProductsAssemblyInstructions.Count > 0) 1123 { 1124 1125 @renderAccordianPanel(relatedProductsAssemblyInstructions, "detail-guides", "DetailedInstallationGuides", "Detailed Installation Guides") 1126 } 1127 1128 1129 @{ 1130 List<ProductAsset> inspAssets = new List<ProductAsset>(); 1131 //inspAssets = FileSystem.GetPdfFilesFromDirectoryBySiteCulture("/Files/System/ProductCollectionDownloads/InspectionMaintenance", "_" + currentlanguage.ToUpper()); 1132 inspAssets = FileSystem.GetAllPdfFilesFromDirectory("/Files/System/ProductCollectionDownloads/InspectionMaintenance"); 1133 } 1134 1135 @if (inspAssets != null && inspAssets.Count > 0) 1136 { 1137 @renderAccordianPanel(inspAssets, "insp-maintenance", "InspectionMaintenance", "Inspection & Maintenance") 1138 } 1139 else 1140 { 1141 <section class="accordian print-hide"> 1142 <div class="wrapper"> 1143 <h3> 1144 <button id="accordian-downloads-insp-maintenance" aria-expanded="true" aria-controls="accordian-panel-downloads-insp-maintenance" type="button" class="accordian__button"> 1145 @Translate("InspectionMaintenance", "Inspection & Maintenance") 1146 <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> 1147 <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> 1148 </button> 1149 </h3> 1150 1151 1152 <div class="accordian__panel" id="accordian-panel-downloads-insp-maintenance"> 1153 <div class="accordian__content"> 1154 <ul class="downloads__list"> 1155 <li> 1156 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Playground Equipment I&M guide_EN.pdf" download="Playground Equipment I&M Guide"> 1157 <span>Playground Equipment I&M Guide</span> 1158 </a> 1159 </li> 1160 <li> 1161 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Sports and fitness I&M guide_EN.pdf" download="Sports and Fitness I&M Guide"> 1162 <span>Sports and Fitness I&M Guide</span> 1163 </a> 1164 </li> 1165 </ul> 1166 </div> 1167 </div> 1168 1169 </div> 1170 </section> 1171 } 1172 1173 @{ 1174 List<ProductAsset> dwgAssets = new List<ProductAsset>(); 1175 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 1176 } 1177 1178 @if (dwgAssets.Count > 0) 1179 { 1180 @renderAccordianPanel(dwgAssets, "dwgs", "DWGFiles", "DWG Files") 1181 } 1182 1183 1184 <section class="accordian print-hide"> 1185 <div class="wrapper"> 1186 <h3> 1187 <button id="accordian-downloads-general-info" aria-expanded="true" aria-controls="accordian-panel-downloads-general-info" type="button" class="accordian__button"> 1188 @Translate("GeneralInformation", "General Information") 1189 <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> 1190 <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> 1191 </button> 1192 </h3> 1193 1194 1195 <div class="accordian__panel" id="accordian-panel-downloads-general-info"> 1196 1197 <div class="accordian__content"> 1198 1199 <ul class="downloads__list"> 1200 @*@if (thisPage.AreaID == 2) 1201 {*@ 1202 <li> 1203 <a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_SE.pdf" download="" target="_blank"> 1204 <span>@Translate("GeneralInformation", "General Information") (SE)</span> 1205 </a> 1206 </li> 1207 <li> 1208 <a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_SE.pdf" download="" target="_blank"> 1209 <span>@Translate("TechnicalInformation", "Technical Information") (SE)</span> 1210 </a> 1211 </li> 1212 @*} 1213 else 1214 {*@ 1215 <li> 1216 <a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_EN.pdf" download="" target="_blank"> 1217 <span>@Translate("GeneralInformation", "General Information") (EN)</span> 1218 </a> 1219 </li> 1220 <li> 1221 <a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_EN.pdf" download="" target="_blank"> 1222 <span>@Translate("TechnicalInformation", "Technical Information") (EN)</span> 1223 </a> 1224 </li> 1225 @*}*@ 1226 </ul> 1227 1228 </div> 1229 </div> 1230 1231 </div> 1232 </section> 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 @*IncludeFile("partials/add-to-collection.cshtml")*@ 1245 </div> 1246 1247 </div> 1248 </div> 1249 </section> 1250 1251 1252 <div class="center-copy contact"> 1253 1254 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 1255 { 1256 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.AreaID); 1257 <p class="print-hide call-out"><span>@Translate("CallOurSalesTeamOn", "Call a member of our team on") <strong><a href="tel:@salesPhoneNumber">@salesPhoneNumber</a></strong> @Translate("OrUseOur", "or use our") <a href="@contactUsLink">@Translate("ContactForm", "Contact Form")</a></span></p> 1258 } 1259 </div> 1260 1261 1262 1263 <form id="product-hidden-fields"> 1264 <input type="hidden" id="productVariantId" value="@GetString("Ecom:Product.VariantID")"> 1265 <input type="hidden" id="productCollectionData" value="@collectionData"> 1266 </form> 1267 1268 1269 <section class="print-hide flow section-bg-light products-variants"> 1270 1271 @if (GetLoop("VariantCombinations").Count() > 0) 1272 { 1273 <div class="wrapper flow"> 1274 <h5>@Translate("ProductOptions", "Product Options") (<span id="resultCount">@GetLoop("VariantCombinations").Count()</span>)</h5> 1275 1276 1277 <form class="form-inline"> 1278 <div id="filter-variants" class="cluster"> 1279 1280 @if (anchoringOptions.Results.Count() > 0) 1281 { 1282 <div class="form-group"> 1283 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 1284 <select class="form-control variant-filter" id="filter-anchoring" name="anchoring"> 1285 1286 @if (anchoringOptions.Results.Count() > 1) 1287 { 1288 <option value="any">@Translate("Any", "Any")</option> 1289 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 1290 { 1291 <option value="@anchor.Value">@anchor.Name</option> 1292 } 1293 } 1294 else 1295 { 1296 ResultField result = anchoringOptions.Results.FirstOrDefault(); 1297 <option value="@result.Value">@result.Name</option> 1298 } 1299 1300 </select> 1301 </div> 1302 } 1303 1304 @if (colourOptions.Results.Count() > 0) 1305 { 1306 <div class="form-group"> 1307 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 1308 <select class="form-control variant-filter" id="filter-colour" name="colour"> 1309 1310 @if (colourOptions.Results.Count() > 1) 1311 { 1312 <option value="any">@Translate("Any", "Any")</option> 1313 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 1314 { 1315 <option value="@colour.Value">@colour.Name</option> 1316 } 1317 } 1318 else 1319 { 1320 ResultField result = colourOptions.Results.FirstOrDefault(); 1321 <option value="@result.Value">@result.Name</option> 1322 } 1323 </select> 1324 </div> 1325 } 1326 1327 @if (optionOptions.Results.Count() > 0) 1328 { 1329 <div class="form-group"> 1330 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 1331 <select class="form-control variant-filter" id="filter-options" name="options"> 1332 1333 @if (optionOptions.Results.Count() > 1) 1334 { 1335 <option value="any">@Translate("Any", "Any")</option> 1336 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 1337 { 1338 <option value="@option.Value">@option.Name</option> 1339 } 1340 } 1341 else 1342 { 1343 ResultField result = optionOptions.Results.FirstOrDefault(); 1344 <option value="@result.Value">@result.Name</option> 1345 } 1346 </select> 1347 </div> 1348 } 1349 1350 </div> 1351 </form> 1352 1353 1354 </div> 1355 1356 <div class="wrapper"> 1357 <div class="grid" id="variants-list"> 1358 1359 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1360 { 1361 var colourOption = string.Empty; 1362 var optionOption = string.Empty; 1363 var anchorOption = string.Empty; 1364 var materialOption = string.Empty; 1365 var colourId = string.Empty; 1366 var optionId = string.Empty; 1367 var anchorId = string.Empty; 1368 var materialId = string.Empty; 1369 var selectedVariant = string.Empty; 1370 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1371 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1372 1373 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1374 { 1375 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1376 { 1377 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1378 { 1379 1380 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1381 { 1382 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1383 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1384 } 1385 1386 } 1387 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1388 { 1389 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1390 { 1391 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1392 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1393 } 1394 } 1395 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1396 { 1397 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1398 { 1399 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1400 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1401 } 1402 } 1403 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1404 { 1405 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1406 { 1407 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1408 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1409 } 1410 } 1411 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1412 { 1413 selectedVariant = "selected-variant"; 1414 } 1415 } 1416 1417 } 1418 1419 <div class="product-card @selectedVariant" data-filter-colour="@colourId" data-filter-anchoring="@anchorId" data-filter-options="@optionId"> 1420 1421 <div class="product-card__img-silo"> 1422 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1423 { 1424 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="product-card__img" /></a> 1425 } 1426 else 1427 { 1428 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="product-card__img" /> 1429 } 1430 </div> 1431 1432 1433 <div class="product-card__copy"> 1434 1435 @if (thisPage.AreaID == 7) /*UK*/ 1436 { 1437 string ukId = ProductFieldValues.GetUkProductNumber(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), thisPage.Area.EcomLanguageId); 1438 <h5 class="product-card__heading"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@ukId.ToString()</a></h5> 1439 } 1440 else 1441 { 1442 <h5 class="product-card__heading"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@variantCombinations.GetString("Ecom:VariantCombination.Product.Number")</a></h5> 1443 } 1444 1445 <p>@optionOption @colourOption - @anchorOption</p> 1446 1447 <!--<a class="" href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")" role="button">@Translate("ProductDetails", "Product Details")</a>--> 1448 </div> 1449 </div> 1450 1451 } 1452 </div> 1453 1454 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1455 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1456 </div> 1457 </div> 1458 1459 } 1460 </section> 1461 1462 @* Play Functions*@ 1463 @if (relatedProducts.Any()) 1464 { 1465 int count = relatedProducts.Count(); 1466 @* set up this so we can use it's title case method *@ 1467 TextInfo thisTextInfo = new CultureInfo(currentCulture,false).TextInfo; 1468 <section class="related-products"> 1469 <div class="wrapper flow"> 1470 1471 <h5 class="m-panel-title">@Translate("PlayFunctions", "Play Functions")</h5> 1472 1473 1474 <div class="products-listing__grid"> 1475 @foreach (Product relatedProduct in relatedProducts) 1476 { 1477 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(relatedProduct.Number, AssetType.Images, false); 1478 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1479 1480 <div class="product-card"> 1481 1482 <div class="product-card_img"> 1483 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1484 { 1485 <a href=""><img src="@image.uri" class="img-responsive m-product-thumb" /></a> 1486 } 1487 else 1488 { 1489 <a href=""><img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /></a> 1490 } 1491 </div> 1492 <div class="product-card__copy"> 1493 <h5 class="m-theme-after-yellow m-theme-border-yellow product-card__heading">@thisTextInfo.ToTitleCase(relatedProduct.Name.ToLower())</h5> 1494 1495 @if (!string.IsNullOrWhiteSpace(relatedProduct.LongDescription)) 1496 { 1497 <div class="show-read-more" data-charlength="60" data-txtreadmore="@Translate("ReadMore","Read More")" data-txtreadless="@Translate("ReadLess","Read Less")">@relatedProduct.LongDescription</div> 1498 } 1499 </div> 1500 </div> 1501 } 1502 1503 </div> 1504 </div> 1505 </section> 1506 } 1507 1508 <section class="print-hide flow section-bg-light products-viewed"> 1509 <div class="wrapper flow"> 1510 1511 <h5 class="m-panel-title">@Translate("YouHaveSeenTheseProducts", "Products you have viewed")</h5> 1512 1513 <div class="products-listing__grid"> 1514 @foreach (var item in GetLoop("eCom:Related.YouHaveSeenTheseProducts")) 1515 { 1516 var image = @item.GetValue("Ecom:Product.Number") + ".jpg"; 1517 <div class="product-card"> 1518 <div class="product-card__img"> 1519 <img src="Assets/@item.GetValue("Ecom:Product.Number")/Bilder/medium_@image" class="img-responsive m-product-thumb" /> 1520 </div> 1521 <div class="product-card__copy flow"> 1522 <h5 class="product-card__heading"><a href="@item.GetValue("Ecom:Product.Link.Clean")">@item.GetValue("Ecom:Product.Name")</a></h5> 1523 <!--<p><a class="btn btn--outline" href="@item.GetValue("Ecom:Product.Link.Clean")">@Translate("ProductDetails", "Product Details")</a></p>--> 1524 </div> 1525 </div> 1526 } 1527 </div> 1528 1529 </div> 1530 </section> 1531 1532 1533 1534 1535 1536 1537 1538 1539 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1540 @using System.Collections.Generic 1541 @using HagsWeb.Library.BusinessObjects.UsersLists 1542 1543 @{ 1544 Layout = null; 1545 } 1546 <dialog id="CreateProductPdf" class="modal modal--full"> 1547 1548 <div class="modal__body"> 1549 1550 <div class="modal__header"> 1551 1552 <div class="modal__close"> 1553 <button type="button" class="action-btn js-modal-close-target" data-target-id="CreateProductPdf"> 1554 <span class="visually-hidden">Close</span> 1555 <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> 1556 </button> 1557 </div> 1558 1559 1560 <h4 class="modal-title" id="CreateCatalogModalLabel"> 1561 @Translate("YourProductSheet", "Your Product Sheet") 1562 </h4> 1563 1564 </div> 1565 1566 <div class="modal__main"> 1567 1568 <div id="div_CreateCatalog" class="modal__product-pdf"> 1569 1570 <div id="pdfwaiting" style="display:block;text-align:center"> 1571 <span id="CreateProductPdfLabel" style="display: inline-block;margin: 10px 10px 0 0;padding: 5px 10px"></span> 1572 <img src="Files/Templates/Designs/HagsCore/res/img/loader/ajax-loader.gif" style="margin:auto;display:block;" /> 1573 </div> 1574 1575 <div id="productPdfViewerloader" class="modal__embed-silo"> 1576 </div> 1577 1578 <div id="CreatePdfMessage"></div> 1579 </div> 1580 1581 1582 </div> 1583 1584 <div class="modal__footer"> 1585 1586 <div class="m-search-advanced-buttons cluster cluster--dialog"> 1587 <a href="" class="btn btn--outline" id="pdfPrintSheet" target="_blank" type="button">@Translate("Print", "Print")</a> 1588 <a href="" class="btn btn--outline" id="pdfDownloadSheet" download type="button">@Translate("Download", "Download")</a> 1589 <button class="btn btn--outline js-modal-close-target" data-target-id="CreateProductPdf" type="button">@Translate("Close", "Close")</button> 1590 </div> 1591 1592 </div> 1593 1594 </div> 1595 1596 </dialog> 1597 @*ProductPdfHelper(productCollectionItems, GetString("Ecom:Product.LanguageID"))*@ 1598 1599

Warranties

Find out what you are covered for.

Maintenance guide

How to look after your products.

Color & Anchoring Options

Explore your options.

}