Current Country: United Kingdom

To add products to your collection, simply search for products, click 'product details' and from the product page select 'add to my collection'. This can be found either within the product options panel or below the product image.

Search Advanced Close
Error executing template "Designs/HagsCore/eCom/Product/Product.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_14d80507f11d4651b7795a6c474dd4af.Execute() in B:\Hags_Live_A\Files\Templates\Designs\HagsCore\eCom\Product\Product.cshtml:line 403
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System; 3 @using System.Collections.Generic; 4 @using System.Linq; 5 @using System.Web.Optimization; 6 @using Dynamicweb.Content.Items; 7 @using Dynamicweb.Ecommerce.Products; 8 @using HagsWeb.Library.Methods.AssetManager; 9 @using HagsWeb.Library.BusinessObjects.UsersLists; 10 @using HagsWeb.Library.Methods.AssetSearch; 11 @using HagsWeb.Library.Methods.Page; 12 @using HagsWeb.Library.Methods.ProductImages; 13 @using HagsWeb.Library.Methods.ProductProperties; 14 @using HagsWeb.Library.Methods.ProductFilter; 15 @using HagsWeb.Library.Services.IPService; 16 @using HagsWeb.Library.Services.FileSystemService; 17 @using HagsWeb.Library.Utilities; 18 @using HagsWeb.Library.State; 19 20 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 21 @using Dynamicweb.Rendering; 22 @using System; 23 @using System.Web; 24 @using System.Collections.Generic; 25 @using System.Linq; 26 @using Ionic.Zip; 27 @using System.IO; 28 @using System.Threading; 29 30 31 @helper GetButton(List<string> files, string sender) 32 { 33 var request = HttpContext.Current.Request.Form; 34 var response = HttpContext.Current.Response; 35 36 if (!string.IsNullOrEmpty(request["ProductNumber"])) 37 { 38 // Currently only used for Product Image download on results page - see also GetDownload.cshtml 39 // To do KOD extract this into a service in Library, also consider Hags\Application\Ajax\UsersProductCollection\UsersProductCollection.aspx.cs(398) 40 if (files.Any()) 41 { 42 try 43 { 44 45 var zipArchives = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Zips"); 46 var transferFolder = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Transfers"); 47 48 // empty the zipArchives folder of zips that are 30 mins old (if any) 49 var oldZips = new DirectoryInfo(zipArchives).EnumerateFiles() 50 .Where(f => f.CreationTime < DateTime.Now.AddMinutes(-30)) 51 .ToList(); 52 oldZips.ForEach(f => f.Delete()); 53 54 DirectoryInfo Folder = new DirectoryInfo(transferFolder); 55 // Occasionally some files are read only and cannot be deleted so change all files, remove readonly before the delete 56 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 57 Directory.EnumerateFiles(transferFolder).ToList().ForEach(f => System.IO.File.Delete(f)); 58 59 // copy the selected files to the transferFolder and change from ReadOnly to try to prevent access to the path is denied error 60 files.ForEach(f => System.IO.File.Copy(f, Path.Combine(transferFolder, Path.GetFileName(f)), true)); 61 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 62 63 // Set up our new zip folder 64 var downloadFileName = string.Format(request["ProductNumber"] +"_"+ request["ProductName"] +"_Bilder {0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 65 // var downloadFileName = string.Format("Hags_Download_Pack-{0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 66 67 //var zipLocationUrl = "Files/System/UserDownloads/Zips/" + downloadFileName; // Use this to return a link to the folder saved to disk 68 69 HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; // Important - as is AppendHeader, not AddHeader 70 HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 71 72 using (var zip = new ZipFile()) 73 { 74 List<string> fileList = Directory.EnumerateFiles(transferFolder).ToList(); 75 //zip.AddDirectoryByName(subfolderName); 76 foreach (string file in fileList) 77 { 78 zip.AddFile(file, string.Empty); 79 } 80 81 // Save to the OutputStream 82 zip.Save(HttpContext.Current.Response.OutputStream); 83 // Or save the file to the file system using TransmitFile to stream the file without storing to memory 84 //zip.Save(zipArchives + "/" + downloadFileName); 85 } 86 87 // Transmit a file that was created on disk 88 //HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; 89 //HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 90 //HttpContext.Current.Response.TransmitFile(zipArchives + "/" + downloadFileName); 91 92 93 94 } 95 catch (ZipException ze) 96 { 97 string message = ze + "ProductDownload/GetDownloadButton.cshtml ZipException download file error (" + sender + ") - Original File Count: " + files.Count() + "InnerEx: " + ze.InnerException + ""; 98 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 99 log.Info(message); 100 } 101 catch (System.IO.FileNotFoundException notFoundEx) 102 { 103 string message = notFoundEx + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + notFoundEx.Message + " - The File: " + notFoundEx.FileName +""; 104 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 105 log.Info(message); 106 } 107 catch (ThreadAbortException) 108 { 109 // A normal Thread abort after HttpContext.Current.Response.End(); we dont record it 110 } 111 catch (Exception ex) 112 { 113 string message = ex + "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + ex.Message + " - The Inner Ex: " + ex.InnerException + ""; 114 Dynamicweb.Logging.ILogger log = Dynamicweb.Logging.LogManager.Current.GetLogger("File Download Service"); 115 log.Info(message); 116 } 117 finally 118 { 119 HttpContext.Current.Response.End(); 120 } 121 122 } 123 } 124 else 125 { 126 string buttonCaption = string.Empty; 127 if (sender == "Product") 128 { 129 buttonCaption = Translate("ImageDownloads", "Image Downloads"); 130 } 131 if (sender == "AdvancedSearch") 132 { 133 buttonCaption = Translate("DownloadAll", "Download All"); 134 } 135 136 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" 137 onclick="$('#downloadImagesForm').submit(); return false;" role="button"> 138 @buttonCaption 139 </a> 140 } 141 } 142 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 143 @using System.Collections.Generic 144 @using HagsWeb.Library.BusinessObjects.UsersLists 145 146 @{ 147 Layout = null; 148 } 149 150 @helper ProductPdfHelper(List<ProductCollectionItem> catalogueCollectionItems, string LanguageId) 151 { 152 <!--Files\Templates\HagsModules\UsersAssetsSearch\ProductDownloads\PdfProductSheet.cshtml--> 153 @*the bootstrap modal background/backdrop misbehaves in some browsers covering the modal completly so turn it off data-background="false"*@ 154 <div id="CreatePdf" class="modal fade in" data-background="false" tabindex="-1" role="dialog" aria-labelledby="CreateCatalogModalLabel" aria-hidden="true"> 155 <div class="modal-backdrop fade in" data-backdrop="static" style="z-index:180;"></div> 156 <div class="modal-dialog" style="width: 850px"> 157 <div class="m-form-contact-modal modal-content"> 158 <div class="modal-header"> 159 <button type="button" class="close blue-close icon-remove" data-dismiss="modal"></button> 160 <button type="button" class="close" data-dismiss="modal"> 161 <span aria-hidden="true">x</span> 162 <span class="sr-only">Close</span> 163 </button> 164 <h4 class="modal-title" id="CreateCatalogModalLabel"> 165 @Translate("YourProductSheet", "Your Product Sheet") 166 </h4> 167 </div> 168 169 <div id="frm_ProductSheet"> 170 <div class="row2"> 171 <div id="" class="tab-content"> 172 @*<div id="cat-custom" class="tab-pane fade in active">*@ 173 <div id="cat-custom"> 174 <div class="l-page"> 175 <div class="container-fluid"> 176 <div class="col-ms-12 col-sm-12" style="margin-top: 5px;"> 177 178 @*<div class="col-ms-6 col-sm-6">*@ 179 <div class="row2"> 180 <div id="loader" style="display:block;text-align:center"> 181 <span id="CreateProductPdfLabel" style="display: inline-block;margin: 10px 10px 0 0;padding: 5px 10px"></span> 182 <img src="Files/Templates/Designs/HagsCore/res/img/loader/ajax-loader.gif" style="margin:auto;display:block;" /> 183 </div> 184 185 186 187 188 <div id="productPdfViewerloader" class="hide"> 189 190 <embed id="embedPdfViewer" style="margin:0px 7px 0px 7px;" src="" type="application/pdf" width="886" height="600" /> 191 <iframe id="iframePdfViewer" style="margin:0px 7px 0px 7px; border:none;" src="" type="application/pdf" width="886" height="600"></iframe> 192 193 </div> 194 195 196 197 198 199 @*<div id="productPdfViewer"> 200 <object id="pdfObjectViewer" style="display: none;" data="" type="application/pdf" width="100%" height="600" /> 201 <embed id="pdfViewer" style="display: none;" src="" type="application/pdf" /> 202 <iframe src="" id="pdfIframeViewer" width="100%" height="600" type="application/pdf" style="display:none;" /> 203 </div>*@ 204 </div> 205 @*</div>*@ 206 </div> 207 </div> <!--container - fluid--> 208 </div> 209 </div> 210 </div> 211 </div> 212 213 <div id="CreatePdfMessage"></div> 214 215 </div> 216 217 <div class="modal-footer" id="main-footer"> 218 219 <div class="m-search-advanced-buttons text-center"> 220 221 @*<button class="m-btn-search btn btn-default text-uppercase" name="createemail" type="button" role="button">Email Catalogue</button>*@ 222 223 <button class="m-btn-search btn btn-default text-uppercase" data-dismiss="modal" type="button">@Translate("Cancel", "Cancel")</button> 224 <a href="" class="m-btn-search btn btn-default text-uppercase disabled" id="pdfPrintSheet" target="_blank" type="button">@Translate("Print", "Print")</a> 225 <a href="" class="m-btn-search btn btn-default text-uppercase disabled" id="pdfDownloadSheet" download type="button">@Translate("Download", "Download")</a> 226 227 </div> 228 229 </div> 230 231 </div> 232 </div> 233 234 </div> 235 236 } 237 238 239 @{ 240 Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 241 Item areaItem = Item.GetItemById("Website_Settings", thisPage.Area.Item.Id); 242 string pageUrl = GetGlobalValue("Global:Request.Scheme") + "://" + GetGlobalValue("Global:Request.Host") + thisPage.SearchFriendlyUrl; 243 string themeTag = HagsPages.GetThemeByNavigationTag(GetGlobalValue("Global:Page.Top.ID")); // gets the page ID at the top of the tree this page sits on. 244 var siteSection = HagsPages.GetSiteSection(thisPage.AreaID, thisPage.ID); 245 string salesPhoneNumber = areaItem["Telephone"].ToString(); 246 247 string productNumber = GetString("Ecom:Product.Number"); // The Product NUMBER 248 249 string currentCulture = GetGlobalValue("Global:Area.LongLang"); //en-GB, sv-SE 250 string currentCountry = currentCulture.Substring(currentCulture.Length - 2); // GB, SE 251 string currentlanguage = currentCulture.Substring(0, 2); // en, sv "de";// 252 string ipPriceAllowed = string.Empty; 253 254 if (thisPage.AreaID == 2 || thisPage.AreaID == 7) // Sweden and UK 255 { 256 ipPriceAllowed = IPCheck.CountryPriceAllowed(currentCountry); //ZZZ,Hags_GB,Hags_SE and Hags_, Anon_GB, Anon_SE network range checker(Web.config) 257 } 258 259 IEnumerable<ProductAsset> assets = AssetManager_Repository.GetAssets(productNumber, AssetType.All, true); 260 IEnumerable<ProductAsset> allImages = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)); 261 262 // New sorting for Product Images, thumbs and hiResDownloads for Zoom Images 263 Tuple<SortedList<int, string[,]>, IEnumerable<ProductAsset>> mainProductImages = ProductImages.MarshallZoomImages(allImages, productNumber); 264 SortedList<int, string[,]> zoomList = mainProductImages.Item1; 265 IEnumerable<ProductAsset> hiResDownloads = mainProductImages.Item2; 266 267 268 // The users Product Collection in session 269 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 270 bool isProductCollection = productCollectionItems.Any(n => n.ProductNumber == productNumber); 271 272 // users Product Collection 273 string collectionData = string.Empty; 274 275 if (!String.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.Name"))) 276 { 277 // not used even if logged-in collectionData = GetString("Ecom:Product.AddToList"); // only available if logged-in 278 } 279 else 280 { 281 collectionData = string.Format("CCAddToMyLists={0}&CCAddToListVariantID={1}&CCAreaID={2}&CCAddToListCulture={3}&CCAddToListLanguageID={4}#{5}", 282 GetString("Ecom:Product.Number"), GetString("Ecom:Product.VariantID"), GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.LanguageID"), siteSection); 283 } 284 285 // New Age Ranges. Some Template Tags dont work very well in upgraded DW version 9.7.2 286 List<string> ageRanges = new List<string>(); 287 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AgeRange"))) 288 { 289 ageRanges = ProductAgeRanges.GetAgeRanges(GetString("Ecom:Product:Field.AgeRange"), GetString("Ecom:Product.LanguageID")); 290 } 291 292 // New Product Functions. Some Template Tags dont work very well in upgraded DW version 9.7.2 293 List<ResultField> productFunctions = new List<ResultField>(); 294 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductFunctions"))) 295 { 296 productFunctions = ProductFieldValues.GetProductFieldOptions(GetString("Ecom:Product:Field.ProductFunctions"), "ProductFunctions", GetString("Ecom:Product.LanguageID")); 297 } 298 299 // For filtering the variants of this product 300 ResultSet colourOptions = new ResultSet(); 301 ResultSet materialOptions = new ResultSet(); 302 ResultSet anchoringOptions = new ResultSet(); 303 ResultSet optionOptions = new ResultSet(); 304 305 306 string selectedColourVariant = string.Empty; 307 string selectedAnchoringVariant = string.Empty; 308 string selectedAnchoringIcon = string.Empty; 309 string selectedMaterialVariant = string.Empty; 310 string selectedOptionVariant = string.Empty; 311 //List<VariantOption> selectedProductOptions = new List<VariantOption>(); 312 313 314 315 if (GetInteger("Ecom:Product.VariantCount") > 0) 316 { 317 foreach (var variantGroup in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) // Remove All Date Variants 318 { 319 int optionsCount = variantGroup.GetLoop("VariantAvailableOptions").Count(); 320 321 if (optionsCount > 0) 322 { 323 if (!string.IsNullOrEmpty("Ecom:Product.SelectedVariantComboID")) // optionsCount == 1 324 { 325 foreach (var availableOption in variantGroup.GetLoop("VariantAvailableOptions")) 326 { 327 328 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "S55") 329 { 330 colourOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 331 332 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 333 { 334 335 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 }); 336 337 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 338 { 339 selectedColourVariant = availableOption.GetString("Ecom:VariantOption.Name"); 340 } 341 } 342 } 343 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP1") 344 { 345 materialOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 346 347 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 348 { 349 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 }); 350 351 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 352 { 353 selectedMaterialVariant = availableOption.GetString("Ecom:VariantOption.Name"); 354 } 355 } 356 } 357 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP3") 358 { 359 anchoringOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 360 361 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 362 { 363 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 }); 364 365 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 366 { 367 selectedAnchoringVariant = availableOption.GetString("Ecom:VariantOption.Name"); 368 selectedAnchoringIcon = availableOption.GetString("Ecom:VariantOption.ID") + ".png"; 369 } 370 } 371 } 372 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP4") 373 { 374 optionOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 375 376 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 377 { 378 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 }); 379 380 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 381 { 382 selectedOptionVariant = availableOption.GetString("Ecom:VariantOption.Name"); 383 } 384 } 385 386 } 387 } 388 } 389 } 390 } 391 } 392 393 394 string assemblyInstructionsProductNumber = productNumber; 395 396 // 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 397 // Assembly Instructions 398 Product product = new ProductService().GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), GetString("Ecom:Product.LanguageID")); 399 400 // Check if its a Master product. 401 if (!product.IsVariantMaster) 402 { 403 assemblyInstructionsProductNumber = new ProductService().GetProductsAndVariantsByProduct(product) 404 .FirstOrDefault<Product>(n => string.IsNullOrEmpty(n.VariantId)).Number; 405 } 406 407 // Check if its a Master product. 408 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 409 410 //Tuple<string, string, string, string, string> optionsTuple; 411 string VariantId = string.Empty; 412 if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || !string.IsNullOrEmpty(GetString("Ecom:Product.ProductDefaultVariantComboId")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductVariantFallback"))) 413 { 414 VariantId = string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) ? GetString("Ecom:Product.ProductDefaultVariantComboId") : GetString("Ecom:Product.VariantID"); 415 416 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 417 if (string.IsNullOrEmpty(VariantId)) 418 { 419 VariantId = GetString("Ecom:Product:Field.ProductVariantFallback"); 420 } 421 422 //optionsTuple = ProductFieldValues.GetProductOptions(VariantId, GetString("Ecom:Product.LanguageID")); 423 424 //selectedColourVariant = optionsTuple.Item1; 425 //selectedAnchoringVariant = optionsTuple.Item2; 426 //selectedMaterialVariant = optionsTuple.Item3; 427 //selectedOptionVariant = optionsTuple.Item4; 428 //selectedAnchoringIcon = optionsTuple.Item5; 429 //selectedProductOptions = optionsTuple.Item6; // used to filter related products by the variant values of this product 430 431 } 432 433 // Related Products and their Assembly Instructions 434 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 435 List<Product> relatedComponentProducts = new List<Product>(); 436 List<ProductAsset> relatedProductsAssemblyInstructions = new List<ProductAsset>(); 437 438 string variantOptions = selectedMaterialVariant + " " + selectedAnchoringVariant + " " + selectedOptionVariant + " " + selectedColourVariant; 439 440 if (GetInteger("Ecom:Product.RelatedCount") > 0) 441 { 442 // Play Functions // 443 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 444 { 445 relatedProducts = ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), VariantId, "Product Modules", GetString("Ecom:Product.LanguageID")); 446 } 447 448 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Components") != null) 449 { 450 relatedComponentProducts = ProductFilter.GetRelatedProducts(assemblyInstructionsProductNumber, VariantId, "Product Components", GetString("Ecom:Product.LanguageID")); 451 //// Lookup Assembly Instructions Assets 452 foreach (Product relatedComponentProduct in relatedComponentProducts) 453 { 454 if (relatedComponentProduct != null) 455 { 456 List<ProductAsset> productAssemblyInstructions = AssetManager_Repository.GetAssets(relatedComponentProduct.Number, AssetType.AssemblyInstructions, true); 457 if (productAssemblyInstructions.Any()) 458 { 459 //List<ProductAsset> result = productAssemblyInstructions.Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName == pa.FileName)).ToList(); 460 List<ProductAsset> result = productAssemblyInstructions 461 .Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName.Substring(8, pa2.FileName.Length - 8) == pa.FileName.Substring(8, pa.FileName.Length - 8))).ToList(); 462 result.ForEach(n => n.RelatedProduct = productNumber); 463 relatedProductsAssemblyInstructions.AddRange(result); 464 } 465 } 466 } 467 } 468 } 469 470 // Test for Related Products Assembly instructions 471 //SessionManager.SetSession( productNumber + "_AssemblyInstructions", new List<ProductAsset>(relatedProductsAssemblyInstructions)); 472 473 // Find the Parent top Group // Not used now scope changed 474 //Enum enumProductType = DWUtilities.GetTopGroupForProduct(product.Groups.ToList()); 475 476 // Testing for Brand Banner Image 477 //ProductFieldValue productBrand = product.ProductFieldValues.GetProductFieldValue("Brand"); 478 //string bannerImage = string.Empty; 479 //FieldOption brandFieldOption = new FieldOption(); 480 481 482 //if (productBrand != null) 483 //{ 484 // brandFieldOption = FieldOption.GetOptionsByFieldId(productBrand.ProductField.Id).FirstOrDefault(n => n.Value == productBrand.Value.ToString()); 485 // if (brandFieldOption != null) 486 // { 487 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/" + brandFieldOption.Name + "_Banner.jpg"; 488 // } 489 // else if (enumProductType != null) 490 // { 491 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/" + enumProductType.ToString() + "_Banner.jpg"; 492 // } 493 // else 494 // { 495 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/Hags_Banner.jpg"; 496 // } 497 498 //} 499 } 500 501 502 <!--Templates/Designs/HagsCore/eCom/Product/Product.cshtml--> 503 504 @Scripts.Render("~/bundle/ProductFilter") 505 506 @ProductPdfHelper(productCollectionItems, GetString("Ecom:Product.LanguageID")) 507 508 <input type="hidden" id="productVariantId" value="@GetString("Ecom:Product.VariantID")"> 509 <input type="hidden" id="productCollectionData" value="@collectionData"> 510 511 <div class="m-heading m-theme-background-yellow m-theme-color-white breadcrumb product"> 512 <div class="l-page"> 513 <div class="container-fluid"> 514 @{ 515 string breadcrumb = HagsPages.GetThisPageNavigation(pageUrl, GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.Name"), variantOptions); // " "; // 516 } 517 <div class="m-menu-primary breadcrumb"> 518 <nav class="text-centre text-uppercase"> 519 @breadcrumb 520 </nav> 521 </div> 522 523 </div> <!-- container-fluid --> 524 </div> <!-- l-page --> 525 </div> <!-- m-heading --> 526 <div class="l-page"> 527 <div class="container-fluid"> 528 @*<p>Language: @currentlanguage || Stock Values: @GetDouble("Ecom:Product.Stock") || @GetString("Ecom:Product:Stock.DeliveryText") || @GetString("Ecom:Product:Stock.DeliveryUnit") || @GetString("Ecom:Product:Stock.ID") || @GetString("Ecom:Product:Stock.Image") || @GetString("Ecom:Product:Stock.Image.Clean") || @GetString("Ecom:Product:Stock.Text")</p>*@ 529 @*<p>@ipPriceAllowed || ShopID = @GetString("Ecom:Product.DefaultShopID")</p>*@ 530 @*<p> Product? @GetString("Ecom:Product.ID") || @GetString("Ecom:Product.Number")</p>*@ 531 @*<p> isVariantMaster? @prod.IsVariantMaster</p> 532 <p> Variant? @GetString("Ecom:Product.VariantID") </p> 533 <p> FallbackVariant? @GetString("Ecom:Product:Field.ProductVariantFallback") </p>*@ 534 @*<p>Material(@selectedMaterialVariant) || Option(@selectedOptionVariant)<br /> 535 Colour(@selectedColourVariant) &ndash; 536 Anchoring(@selectedAnchoringVariant || @selectedAnchoringIcon ) </p>*@ 537 @*<p> Variant Options? @variantOptions || @prod.VariantId</p>*@ 538 @*<p> Age Range? @GetString("Ecom:Product:Field.AgeRange")</p>*@ 539 @*<p>@GetString("Ecom:Product:Field.Brand.Name"): @(brandFieldOption != null ? brandFieldOption.Name : "Value is Null") || @GetString("Ecom:Product:Field.Brand.Value") || @(enumProductType != null ? enumProductType.ToString() : "ProductType Enum is Null") || @bannerImage</p>*@ 540 @*<p>@themeTag || @GetGlobalValue("Global:HagsTheme")</p>*@ 541 <div class="row"> 542 543 <div class="col-sm-5"> 544 545 <h1>@GetString("Ecom:Product.Name")</h1> 546 547 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.ShortDescription"))) 548 { 549 <p>@GetString("Ecom:Product.ShortDescription")</p> 550 } 551 552 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.LongDescription"))) 553 { 554 <div class="show-read-more" style="margin-bottom:24px;" data-charlength="480" data-txtreadmore="@Translate("ReadMore","Read More")" data-txtreadless="@Translate("ReadLess","Read Less")">@GetString("Ecom:Product.LongDescription")</div> 555 556 } 557 558 <div style="display:block;float:left;margin-right:24px;"> 559 @if (GetDouble("Ecom:Product.Stock") > 0 && thisPage.AreaID != 7) 560 { 561 string fastDeliveryTxt = Translate("FastDelivery", "Fast Delivery"); 562 string flagImg = string.Concat("flag_", @currentlanguage, ".png"); 563 564 <div style="float:left;display:block;"> 565 <h3 id="displayproductnumber"> 566 @productNumber 567 </h3> 568 </div> 569 570 <div style="float:left;display:block;margin-top:6px;margin-left:16px;" data-toggle="tooltip" data-placement="top" title="@fastDeliveryTxt"> 571 <img src="/Admin/Images/Flags/@flagImg" alt="@fastDeliveryTxt" style="display:block;float:left;width:24px;" /><p style="display:block;float:left; margin-left:6px;margin-top:4px;">@fastDeliveryTxt</p> 572 </div> 573 } 574 else if (thisPage.AreaID == 2 || thisPage.AreaID == 4) 575 { 576 //Display the Swedish stock Product Number and display the Swedish Flag if we are in AreaId=2 or the Danish Flag if we are in AreaId=4 577 // with the appropriate translation 578 579 if (GetBoolean("Ecom:Product:Field.SwedishStock")) 580 { 581 string fastDeliveryTxt = thisPage.AreaID == 2 ? "Snabb Leverans" : "Hurtig Levering"; 582 string flagImg = thisPage.AreaID == 2 ? "flag_se.png" : "flag_dk.png"; 583 584 <div style="float:left;display:block;"> 585 <h3 id="displayproductnumber"> 586 @productNumber-1 587 </h3> 588 </div> 589 <div style="float:left;display:block;margin-top:6px;margin-left:16px;" data-toggle="tooltip" data-placement="top" title="Leverans ex lager från Sverige"> 590 <img src="/Admin/Images/Flags/@flagImg" alt="Leverans ex lager från Sverige" style="display:block;float:left;width:24px;" /><p style="display:block;float:left; margin-left:6px;margin-top:4px;">@fastDeliveryTxt</p> 591 </div> 592 } 593 else 594 { 595 <h3 id="displayproductnumber">@productNumber</h3> 596 } 597 } 598 else if (thisPage.AreaID != 7) /*Not UK*/ 599 { 600 <h3 id="displayproductnumber">@productNumber</h3> 601 } 602 </div> 603 604 @if (!string.IsNullOrWhiteSpace(selectedAnchoringIcon ?? selectedAnchoringVariant)) 605 { 606 <div style="display:block;float:left;overflow:auto;margin-left:0px;width:100%" data-toggle="tooltip" data-placement="top" title="@Translate(" Anchoring", "Anchoring" ): @selectedAnchoringVariant"> 607 @{//Display the correct icon if available 608 bool isIcon = true; 609 isIcon = File.Exists(HttpContext.Current.Server.MapPath(@"Files/Templates/Designs/HagsCore/res/img/icons/anchoring/" + selectedAnchoringIcon)); 610 } 611 612 @if (isIcon) 613 { 614 <img src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" style="display:block;float:left;" /> 615 } 616 617 <p style="display: block; float: left; margin-left: 12px; margin-bottom: 0px;"> 618 @selectedMaterialVariant @selectedOptionVariant<br /> 619 @selectedColourVariant &ndash; @selectedAnchoringVariant 620 621 </p> 622 </div> 623 } 624 625 @if (GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0 && GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 626 { 627 <div class="col-sm-6" style="display:block;float:left;width:100%;margin-top:12px;padding-left:0px;margin-bottom:16px;" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.SafetyAreaWidth.Name") x @GetString("Ecom:Product:Field.SafetyAreaLength.Name")"> 628 <img src="Files/Templates/Designs/HagsCore/res/img/icons/whtstar.png" alt="s" style="display:block;float:left;" /> 629 <p style="display:block;float:left;margin-left:12px;margin-top:3px;margin-bottom:0px;width:auto;">@GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") x @GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw")</p> 630 </div> 631 } 632 633 <div class="m-decal-container" style="width:100%;display:block;float:left;"> 634 635 @* ageRanges *@ 636 <div class="m-decal"> 637 <ul class="list-inline"> 638 639 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 640 { 641 foreach (var range in ageRanges) 642 { 643 if (range.Trim() != "-") 644 { 645 <li class="decal"> 646 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.AgeRange.Name") @range"> 647 <img src="Files/Templates/Designs/HagsCore/res/img/decals/agerange.png" alt="@GetString(" Ecom:Product:Field.AgeRange.Name") @range" /> 648 <span class="decalvalue">@range</span> 649 </div> 650 </li> 651 } 652 } 653 } 654 655 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 656 { 657 <li class="decal"> 658 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.AssemblyTime.Name") @Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw")) hrs"> 659 660 <img src="Files/Templates/Designs/HagsCore/res/img/decals/time.png" alt="@GetString(" Ecom:Product:Field.AssemblyTime.Name") @Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw")) hrs" /> 661 662 <span class="decalvalue">@Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw"))</span> 663 664 </div> 665 </li> 666 } 667 668 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 669 { 670 <li class="decal"> 671 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.FallHeight.Name") @GetString("Ecom:Product:Field.FallHeight.Value.Raw")"> 672 673 <img src="Files/Templates/Designs/HagsCore/res/img/decals/fall.png" alt="@GetString(" Ecom:Product:Field.FallHeight.Name") @GetString("Ecom:Product:Field.FallHeight.Value.Raw")" /> 674 675 <span class="decalvalue">@GetString("Ecom:Product:Field.FallHeight.Value.Raw")</span> 676 677 </div> 678 </li> 679 } 680 681 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 682 { 683 <li class="decal"> 684 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.SafetyArea.Name") @GetDouble("Ecom:Product:Field.SafetyArea.Value")m&#178;"> 685 686 <img src="Files/Templates/Designs/HagsCore/res/img/decals/area.png" alt="@GetString(" Ecom:Product:Field.SafetyArea.Name") @GetDouble("Ecom:Product:Field.SafetyArea.Value")m&#178;" /> 687 688 <span class="decalvalue">@GetDouble("Ecom:Product:Field.SafetyArea.Value")</span> 689 690 </div> 691 </li> 692 } 693 694 @if (GetBoolean("Ecom:Product:Field.InclusivePlay.Value")) 695 { 696 <li class="decal"> 697 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="Inclusive Play"> 698 699 <img src="Files/Templates/Designs/HagsCore/res/img/decals/play-for-all-small.png" alt="Inclusive Play" /> 700 701 </div> 702 </li> 703 } 704 705 </ul> 706 </div> <!-- m-decals --> 707 </div> <!-- m-decals-container --> 708 @*Only UK and Sweden have Pricing at the moment*@ 709 @if (thisPage.AreaID == 2 && (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_"))) /*Sweden - would like no ,00 in dwFormattedPrice and a message if there is no price*/ 710 { 711 string krPrice = GetInteger("Ecom:Product.DBPrice") == 0 ? Translate("RequestAQuote", "Kontakta oss") : GetString("Ecom:Product.Price.PriceFormatted").Replace(",00", ""); 712 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @krPrice</strong></p></div> 713 } 714 715 @if (thisPage.AreaID == 7) /*UK*/ 716 { 717 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.UKProductNumber"))) 718 { 719 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")</p> 720 } 721 722 @* GL 15/02/2021 now remove all pricing for the UK (Also check pdf templates)*@ 723 @*if (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_")) 724 { 725 string ukPrice = (GetDouble("Ecom:Product:Field.UKProductPrice") == 0) ? "On Application" : "&pound;" + string.Format(new System.Globalization.CultureInfo("en-GB", false), "{0:c}", GetValue("Ecom:Product:Field.UKProductPrice")); 726 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @ukPrice </strong></p></div> 727 }*@ 728 729 } 730 731 <div class="col-sm-12 panel-group" style="display:block;float:left;width:100%;margin-top:18px;" id="accordion" role="tablist" aria-multiselectable="false"> 732 <div class="panel panel-default"> 733 <div class="panel-heading" role="tab" id="headingOne"> 734 <h4 class="m-panel-title panel-title"> 735 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne" class=""> 736 @Translate("ProductSpecifications", "Product Specifications") 737 </a> 738 </h4> 739 </div> 740 <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true"> 741 <div class="panel-body"> 742 <div id="product-left"> 743 <div class="padding"> 744 745 <div id="product-list-information" class="box-padding"> 746 747 <ul> 748 749 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 750 { 751 <li><span><strong>@GetString("Ecom:Product:Field.AgeRange.Name"):</strong></span> <span>@string.Join(", ", ageRanges)</span></li> 752 } 753 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 754 { 755 <li><span><strong>@GetString("Ecom:Product:Field.AssemblyTime.Name"):</strong></span> <span>@Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw")) @Translate("Hours", "hours")</span></li> 756 } 757 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 758 { 759 <li><span><strong>@GetString("Ecom:Product:Field.Length.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</span></li> 760 } 761 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 762 { 763 <li><span><strong>@GetString("Ecom:Product:Field.Width.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</span></li> 764 } 765 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 766 { 767 <li><span><strong>@GetString("Ecom:Product:Field.Height.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</span></li> 768 } 769 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 770 { 771 <li><span><strong>@GetString("Ecom:Product:Field.NetWeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.NetWeight.Value") kg</span></li> 772 } 773 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 774 { 775 <li><span><strong>@GetString("Ecom:Product:Field.Volume.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</span></li> 776 } 777 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 778 { 779 <li><span><strong>@GetString("Ecom:Product:Field.FallHeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</span></li> 780 } 781 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 782 { 783 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</span></li> 784 } 785 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 786 { 787 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaLength.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</span></li> 788 } 789 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 790 { 791 <li><span><strong>@GetString("Ecom:Product:Field.SafetyArea.Name"):</strong></span> <span>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</span></li> 792 } 793 794 </ul> 795 796 @*Anchoring from Variant*@ 797 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 798 { 799 string anchoringPage = DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.AreaID) + "#" + GetGlobalValue("Global:HagsTheme"); 800 801 if (!string.IsNullOrEmpty(anchoringPage)) 802 { 803 <a href="@anchoringPage" class="print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a> 804 } 805 806 } 807 808 </div> 809 810 </div> <!--! .padding --> 811 </div> 812 </div> 813 </div> 814 </div> 815 816 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Material"))) 817 { 818 <div class="panel panel-default"> 819 <div class="panel-heading" role="tab" id="headingTwo"> 820 <h4 class="m-panel-title panel-title"> 821 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo" class="collapsed"> 822 @GetString("Ecom:Product:Field.Material.Name") 823 </a> 824 </h4> 825 </div> 826 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true"> 827 <div class="panel-body"> 828 <div id="product-left"> 829 <div class="padding"> 830 831 832 <p>&nbsp;</p> 833 @{ 834 835 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"); 836 if (!string.IsNullOrEmpty(materialData)) 837 { 838 //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")); 839 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 840 841 if (dataXML != null) 842 { 843 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 844 //format.NumberGroupSeparator = ","; //for thousands 845 //format.NumberDecimalSeparator = "."; //the decimal seperator 846 847 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 848 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 849 850 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 851 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 852 853 var details = from dat in dataXML.Descendants("Item") 854 select new 855 { 856 material = dat.Element("material").Value, 857 //weight = dat.Element("kg").Value,// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 858 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 859 percent = Math.Round(Double.Parse(dat.Element("percent").Value, format), 1).ToString() // string.Format("{0:0.00}", Double.Parse(dat.Element("percent").Value)) 860 }; 861 862 <table class="table"> 863 <thead> 864 <tr> 865 <th>@GetString("Ecom:Product:Field.Material.Name")</th> 866 <th>kg</th> 867 <th>&#37;</th> 868 </tr> 869 </thead> 870 871 <tbody> 872 873 @foreach (var item in details) 874 { 875 <tr> 876 <td>@item.material</td> 877 <td>@item.weight</td> 878 <td>@item.percent</td> 879 </tr> 880 } 881 882 883 884 </tbody> 885 886 <tfoot> 887 <tr> 888 <td>&nbsp;</td> 889 <td><strong>@totalweight kg</strong></td> 890 <td><strong>@totalpercent&#37;</strong></td> 891 </tr> 892 </tfoot> 893 </table> <!--! #table-materials --> 894 } 895 } 896 897 } 898 899 </div> <!--! .padding --> 900 </div> 901 </div> 902 </div> 903 </div> 904 905 } 906 907 </div> 908 909 </div> 910 911 <div class="col-sm-7"> 912 913 <div class="image-gallery-container"> 914 915 <div class="fc-zoom"> 916 @*Zoom Product Images*@ 917 @if (zoomList.Count > 0) 918 919 { 920 <div class="fc-zoom__view"> 921 <div class="fc-zoom__target" id="zoom-target-1"> 922 @{ var i = 0; } 923 @foreach (var zoomSet in zoomList) 924 { 925 string[,] imgSet = zoomSet.Value; 926 string imgId = string.Format("img_0{0}", zoomSet.Key); 927 if (i == 0) 928 { 929 <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")"> 930 } 931 else 932 { 933 <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")"> 934 } 935 i++; 936 } 937 </div> 938 939 <button class="fc-zoom__button fc-zoom__button--in" id="zoom-toggle"> 940 <span class="fc-zoom__button-text">Toggle Zoom</span> 941 <span class="fc-zoom__icon fc-zoom__icon--in"> 942 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 943 <g fill-rule="nonzero"> 944 <path d="M69.122 3c17.666 0 34.278 6.884 46.77 19.38 22.457 22.45 25.339 57.147 8.703 82.774l32.368 32.348c5.382 5.363 5.382 14.086.006 19.466a13.737 13.737 0 01-9.738 4.032 13.73 13.73 0 01-9.744-4.032l-32.357-32.349c-10.63 6.93-23.023 10.668-36.008 10.668-17.67 0-34.283-6.884-46.776-19.38-25.795-25.782-25.795-67.745 0-93.528C34.84 9.88 51.451 3 69.122 3zm.006 17.21c-13.071 0-25.355 5.096-34.607 14.34-19.078 19.084-19.078 50.12 0 69.192 9.246 9.244 21.542 14.34 34.607 14.34 13.065 0 25.355-5.096 34.602-14.328 19.077-19.084 19.077-50.12 0-69.204-9.247-9.244-21.53-14.34-34.602-14.34z" /> 945 <path d="M77.737 37.683H60.56v22.89H37.683v17.175H60.56v22.878h17.176V77.748h22.889V60.573h-22.89z" /> 946 </g> 947 </svg> 948 </span> 949 <span class="fc-zoom__icon fc-zoom__icon--out"> 950 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 951 <g fill-rule="nonzero"> 952 <path d="M69.122 3c17.666 0 34.278 6.884 46.77 19.38 22.457 22.45 25.339 57.147 8.703 82.774l32.368 32.348c5.382 5.363 5.382 14.086.006 19.466a13.737 13.737 0 01-9.738 4.032 13.73 13.73 0 01-9.744-4.032l-32.357-32.349c-10.63 6.93-23.023 10.668-36.008 10.668-17.67 0-34.283-6.884-46.776-19.38-25.795-25.782-25.795-67.745 0-93.528C34.84 9.88 51.451 3 69.122 3zm.006 17.21c-13.071 0-25.355 5.096-34.607 14.34-19.078 19.084-19.078 50.12 0 69.192 9.246 9.244 21.542 14.34 34.607 14.34 13.065 0 25.355-5.096 34.602-14.328 19.077-19.084 19.077-50.12 0-69.204-9.247-9.244-21.53-14.34-34.602-14.34z" /> 953 <path d="M60.56 60.573H37.684v17.175h62.943V60.573h-22.89z" /> 954 </g> 955 </svg> 956 </span> 957 </button> 958 </div> 959 960 <div class="fc-zoom__thumbs" id="zoom-gallery"> 961 @{ i = 0; } 962 @foreach (var zoomSet in zoomList) 963 { 964 string[,] imgSet = zoomSet.Value; 965 string imgId = string.Format("img_0{0}", zoomSet.Key); 966 <a class="fc-zoom__link" href="@imgSet[0, 1]" data-image-target="zoom-full-image-@i" data-image="" data-zoom-image="@imgSet[0, 2]"> 967 <img class="fc-zoom__thumb" src="@imgSet[0, 0]" alt="@GetString("Ecom:Product.Name")"> 968 </a> 969 i++; 970 971 } 972 </div> 973 } 974 </div> 975 976 </div> 977 978 979 980 <div> 981 982 <ul class="m-btn-menu-secondary print-hide"> 983 @{ 984 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 985 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 986 } 987 988 @if (imagesCount + brochCount < assets.Count()) 989 { 990 <li> 991 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="#collapseThree" 992 role="button" 993 data-toggle="collapse" 994 data-parent="#productdownload" 995 id="productDownloadButton" 996 aria-controls="collapseThree">@Translate("ProductDownloads", "Product Downloads")</a> 997 </li> 998 } 999 1000 @{ 1001 if (hiResDownloads.Count() > 0) 1002 { 1003 List 1004 <string> 1005 fileList = new List<string> 1006 (); 1007 foreach (var file in hiResDownloads) 1008 { 1009 fileList.Add(file.FullPath); 1010 } 1011 1012 <li> 1013 <form method="post" id="downloadImagesForm"> 1014 <input type="hidden" name="ProductNumber" value="@productNumber" /> 1015 <input type="hidden" name="ProductName" value="@GetString("Ecom:Product.Name")" /> 1016 @GetButton(fileList, "Product") 1017 </form> 1018 1019 </li> 1020 } 1021 } 1022 1023 @{ 1024 string printShout = Translate("SaveOrPrint", "Save or Print your Product PDF "); 1025 } 1026 1027 <li> 1028 1029 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1030 role="button" id="productSheetButton" data-target="#CreatePdf" name="catalogPublishing" data-productid="@GetString(" Ecom:Product.ID")" data-productnumber="@productNumber" data-variantid="@GetString(" Ecom:Product.VariantID")" data-toggle="modal" data-request="technicalsheet" data-shout="@printShout">@Translate("ProductSheet", "PDF Product Sheet")</a> 1031 1032 <ul class="dropdown-menu" role="menu" style="position: relative; width: 100%; clear: both; margin-left: 0px; margin-top: 0px;"> 1033 <li> 1034 <a href="" 1035 data-target="#CreatePdf" 1036 name="catalogPublishing" 1037 data-productid="@GetString(" Ecom:Product.ID")" 1038 data-productnumber="@productNumber" 1039 data-variantid="@GetString(" Ecom:Product.VariantID")" 1040 data-toggle="modal" 1041 data-request="productsheet" 1042 data-shout="@printShout">@Translate("ProductSheet", "Product Sheet")</a> 1043 </li> 1044 <li> 1045 <a href="" 1046 data-target="#CreatePdf" 1047 name="catalogPublishing" 1048 data-productid="@GetString(" Ecom:Product.ID")" 1049 data-productnumber="@productNumber" 1050 data-variantid="@GetString(" Ecom:Product.VariantID")" 1051 data-toggle="modal" 1052 data-request="technicalsheet" 1053 data-shout="@printShout">@Translate("TechnicalSheet", "Technical Sheet")</a> 1054 </li> 1055 </ul> 1056 1057 </li> 1058 1059 @*<li> 1060 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" data-toggle="modal" data-target="#CreateCatalog" name="catalogPublishing" role="button" data-parent="#catalogue">Create Catalogue</a> 1061 </li>*@ 1062 @*<li> 1063 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1064 role="button" 1065 data-toggle="collapse" 1066 data-parent="#productdownload" 1067 id="productSheetButtonz" 1068 aria-controls="collapseFour" onclick="javascript:window.print();">@Translate("ProductSheet", "Product Sheet") (Print)</a> 1069 </li>*@ 1070 1071 @*<li>Check this again do we add a master with default Variant combinatiions to my product collection?? button is hidden.</li>*@ 1072 @*<li>@GetString("Ecom:Product.SelectedVariantComboName")||Variant Group Link: @GetString("Ecom:Product.VariantLinkGroup") |**| @GetLoop("VariantCombinations").Count()</li>*@ 1073 1074 @*<li>@prod.Id||@GetString("Ecom:Product.LanguageID") || @GetString("Ecom:Product.Number") || @prod.IsVariantMaster</li>*@ 1075 @*<li>Product Number: @GetString("Ecom:Product.Number") || Product Variant ID: ( @GetString("Ecom:Product.VariantID") ) || Variant Combinations Count: @GetLoop("VariantCombinations").Count() ZZ Product Variant Count: @GetInteger("Ecom:Product.VariantCount")</li>*@ 1076 1077 1078 @*@if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || GetLoop("VariantCombinations").Count() == 1) 1079 {*@ 1080 @*display the button if we have the appropriate script loaded (advanced-search-min.js)*@ 1081 @*<li>@GetString("Ecom:Product.VariantID") || @GetLoop("VariantCombinations").Count()</li>*@ 1082 1083 <li id="btnMyProductCollection"> 1084 1085 @if (isProductCollection) 1086 { 1087 <a class="m-btn-xs-more add btn btn-default btn-xs text-uppercase print-hide" href="" role="button" data-removeproductlist="@productNumber" data-addproductlist=""><span>@Translate("RemoveFromCollection", "Remove from my Collection")</span></a> 1088 } 1089 else 1090 { 1091 <a class="m-btn-xs-more add btn btn-default btn-xs text-uppercase print-hide" href="" role="button" data-removeproductlist="" data-addproductlist="@collectionData"><span>@Translate("AddToCollection", "Add to my collection")</span></a> 1092 } 1093 1094 </li> 1095 @*}*@ 1096 1097 1098 @*only works if logged-in 1099 <li><a href="@GetString(" Ecom:Product.AddToList")">Add To List Do something else</a></li>*@ 1100 1101 @*@if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 1102 { 1103 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 1104 <a href="/default.aspx?id=@GetString(" Ecom:Product:Page.ID")&amp;productid=@GetString("Ecom:Product.ID")&amp;CatalogPublishingcmd =addtocatalog">Add to catalog</a> 1105 </li> 1106 } 1107 1108 @if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 1109 { 1110 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 1111 <a href="/default.aspx?CatalogPublishingcmd=preview">Catalog Publishing</a> 1112 </li> 1113 }*@ 1114 </ul> 1115 1116 </div> 1117 1118 <div class="panel-group" id="productdownload" role="tablist" aria-multiselectable="false"> 1119 1120 <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productDownloadButton" aria-expanded="true" style="height: 0px;"> 1121 1122 <div class="panel panel-default panel-body print-hide"> 1123 1124 @{ 1125 List<ProductAsset> certAssets = new List<ProductAsset>(); 1126 1127 if (thisPage.AreaID == 1) // For Global get all certificates 1128 { 1129 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 1130 } 1131 else 1132 { 1133 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith(currentCountry + "_")).ToList(); 1134 } 1135 1136 if (certAssets.Count() == 0) // if none are found try to get EN certificates 1137 { 1138 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("EN_")).ToList(); 1139 } 1140 if (certAssets.Count() == 0) // if none are found try to get GB certificates 1141 { 1142 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("GB_")).ToList(); 1143 } 1144 } 1145 1146 @if (certAssets.Count > 0) 1147 { 1148 <h5>@Translate("Certificates", "Certificates")</h5> 1149 <ul> 1150 @foreach (ProductAsset cert in certAssets) 1151 { 1152 1153 <li> 1154 <a href="@cert.uri" download="@cert.FileName"> 1155 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@cert.FileName</span> 1156 </a> 1157 </li> 1158 } 1159 </ul> 1160 } 1161 1162 1163 @{ 1164 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 1165 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 1166 } 1167 1168 @*<h1>Product Assy Instructions: @assemblyAssets.Count</h1>*@ 1169 @if (assemblyAssets.Count > 0) 1170 { 1171 <h5>@Translate("InstallationGuides", "Installation Guides")</h5> 1172 <ul> 1173 @foreach (ProductAsset assemblyInstns in assemblyAssets) 1174 { 1175 assemblyInstns.RelatedProduct = productNumber; 1176 1177 <li> 1178 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1179 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1180 </a> 1181 </li> 1182 } 1183 </ul> 1184 1185 } 1186 1187 @{ 1188 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1189 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1190 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1191 } 1192 1193 @*<h3>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</h3>*@ 1194 @if (relatedProductsAssemblyInstructions.Count > 0) 1195 { 1196 <h5>@Translate("DetailedInstallationGuides", "Detailed Installation Guides")</h5> 1197 @*<p>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</p>*@ 1198 <ul class="list-column list-inline"> 1199 @foreach (ProductAsset assemblyInstns in relatedProductsAssemblyInstructions) 1200 { 1201 <li> 1202 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1203 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1204 </a> 1205 </li> 1206 } 1207 </ul> 1208 } 1209 1210 @if (assemblyAssets.Count > 0) 1211 { 1212 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase productDownloadButton download" role="button" name="download" data-parent="Monteringsanvisningar" data-productnumber="@productNumber" data-productname="@GetString("Ecom:Product.Name")">@Translate("DownloadInstallationGuides", "Installation Guides")</a> 1213 } 1214 1215 @{ 1216 List<ProductAsset> inspAssets = new List<ProductAsset>(); 1217 inspAssets = FileSystem.GetPdfFilesFromDirectoryBySiteCulture("/Files/System/ProductCollectionDownloads/InspectionMaintenance", "_" + currentlanguage.ToUpper()); 1218 } 1219 1220 @if (inspAssets != null && inspAssets.Count > 0) 1221 { 1222 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1223 1224 <ul> 1225 @foreach (ProductAsset pdf in inspAssets) 1226 { 1227 <li> 1228 <a href="@pdf.uri" download="@pdf.FileName"> 1229 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@pdf.FileName</span> 1230 </a> 1231 </li> 1232 } 1233 </ul> 1234 } 1235 else 1236 { 1237 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1238 1239 <ul> 1240 <li> 1241 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Playground Equipment I&M guide_EN.pdf" download="Playground Equipment I&M Guide"> 1242 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Playground Equipment I&M Guide</span> 1243 </a> 1244 </li> 1245 <li> 1246 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Sports and fitness I&M guide_EN.pdf" download="Sports and Fitness I&M Guide"> 1247 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Sports and Fitness I&M Guide</span> 1248 </a> 1249 </li> 1250 </ul> 1251 1252 } 1253 1254 1255 @{ 1256 List<ProductAsset> 1257 dwgAssets = new List<ProductAsset> 1258 (); 1259 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 1260 } 1261 1262 @if (dwgAssets.Count > 0) 1263 { 1264 <h5>@Translate("DWGFiles", "DWG Files")</h5> 1265 <ul> 1266 @foreach (ProductAsset dwg in dwgAssets) 1267 { 1268 <li> 1269 <a href="@dwg.uri" download="@dwg.FileName"> 1270 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/dwg_small.gif" /></span><span>@dwg.FileName</span> 1271 </a> 1272 </li> 1273 } 1274 </ul> 1275 } 1276 1277 <h5>@Translate("GeneralInformation", "General Information")</h5> 1278 <ul> 1279 @if (thisPage.AreaID == 2) 1280 { 1281 <li><a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_SE.pdf" download="" target="_blank"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("GeneralInformation", "General Information")</span></a></li> 1282 <li><a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_SE.pdf" download="" target="_blank"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("TechnicalInformation", "Technical Information")</span></a></li> 1283 } 1284 else 1285 { 1286 <li><a href="Files/System/ProductCollectionDownloads/General Information/hags-general-info_EN.pdf" download="" target="_blank"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("GeneralInformation", "General Information")</span></a></li> 1287 <li><a href="Files/System/ProductCollectionDownloads/General Information/hags-technical-specs_EN.pdf" download="" target="_blank"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("TechnicalInformation", "Technical Information")</span></a></li> 1288 } 1289 1290 </ul> 1291 </div> 1292 1293 </div> 1294 1295 <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productSheetButton" aria-expanded="true" style="height: 0px;"> 1296 1297 <div class="panel-body print-hide"> 1298 <p>Printed</p> 1299 </div> 1300 1301 </div> 1302 1303 </div> 1304 <div id="product-collection-instructions" class="product-collection-instructions"> 1305 <img src="/Files/Templates/Designs/HagsCore/res/img/buttons/basket.jpg" /><h4>@Translate("AddToCollection", "Add to my collection")?</h4> 1306 <p>@Translate("product-collection-instructions-copy", "Simply click on ‘Add to my collection’ and the product will added to the basket located in the site header. Once you have added products to a collection you will be able to print out a product catalogue, download installation guides, images and DWG files or request a quote - all based on the products you’ve added.")</p> 1307 </div> 1308 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 1309 { 1310 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.AreaID); 1311 <p class="m-cta-call print-hide"><span>@Translate("CallOurSalesTeamOn", "Call a member of our team on") <a href="#"><strong>@salesPhoneNumber</strong></a> @Translate("OrUseOur", "or use our") <a href="@contactUsLink">@Translate("ContactForm", "Contact Form")</a></span></p> 1312 } 1313 1314 1315 </div> 1316 </div> <!-- row --> 1317 </div> <!-- container-fluid --> 1318 </div> 1319 1320 @*Product Options*@ 1321 @if (GetLoop("VariantCombinations").Count() > 0) 1322 { 1323 <div class="m-sort m-theme-background-lightgrey product-options print-hide"> 1324 <div class="l-page"> 1325 <div class="container-fluid"> 1326 <div class="row"> 1327 <div> 1328 <h4 class="m-panel-title panel-title" style="padding-right:12px;padding-bottom:12px;width:auto;display:block;float:left;">@Translate("ProductOptions", "Product Options") (<span id="resultCount">@GetLoop("VariantCombinations").Count()</span>)</h4> 1329 </div> 1330 <form class="form-inline"> 1331 <div id="filter-variants"> 1332 1333 @if (anchoringOptions.Results.Count() > 0) 1334 { 1335 <div class="form-container"> 1336 <div class="form-group"> 1337 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 1338 <select class="form-control valid third" id="filter-anchoring" name="anchoring"> 1339 1340 @if (anchoringOptions.Results.Count() > 1) 1341 { 1342 <option value="0">@Translate("Any", "Any")</option> 1343 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 1344 { 1345 <option value="@anchor.Value">@anchor.Name</option> 1346 } 1347 } 1348 else 1349 { 1350 ResultField result = anchoringOptions.Results.FirstOrDefault(); 1351 <option value="@result.Value">@result.Name</option> 1352 } 1353 1354 </select> 1355 </div> 1356 1357 </div> 1358 } 1359 1360 @if (colourOptions.Results.Count() > 0) 1361 { 1362 <div class="form-container"> 1363 1364 <div class="form-group"> 1365 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 1366 <select class="form-control valid first" id="filter-colour" name="colour"> 1367 1368 @if (colourOptions.Results.Count() > 1) 1369 { 1370 <option value="0">@Translate("Any", "Any")</option> 1371 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 1372 { 1373 <option value="@colour.Value">@colour.Name</option> 1374 } 1375 } 1376 else 1377 { 1378 ResultField result = colourOptions.Results.FirstOrDefault(); 1379 <option value="@result.Value">@result.Name</option> 1380 } 1381 1382 1383 1384 </select> 1385 </div> 1386 1387 </div> 1388 } 1389 1390 @if (optionOptions.Results.Count() > 0) 1391 { 1392 <div class="form-container"> 1393 1394 <div class="form-group"> 1395 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 1396 <select class="form-control valid" id="filter-options" name="options"> 1397 1398 @if (optionOptions.Results.Count() > 1) 1399 { 1400 <option value="0">@Translate("Any", "Any")</option> 1401 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 1402 { 1403 <option value="@option.Value">@option.Name</option> 1404 } 1405 } 1406 else 1407 { 1408 ResultField result = optionOptions.Results.FirstOrDefault(); 1409 <option value="@result.Value">@result.Name</option> 1410 } 1411 </select> 1412 </div> 1413 1414 </div> 1415 } 1416 1417 </div> 1418 </form> 1419 </div> 1420 </div> 1421 </div> 1422 </div> 1423 1424 1425 <div class="l-page print-hide"> 1426 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1427 1428 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1429 { 1430 var colourOption = string.Empty; 1431 var optionOption = string.Empty; 1432 var anchorOption = string.Empty; 1433 var materialOption = string.Empty; 1434 var colourId = string.Empty; 1435 var optionId = string.Empty; 1436 var anchorId = string.Empty; 1437 var materialId = string.Empty; 1438 var selectedVariant = string.Empty; 1439 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1440 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1441 1442 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1443 { 1444 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1445 { 1446 1447 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1448 { 1449 1450 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1451 { 1452 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1453 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1454 } 1455 1456 } 1457 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1458 { 1459 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1460 { 1461 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1462 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1463 } 1464 } 1465 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1466 { 1467 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1468 { 1469 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1470 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1471 } 1472 } 1473 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1474 { 1475 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1476 { 1477 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1478 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1479 } 1480 } 1481 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1482 { 1483 selectedVariant = "selected-variant"; 1484 } 1485 } 1486 1487 } 1488 1489 <div class="m-attractor @selectedVariant" style="margin-bottom: 4em;"> 1490 1491 <div class="m-attractor-visual" style="height:180px;"> 1492 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1493 { 1494 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="img-responsive m-product-thumb" /></a> 1495 } 1496 else 1497 { 1498 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1499 } 1500 </div> 1501 1502 <input type="hidden" name="prop-colour" value="@colourId" /> 1503 <input type="hidden" name="prop-anchoring" value="@anchorId" /> 1504 <input type="hidden" name="prop-option" value="@optionId" /> 1505 1506 <div class="m-attractor-info m-attractor-info-product"> 1507 1508 1509 @if (thisPage.AreaID == 7) /*UK*/ 1510 { 1511 string ukId = ProductFieldValues.GetUkProductNumber(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), thisPage.Area.EcomLanguageId); 1512 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@ukId.ToString()</a></h3> 1513 } 1514 else 1515 { 1516 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@variantCombinations.GetString("Ecom:VariantCombination.Product.Number")</a></h3> 1517 } 1518 1519 <div class="m-attractor-info m-attractor-info-product"> 1520 <p>@optionOption<br /> @colourOption - @anchorOption</p> 1521 </div> 1522 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")" role="button">@Translate("ProductDetails", "Product Details")</a> 1523 </div> 1524 </div> 1525 1526 } 1527 </div> 1528 1529 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1530 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1531 </div> 1532 </div> 1533 } 1534 1535 @* Play Functions*@ 1536 @if (relatedProducts.Any()) 1537 { 1538 int count = relatedProducts.Count(); 1539 <div class="m-heading m-theme-background-lightgrey print-hide"> 1540 <div class="l-page"> 1541 <div class="container-fluid"> 1542 <h4 class="m-panel-title">@Translate("PlayFunctions", "Play Functions")</h4> 1543 </div> <!-- container-fluid --> 1544 </div> <!-- l-page --> 1545 </div> 1546 1547 <div class="l-page play-functions print-hide" style="margin-bottom: 3em;"> 1548 <div class="box-slider-content" id="related-products-slider-content"> 1549 1550 @foreach (Product relatedProduct in relatedProducts) 1551 { 1552 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(relatedProduct.Number, AssetType.Images, false); 1553 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1554 1555 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1556 <div class="m-attractor"> 1557 <div class="m-attractor-visual"> 1558 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1559 { 1560 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1561 } 1562 else 1563 { 1564 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1565 } 1566 </div> 1567 <div class="m-attractor-info m-attractor-info-product"> 1568 <h3 class="m-theme-after-yellow m-theme-border-yellow">@relatedProduct.Name</h3> 1569 1570 @if (!string.IsNullOrWhiteSpace(relatedProduct.LongDescription)) 1571 { 1572 <div class="show-read-more" data-charlength="60" data-txtreadmore="@Translate("ReadMore","Read More")" data-txtreadless="@Translate("ReadLess","Read Less")">@relatedProduct.LongDescription</div> 1573 } 1574 1575 1576 </div> <!-- attractor-info --> 1577 </div> <!-- attractor --> 1578 </div> 1579 } 1580 1581 </div> <!-- box-slider-content --> 1582 </div><!-- l-page --> 1583 } 1584 1585 @if (thisPage.AreaID != 2 && productFunctions.Count > 0) 1586 { 1587 <div class="play-values"> 1588 <div class="m-heading m-theme-background-lightgrey print-hide"> 1589 <div class="l-page"> 1590 <div class="container-fluid"> 1591 <h4 class="m-panel-title">Play Values</h4> 1592 </div> 1593 <div class="m-decal-container" style="width: 100%; display: block; float: left;"> 1594 <div class="m-decal"> 1595 <ul class="list-inline"> 1596 @foreach (var d in productFunctions) 1597 { 1598 string image = "pf_" + d.Value + ".png"; 1599 <li class="decal"> 1600 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="" data-original-title="@d.Name"> 1601 <img src="Files/Templates/Designs/HagsCore/res/img/icons/playfunctions/@image" style="width: 120px; background-color: rgb(171 208 55); padding: 4px 0px 2px 0px;" alt="@d.Name"> 1602 <h5 class="">@d.Name</h5> 1603 </div> 1604 </li> 1605 } 1606 </ul> 1607 </div> 1608 </div> 1609 </div> 1610 </div> 1611 </div> 1612 } 1613 1614 @*Related Component Products*@ 1615 @*@if (relatedComponentProducts.Any()) 1616 { 1617 int count = relatedComponentProducts.Count(); 1618 <div class="m-heading m-theme-background-lightgrey print-hide"> 1619 <div class="l-page"> 1620 <div class="container-fluid"> 1621 <h4 class="m-panel-title">@Translate("RelatedProducts", "Related Products")</h4> 1622 </div> <!-- container-fluid --> 1623 </div> <!-- l-page --> 1624 </div> 1625 1626 <div class="l-page play-functions print-hide" style="margin-bottom: 3em;"> 1627 <div class="box-slider-content" id="related-products-slider-content"> 1628 1629 @foreach (Product product in relatedComponentProducts) 1630 { 1631 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(product.Number, AssetType.Images, false); 1632 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1633 1634 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1635 <div class="m-attractor"> 1636 <div class="m-attractor-visual"> 1637 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1638 { 1639 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1640 } 1641 else 1642 { 1643 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1644 } 1645 </div> 1646 <div class="m-attractor-info m-attractor-info-product"> 1647 <h3 class="m-theme-after-yellow m-theme-border-yellow">@product.Name</h3> 1648 </div> <!-- attractor-info --> 1649 </div> <!-- attractor --> 1650 </div> 1651 } 1652 1653 </div> <!-- box-slider-content --> 1654 </div><!-- l-page --> 1655 }*@ 1656 1657 1658