My Product Collection basket

My Product Collection?

Fill your basket with products by clicking "Add to my collection" so that you can create and print your own custom brochure, download the files you need for all the products in one go, or to request a quote.

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 HagsWeb.Library.Methods.ProductFilter.ProductFilter.<>c.<GetRelatedProducts>b__6_0(Product a)
   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.GroupedEnumerable`3.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at HagsWeb.Library.Methods.ProductFilter.ProductFilter.GetRelatedProducts(String productNumber, String productVariant, String relatedproductGroupName, String lang)
   at CompiledRazorTemplates.Dynamic.RazorEngine_bb9c1ca36731490cac3670509220eafb.Execute() in B:\Hags_Live_A\Files\Templates\Designs\HagsCore\eCom\Product\Product.cshtml:line 442
   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.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.Format("CCAddToMyLists={0}&CCAddToListVariantID={1}&CCAreaID={2}&CCAddToListCulture={3}&CCAddToListLanguageID={4}#{5}", 274 GetString("Ecom:Product.Number"), GetString("Ecom:Product.VariantID"), GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.LanguageID"), siteSection); 275 276 277 // New Age Ranges. Some Template Tags dont work very well in upgraded DW version 9.7.2 278 List<string> ageRanges = new List<string>(); 279 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.AgeRange"))) 280 { 281 ageRanges = ProductAgeRanges.GetAgeRanges(GetString("Ecom:Product:Field.AgeRange"), GetString("Ecom:Product.LanguageID")); 282 } 283 284 // New Product Functions. Some Template Tags dont work very well in upgraded DW version 9.7.2 285 List<ResultField> productFunctions = new List<ResultField>(); 286 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductFunctions"))) 287 { 288 productFunctions = ProductFieldValues.GetProductFieldOptions(GetString("Ecom:Product:Field.ProductFunctions"), "ProductFunctions", GetString("Ecom:Product.LanguageID")); 289 } 290 291 // For filtering the variants of this product 292 ResultSet colourOptions = new ResultSet(); 293 ResultSet materialOptions = new ResultSet(); 294 ResultSet anchoringOptions = new ResultSet(); 295 ResultSet optionOptions = new ResultSet(); 296 297 298 string selectedColourVariant = string.Empty; 299 string selectedAnchoringVariant = string.Empty; 300 string selectedAnchoringIcon = string.Empty; 301 string selectedMaterialVariant = string.Empty; 302 string selectedOptionVariant = string.Empty; 303 //List<VariantOption> selectedProductOptions = new List<VariantOption>(); 304 305 306 307 if (GetInteger("Ecom:Product.VariantCount") > 0) 308 { 309 foreach (var variantGroup in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) // Remove All Date Variants 310 { 311 int optionsCount = variantGroup.GetLoop("VariantAvailableOptions").Count(); 312 313 if (optionsCount > 0) 314 { 315 if (!string.IsNullOrEmpty("Ecom:Product.SelectedVariantComboID")) // optionsCount == 1 316 { 317 foreach (var availableOption in variantGroup.GetLoop("VariantAvailableOptions")) 318 { 319 320 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "S55") 321 { 322 colourOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 323 324 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 325 { 326 327 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 }); 328 329 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 330 { 331 selectedColourVariant = availableOption.GetString("Ecom:VariantOption.Name"); 332 } 333 } 334 } 335 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP1") 336 { 337 materialOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 338 339 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 340 { 341 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 }); 342 343 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 344 { 345 selectedMaterialVariant = availableOption.GetString("Ecom:VariantOption.Name"); 346 } 347 } 348 } 349 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP3") 350 { 351 anchoringOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 352 353 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 354 { 355 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 }); 356 357 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 358 { 359 selectedAnchoringVariant = availableOption.GetString("Ecom:VariantOption.Name"); 360 selectedAnchoringIcon = availableOption.GetString("Ecom:VariantOption.ID") + ".png"; 361 } 362 } 363 } 364 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP4") 365 { 366 optionOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 367 368 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 369 { 370 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 }); 371 372 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 373 { 374 selectedOptionVariant = availableOption.GetString("Ecom:VariantOption.Name"); 375 } 376 } 377 378 } 379 } 380 } 381 } 382 } 383 } 384 385 386 string assemblyInstructionsProductNumber = productNumber; 387 388 // 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 389 // Assembly Instructions 390 Product product = new ProductService().GetProductById(GetString("Ecom:Product.ID"), GetString("Ecom:Product.VariantID"), GetString("Ecom:Product.LanguageID")); 391 392 // Check if its a Master product. 393 if (!product.IsVariantMaster) 394 { 395 assemblyInstructionsProductNumber = new ProductService().GetProductsAndVariantsByProduct(product) 396 .FirstOrDefault<Product>(n => string.IsNullOrEmpty(n.VariantId)).Number; 397 } 398 399 // Check if its a Master product. 400 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 401 402 //Tuple<string, string, string, string, string> optionsTuple; 403 string VariantId = string.Empty; 404 if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || !string.IsNullOrEmpty(GetString("Ecom:Product.ProductDefaultVariantComboId")) || !string.IsNullOrEmpty(GetString("Ecom:Product:Field.ProductVariantFallback"))) 405 { 406 VariantId = string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) ? GetString("Ecom:Product.ProductDefaultVariantComboId") : GetString("Ecom:Product.VariantID"); 407 408 // Implementation of Variant Fallback overrides if no Variant is specified Original Product.cshtml is maintained in ProductV21TESTING.cshtml 409 if (string.IsNullOrEmpty(VariantId)) 410 { 411 VariantId = GetString("Ecom:Product:Field.ProductVariantFallback"); 412 } 413 414 //optionsTuple = ProductFieldValues.GetProductOptions(VariantId, GetString("Ecom:Product.LanguageID")); 415 416 //selectedColourVariant = optionsTuple.Item1; 417 //selectedAnchoringVariant = optionsTuple.Item2; 418 //selectedMaterialVariant = optionsTuple.Item3; 419 //selectedOptionVariant = optionsTuple.Item4; 420 //selectedAnchoringIcon = optionsTuple.Item5; 421 //selectedProductOptions = optionsTuple.Item6; // used to filter related products by the variant values of this product 422 423 } 424 425 // Related Products and their Assembly Instructions 426 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 427 List<Product> relatedComponentProducts = new List<Product>(); 428 List<ProductAsset> relatedProductsAssemblyInstructions = new List<ProductAsset>(); 429 430 string variantOptions = selectedMaterialVariant + " " + selectedAnchoringVariant + " " + selectedOptionVariant + " " + selectedColourVariant; 431 432 if (GetInteger("Ecom:Product.RelatedCount") > 0) 433 { 434 // Play Functions // 435 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 436 { 437 relatedProducts = ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), VariantId, "Product Modules", GetString("Ecom:Product.LanguageID")); 438 } 439 440 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Components") != null) 441 { 442 relatedComponentProducts = ProductFilter.GetRelatedProducts(assemblyInstructionsProductNumber, VariantId, "Product Components", GetString("Ecom:Product.LanguageID")); 443 //// Lookup Assembly Instructions Assets 444 foreach (Product relatedComponentProduct in relatedComponentProducts) 445 { 446 if (relatedComponentProduct != null) 447 { 448 List<ProductAsset> productAssemblyInstructions = AssetManager_Repository.GetAssets(relatedComponentProduct.Number, AssetType.AssemblyInstructions, true); 449 if (productAssemblyInstructions.Any()) 450 { 451 //List<ProductAsset> result = productAssemblyInstructions.Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName == pa.FileName)).ToList(); 452 List<ProductAsset> result = productAssemblyInstructions 453 .Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName.Substring(8, pa2.FileName.Length - 8) == pa.FileName.Substring(8, pa.FileName.Length - 8))).ToList(); 454 result.ForEach(n => n.RelatedProduct = productNumber); 455 relatedProductsAssemblyInstructions.AddRange(result); 456 } 457 } 458 } 459 } 460 } 461 462 // Test for Related Products Assembly instructions 463 //SessionManager.SetSession( productNumber + "_AssemblyInstructions", new List<ProductAsset>(relatedProductsAssemblyInstructions)); 464 465 // Find the Parent top Group // Not used now scope changed 466 //Enum enumProductType = DWUtilities.GetTopGroupForProduct(product.Groups.ToList()); 467 468 // Testing for Brand Banner Image 469 //ProductFieldValue productBrand = product.ProductFieldValues.GetProductFieldValue("Brand"); 470 //string bannerImage = string.Empty; 471 //FieldOption brandFieldOption = new FieldOption(); 472 473 474 //if (productBrand != null) 475 //{ 476 // brandFieldOption = FieldOption.GetOptionsByFieldId(productBrand.ProductField.Id).FirstOrDefault(n => n.Value == productBrand.Value.ToString()); 477 // if (brandFieldOption != null) 478 // { 479 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/" + brandFieldOption.Name + "_Banner.jpg"; 480 // } 481 // else if (enumProductType != null) 482 // { 483 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/" + enumProductType.ToString() + "_Banner.jpg"; 484 // } 485 // else 486 // { 487 // bannerImage = "/Files/Templates/HagsModules/HagsPDFTemplates/Original/BrochureImages/Hags_Banner.jpg"; 488 // } 489 490 //} 491 } 492 493 494 <!--Templates/Designs/HagsCore/eCom/Product/Product.cshtml--> 495 496 @Scripts.Render("~/bundle/ProductFilter") 497 498 @ProductPdfHelper(productCollectionItems, GetString("Ecom:Product.LanguageID")) 499 500 <input type="hidden" id="productVariantId" value="@GetString("Ecom:Product.VariantID")"> 501 <input type="hidden" id="productCollectionData" value="@collectionData"> 502 503 <div class="m-heading m-theme-background-yellow m-theme-color-white breadcrumb product"> 504 <div class="l-page"> 505 <div class="container-fluid"> 506 @{ 507 string breadcrumb = HagsPages.GetThisPageNavigation(pageUrl, GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.Name"), variantOptions); // " "; // 508 } 509 <div class="m-menu-primary breadcrumb"> 510 <nav class="text-centre text-uppercase"> 511 @breadcrumb 512 </nav> 513 </div> 514 515 </div> <!-- container-fluid --> 516 </div> <!-- l-page --> 517 </div> <!-- m-heading --> 518 <div class="l-page"> 519 <div class="container-fluid"> 520 521 @*<p>@ipPriceAllowed || ShopID = @GetString("Ecom:Product.DefaultShopID")</p> 522 <p> Product? @GetString("Ecom:Product.ID") || @GetString("Ecom:Product.Number")</p> 523 <p> isVariantMaster? @product.IsVariantMaster</p> 524 <p> Variant? @GetString("Ecom:Product.VariantID") </p> 525 <p> FallbackVariant? @GetString("Ecom:Product:Field.ProductVariantFallback") </p> 526 <p>Material(@selectedMaterialVariant) || Option(@selectedOptionVariant)<br /> 527 Colour(@selectedColourVariant) &ndash; 528 Anchoring(@selectedAnchoringVariant || @selectedAnchoringIcon ) </p> 529 <p> Variant Options? @variantOptions || @product.VariantId</p> 530 <p> Age Range? @GetString("Ecom:Product:Field.AgeRange")</p> 531 <p>@themeTag || @GetGlobalValue("Global:Page.NavigationTag")</p>*@ 532 533 <!--<p> Customers also saw: @GetString("eCom:Related.CustomersWhoSawThisAlsoSaw.Count") Products</p> 534 <p> You have seen these: @GetString("eCom:Related.YouHaveSeenTheseProducts.Count") Products</p> 535 <p> What about these: @GetString("eCom:Related.WhatAboutTheseProducts.Count") Products</p>--> 536 537 538 <div class="row"> 539 540 <div class="col-sm-5"> 541 542 <h1>@GetString("Ecom:Product.Name")</h1> 543 544 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.ShortDescription"))) 545 { 546 <p>@GetString("Ecom:Product.ShortDescription")</p> 547 } 548 549 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product.LongDescription"))) 550 { 551 <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> 552 553 } 554 555 <div style="display:block;float:left;margin-right:24px;"> 556 @if (thisPage.AreaID == 2 || thisPage.AreaID == 4) 557 { 558 //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 559 // with the appropriate translation 560 561 if (GetBoolean("Ecom:Product:Field.SwedishStock")) 562 { 563 string fastDeliveryTxt = thisPage.AreaID == 2 ? "Snabb Leverans" : "Hurtig Levering"; 564 string flagImg = thisPage.AreaID == 2 ? "flag_se.png" : "flag_dk.png"; 565 566 <div style="float:left;display:block;"> 567 <h3 id="displayproductnumber"> 568 @productNumber-1 569 </h3> 570 </div> 571 <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"> 572 @*<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>*@ 573 <img src="/Admin/Resources/fonts/flags/4x3/se.svg" 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> 574 </div> 575 } 576 else 577 { 578 <div style="float:left;display:block;"> 579 <h3 id="displayproductnumber"> 580 @productNumber 581 </h3> 582 </div> 583 } 584 } 585 else if (thisPage.AreaID != 7) /*Not UK see line 503 below*/ 586 { 587 if (GetBoolean("Ecom:Product:Field.CentralStock")) 588 { 589 <div style="float:left;display:block;"> 590 <h3 id="displayproductnumber"> 591 @productNumber-2 592 </h3> 593 </div> 594 } 595 else 596 { 597 <div style="float:left;display:block;"> 598 <h3 id="displayproductnumber"> 599 @productNumber 600 </h3> 601 </div> 602 } 603 } 604 605 </div> 606 607 @if (!string.IsNullOrWhiteSpace(selectedAnchoringIcon ?? selectedAnchoringVariant)) 608 { 609 <div style="display:block;float:left;overflow:auto;margin-left:0px;width:100%" data-toggle="tooltip" data-placement="top" title="@Translate(" Anchoring", "Anchoring" ): @selectedAnchoringVariant"> 610 @{//Display the correct icon if available 611 bool isIcon = true; 612 isIcon = File.Exists(HttpContext.Current.Server.MapPath(@"Files/Templates/Designs/HagsCore/res/img/icons/anchoring/" + selectedAnchoringIcon)); 613 } 614 615 @if (isIcon) 616 { 617 <img src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" style="display:block;float:left;" /> 618 } 619 620 <p style="display: block; float: left; margin-left: 12px; margin-bottom: 0px;"> 621 @selectedMaterialVariant @selectedOptionVariant<br /> 622 @selectedColourVariant &ndash; @selectedAnchoringVariant 623 624 </p> 625 </div> 626 } 627 628 @if (GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0 && GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 629 { 630 <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")"> 631 <img src="Files/Templates/Designs/HagsCore/res/img/icons/whtstar.png" alt="s" style="display:block;float:left;" /> 632 <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> 633 </div> 634 } 635 636 <div class="m-decal-container" style="width:100%;display:block;float:left;"> 637 638 @* ageRanges *@ 639 <div class="m-decal"> 640 <ul class="list-inline"> 641 642 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 643 { 644 foreach (var range in ageRanges) 645 { 646 if (range.Trim() != "-") 647 { 648 <li class="decal"> 649 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.AgeRange.Name") @range"> 650 <img src="Files/Templates/Designs/HagsCore/res/img/decals/agerange.png" alt="@GetString(" Ecom:Product:Field.AgeRange.Name") @range" /> 651 <span class="decalvalue">@range</span> 652 </div> 653 </li> 654 } 655 } 656 } 657 658 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 659 { 660 <li class="decal"> 661 <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"> 662 663 <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" /> 664 665 <span class="decalvalue">@Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw"))</span> 666 667 </div> 668 </li> 669 } 670 671 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 672 { 673 <li class="decal"> 674 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.FallHeight.Name") @GetString("Ecom:Product:Field.FallHeight.Value.Raw")"> 675 676 <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")" /> 677 678 <span class="decalvalue">@GetString("Ecom:Product:Field.FallHeight.Value.Raw")</span> 679 680 </div> 681 </li> 682 } 683 684 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 685 { 686 <li class="decal"> 687 <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;"> 688 689 <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;" /> 690 691 <span class="decalvalue">@GetDouble("Ecom:Product:Field.SafetyArea.Value")</span> 692 693 </div> 694 </li> 695 } 696 697 @if (GetBoolean("Ecom:Product:Field.InclusivePlay.Value")) 698 { 699 <li class="decal"> 700 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="Inclusive Play"> 701 702 <img src="Files/Templates/Designs/HagsCore/res/img/decals/play-for-all-small.png" alt="Inclusive Play" /> 703 704 </div> 705 </li> 706 } 707 708 </ul> 709 </div> <!-- m-decals --> 710 </div> <!-- m-decals-container --> 711 @*Only UK and Sweden have Pricing at the moment*@ 712 @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*/ 713 { 714 string krPrice = GetInteger("Ecom:Product.DBPrice") == 0 ? Translate("RequestAQuote", "Kontakta oss") : GetString("Ecom:Product.Price.PriceFormatted").Replace(",00", ""); 715 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @krPrice</strong></p></div> 716 } 717 718 @if (thisPage.AreaID == 7) /*UK with special layout*/ 719 { 720 if (GetBoolean("Ecom:Product:Field.CentralStock")) 721 { 722 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")-2</p> 723 } 724 else 725 { 726 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")</p> 727 } 728 @* GL 15/02/2021 now remove all pricing for the UK (Also check pdf templates)*@ 729 @*if (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_")) 730 { 731 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")); 732 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @ukPrice </strong></p></div> 733 }*@ 734 735 } 736 737 <div class="col-sm-12 panel-group" style="display:block;float:left;width:100%;margin-top:18px;" id="accordion" role="tablist" aria-multiselectable="false"> 738 <div class="panel panel-default"> 739 <div class="panel-heading" role="tab" id="headingOne"> 740 <h4 class="m-panel-title panel-title"> 741 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne" class=""> 742 @Translate("ProductSpecifications", "Product Specifications") 743 </a> 744 </h4> 745 </div> 746 <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true"> 747 <div class="panel-body"> 748 <div id="product-left"> 749 <div class="padding"> 750 751 <div id="product-list-information" class="box-padding"> 752 753 <ul> 754 755 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 756 { 757 <li><span><strong>@GetString("Ecom:Product:Field.AgeRange.Name"):</strong></span> <span>@string.Join(", ", ageRanges)</span></li> 758 } 759 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 760 { 761 <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> 762 } 763 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 764 { 765 <li><span><strong>@GetString("Ecom:Product:Field.Length.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</span></li> 766 } 767 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 768 { 769 <li><span><strong>@GetString("Ecom:Product:Field.Width.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</span></li> 770 } 771 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 772 { 773 <li><span><strong>@GetString("Ecom:Product:Field.Height.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</span></li> 774 } 775 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 776 { 777 <li><span><strong>@GetString("Ecom:Product:Field.NetWeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.NetWeight.Value") kg</span></li> 778 } 779 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 780 { 781 <li><span><strong>@GetString("Ecom:Product:Field.Volume.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</span></li> 782 } 783 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 784 { 785 <li><span><strong>@GetString("Ecom:Product:Field.FallHeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</span></li> 786 } 787 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 788 { 789 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</span></li> 790 } 791 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 792 { 793 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaLength.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</span></li> 794 } 795 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 796 { 797 <li><span><strong>@GetString("Ecom:Product:Field.SafetyArea.Name"):</strong></span> <span>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</span></li> 798 } 799 800 </ul> 801 802 @*Anchoring from Variant*@ 803 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 804 { 805 string anchoringPage = DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.AreaID) + "#" + GetGlobalValue("Global:HagsTheme"); 806 807 if (!string.IsNullOrEmpty(anchoringPage)) 808 { 809 <a href="@anchoringPage" class="print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a> 810 } 811 812 } 813 814 </div> 815 816 </div> <!--! .padding --> 817 </div> 818 </div> 819 </div> 820 </div> 821 822 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Material"))) 823 { 824 <div class="panel panel-default"> 825 <div class="panel-heading" role="tab" id="headingTwo"> 826 <h4 class="m-panel-title panel-title"> 827 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo" class="collapsed"> 828 @GetString("Ecom:Product:Field.Material.Name") 829 </a> 830 </h4> 831 </div> 832 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true"> 833 <div class="panel-body"> 834 <div id="product-left"> 835 <div class="padding"> 836 837 838 <p>&nbsp;</p> 839 @{ 840 841 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"); 842 if (!string.IsNullOrEmpty(materialData)) 843 { 844 //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")); 845 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 846 847 if (dataXML != null) 848 { 849 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 850 //format.NumberGroupSeparator = ","; //for thousands 851 //format.NumberDecimalSeparator = "."; //the decimal seperator 852 853 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 854 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 855 856 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 857 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 858 859 var details = from dat in dataXML.Descendants("Item") 860 select new 861 { 862 material = dat.Element("material").Value, 863 //weight = dat.Element("kg").Value,// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 864 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 865 percent = Math.Round(Double.Parse(dat.Element("percent").Value, format), 1).ToString() // string.Format("{0:0.00}", Double.Parse(dat.Element("percent").Value)) 866 }; 867 868 <table class="table"> 869 <thead> 870 <tr> 871 <th>@GetString("Ecom:Product:Field.Material.Name")</th> 872 <th>kg</th> 873 <th>&#37;</th> 874 </tr> 875 </thead> 876 877 <tbody> 878 879 @foreach (var item in details) 880 { 881 <tr> 882 <td>@item.material</td> 883 <td>@item.weight</td> 884 <td>@item.percent</td> 885 </tr> 886 } 887 888 889 890 </tbody> 891 892 <tfoot> 893 <tr> 894 <td>&nbsp;</td> 895 <td><strong>@totalweight kg</strong></td> 896 <td><strong>@totalpercent&#37;</strong></td> 897 </tr> 898 </tfoot> 899 </table> <!--! #table-materials --> 900 } 901 } 902 903 } 904 905 </div> <!--! .padding --> 906 </div> 907 </div> 908 </div> 909 </div> 910 911 } 912 913 </div> 914 915 </div> 916 917 <div class="col-sm-7"> 918 919 <div class="image-gallery-container"> 920 921 <div class="fc-zoom"> 922 @*Zoom Product Images*@ 923 @if (zoomList.Count > 0) 924 925 { 926 <div class="fc-zoom__view"> 927 <div class="fc-zoom__target" id="zoom-target-1"> 928 @{ var i = 0; } 929 @foreach (var zoomSet in zoomList) 930 { 931 string[,] imgSet = zoomSet.Value; 932 string imgId = string.Format("img_0{0}", zoomSet.Key); 933 if (i == 0) 934 { 935 <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")"> 936 } 937 else 938 { 939 <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")"> 940 } 941 i++; 942 } 943 </div> 944 945 <button class="fc-zoom__button fc-zoom__button--in" id="zoom-toggle"> 946 <span class="fc-zoom__button-text">Toggle Zoom</span> 947 <span class="fc-zoom__icon fc-zoom__icon--in"> 948 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 949 <g fill-rule="nonzero"> 950 <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" /> 951 <path d="M77.737 37.683H60.56v22.89H37.683v17.175H60.56v22.878h17.176V77.748h22.889V60.573h-22.89z" /> 952 </g> 953 </svg> 954 </span> 955 <span class="fc-zoom__icon fc-zoom__icon--out"> 956 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 957 <g fill-rule="nonzero"> 958 <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" /> 959 <path d="M60.56 60.573H37.684v17.175h62.943V60.573h-22.89z" /> 960 </g> 961 </svg> 962 </span> 963 </button> 964 </div> 965 966 <div class="fc-zoom__thumbs" id="zoom-gallery"> 967 @{ i = 0; } 968 @foreach (var zoomSet in zoomList) 969 { 970 string[,] imgSet = zoomSet.Value; 971 string imgId = string.Format("img_0{0}", zoomSet.Key); 972 <a class="fc-zoom__link" href="@imgSet[0, 1]" data-image-target="zoom-full-image-@i" data-image="" data-zoom-image="@imgSet[0, 2]"> 973 <img class="fc-zoom__thumb" src="@imgSet[0, 0]" alt="@GetString("Ecom:Product.Name")"> 974 </a> 975 i++; 976 977 } 978 </div> 979 } 980 </div> 981 982 </div> 983 984 985 986 <div> 987 988 <ul class="m-btn-menu-secondary print-hide"> 989 @{ 990 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 991 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 992 } 993 994 @if (imagesCount + brochCount < assets.Count()) 995 { 996 <li> 997 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="#collapseThree" 998 role="button" 999 data-toggle="collapse" 1000 data-parent="#productdownload" 1001 id="productDownloadButton" 1002 aria-controls="collapseThree">@Translate("ProductDownloads", "Product Downloads")</a> 1003 </li> 1004 } 1005 1006 @{ 1007 if (hiResDownloads.Count() > 0) 1008 { 1009 List 1010 <string> 1011 fileList = new List<string> 1012 (); 1013 foreach (var file in hiResDownloads) 1014 { 1015 fileList.Add(file.FullPath); 1016 } 1017 1018 <li> 1019 <form method="post" id="downloadImagesForm"> 1020 <input type="hidden" name="ProductNumber" value="@productNumber" /> 1021 <input type="hidden" name="ProductName" value="@GetString("Ecom:Product.Name")" /> 1022 @GetButton(fileList, "Product") 1023 </form> 1024 1025 </li> 1026 } 1027 } 1028 1029 @{ 1030 string printShout = Translate("SaveOrPrint", "Save or Print your Product PDF "); 1031 } 1032 1033 <li> 1034 1035 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1036 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> 1037 1038 <ul class="dropdown-menu" role="menu" style="position: relative; width: 100%; clear: both; margin-left: 0px; margin-top: 0px;"> 1039 <li> 1040 <a href="" 1041 data-target="#CreatePdf" 1042 name="catalogPublishing" 1043 data-productid="@GetString("Ecom:Product.ID")" 1044 data-productnumber="@productNumber" 1045 data-variantid="@GetString("Ecom:Product.VariantID")" 1046 data-toggle="modal" 1047 data-request="productsheet" 1048 data-shout="@printShout">@Translate("ProductSheet", "Product Sheet")</a> 1049 </li> 1050 <li> 1051 <a href="" 1052 data-target="#CreatePdf" 1053 name="catalogPublishing" 1054 data-productid="@GetString("Ecom:Product.ID")" 1055 data-productnumber="@productNumber" 1056 data-variantid="@GetString("Ecom:Product.VariantID")" 1057 data-toggle="modal" 1058 data-request="technicalsheet" 1059 data-shout="@printShout">@Translate("TechnicalSheet", "Technical Sheet")</a> 1060 </li> 1061 </ul> 1062 1063 </li> 1064 1065 @*<li> 1066 <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> 1067 </li>*@ 1068 @*<li> 1069 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1070 role="button" 1071 data-toggle="collapse" 1072 data-parent="#productdownload" 1073 id="productSheetButtonz" 1074 aria-controls="collapseFour" onclick="javascript:window.print();">@Translate("ProductSheet", "Product Sheet") (Print)</a> 1075 </li>*@ 1076 1077 @*<li>Check this again do we add a master with default Variant combinatiions to my product collection?? button is hidden.</li>*@ 1078 @*<li>@GetString("Ecom:Product.SelectedVariantComboName")||Variant Group Link: @GetString("Ecom:Product.VariantLinkGroup") |**| @GetLoop("VariantCombinations").Count()</li>*@ 1079 1080 @*<li>@prod.Id||@GetString("Ecom:Product.LanguageID") || @GetString("Ecom:Product.Number") || @prod.IsVariantMaster</li>*@ 1081 @*<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>*@ 1082 1083 1084 @*@if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || GetLoop("VariantCombinations").Count() == 1) 1085 {*@ 1086 @*display the button if we have the appropriate script loaded (advanced-search-min.js)*@ 1087 @*<li>@GetString("Ecom:Product.VariantID") || @GetLoop("VariantCombinations").Count()</li>*@ 1088 1089 <li id="btnMyProductCollection"> 1090 1091 @if (isProductCollection) 1092 { 1093 <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> 1094 } 1095 else 1096 { 1097 <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> 1098 } 1099 1100 </li> 1101 @*}*@ 1102 1103 1104 @*only works if logged-in 1105 <li><a href="@GetString(" Ecom:Product.AddToList")">Add To List Do something else</a></li>*@ 1106 1107 @*@if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 1108 { 1109 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 1110 <a href="/default.aspx?id=@GetString(" Ecom:Product:Page.ID")&amp;productid=@GetString("Ecom:Product.ID")&amp;CatalogPublishingcmd =addtocatalog">Add to catalog</a> 1111 </li> 1112 } 1113 1114 @if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 1115 { 1116 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 1117 <a href="/default.aspx?CatalogPublishingcmd=preview">Catalog Publishing</a> 1118 </li> 1119 }*@ 1120 </ul> 1121 1122 </div> 1123 1124 <div class="panel-group" id="productdownload" role="tablist" aria-multiselectable="false"> 1125 1126 <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productDownloadButton" aria-expanded="true" style="height: 0px;"> 1127 1128 <div class="panel panel-default panel-body print-hide"> 1129 1130 @{ 1131 List<ProductAsset> certAssets = new List<ProductAsset>(); 1132 1133 if (thisPage.AreaID == 1) // For Global get all certificates 1134 { 1135 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 1136 } 1137 else 1138 { 1139 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith(currentCountry + "_")).ToList(); 1140 } 1141 1142 if (certAssets.Count() == 0) // if none are found try to get EN certificates 1143 { 1144 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("EN_")).ToList(); 1145 } 1146 if (certAssets.Count() == 0) // if none are found try to get GB certificates 1147 { 1148 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("GB_")).ToList(); 1149 } 1150 } 1151 1152 @if (certAssets.Count > 0) 1153 { 1154 <h5>@Translate("Certificates", "Certificates")</h5> 1155 <ul> 1156 @foreach (ProductAsset cert in certAssets) 1157 { 1158 1159 <li> 1160 <a href="@cert.uri" download="@cert.FileName"> 1161 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@cert.FileName</span> 1162 </a> 1163 </li> 1164 } 1165 </ul> 1166 } 1167 1168 1169 @{ 1170 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 1171 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 1172 } 1173 1174 @*<h1>Product Assy Instructions: @assemblyAssets.Count</h1>*@ 1175 @if (assemblyAssets.Count > 0) 1176 { 1177 <h5>@Translate("InstallationGuides", "Installation Guides")</h5> 1178 <ul> 1179 @foreach (ProductAsset assemblyInstns in assemblyAssets) 1180 { 1181 assemblyInstns.RelatedProduct = productNumber; 1182 1183 <li> 1184 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1185 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1186 </a> 1187 </li> 1188 } 1189 </ul> 1190 1191 } 1192 1193 @{ 1194 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1195 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1196 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1197 } 1198 1199 @*<h3>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</h3>*@ 1200 @if (relatedProductsAssemblyInstructions.Count > 0) 1201 { 1202 <h5>@Translate("DetailedInstallationGuides", "Detailed Installation Guides")</h5> 1203 @*<p>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</p>*@ 1204 <ul class="list-column list-inline"> 1205 @foreach (ProductAsset assemblyInstns in relatedProductsAssemblyInstructions) 1206 { 1207 <li> 1208 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1209 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1210 </a> 1211 </li> 1212 } 1213 </ul> 1214 } 1215 1216 @if (assemblyAssets.Count > 0) 1217 { 1218 <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> 1219 } 1220 1221 @{ 1222 List<ProductAsset> inspAssets = new List<ProductAsset>(); 1223 inspAssets = FileSystem.GetPdfFilesFromDirectoryBySiteCulture("/Files/System/ProductCollectionDownloads/InspectionMaintenance", "_" + currentlanguage.ToUpper()); 1224 } 1225 1226 @if (inspAssets != null && inspAssets.Count > 0) 1227 { 1228 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1229 1230 <ul> 1231 @foreach (ProductAsset pdf in inspAssets) 1232 { 1233 <li> 1234 <a href="@pdf.uri" download="@pdf.FileName"> 1235 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@pdf.FileName</span> 1236 </a> 1237 </li> 1238 } 1239 </ul> 1240 } 1241 else 1242 { 1243 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1244 1245 <ul> 1246 <li> 1247 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Playground Equipment I&M guide_EN.pdf" download="Playground Equipment I&M Guide"> 1248 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Playground Equipment I&M Guide</span> 1249 </a> 1250 </li> 1251 <li> 1252 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Sports and fitness I&M guide_EN.pdf" download="Sports and Fitness I&M Guide"> 1253 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Sports and Fitness I&M Guide</span> 1254 </a> 1255 </li> 1256 </ul> 1257 1258 } 1259 1260 1261 @{ 1262 List<ProductAsset> 1263 dwgAssets = new List<ProductAsset> 1264 (); 1265 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 1266 } 1267 1268 @if (dwgAssets.Count > 0) 1269 { 1270 <h5>@Translate("DWGFiles", "DWG Files")</h5> 1271 <ul> 1272 @foreach (ProductAsset dwg in dwgAssets) 1273 { 1274 <li> 1275 <a href="@dwg.uri" download="@dwg.FileName"> 1276 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/dwg_small.gif" /></span><span>@dwg.FileName</span> 1277 </a> 1278 </li> 1279 } 1280 </ul> 1281 } 1282 1283 <h5>@Translate("GeneralInformation", "General Information")</h5> 1284 <ul> 1285 @if (thisPage.AreaID == 2) 1286 { 1287 <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> 1288 <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> 1289 } 1290 else 1291 { 1292 <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> 1293 <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> 1294 } 1295 1296 </ul> 1297 </div> 1298 1299 </div> 1300 1301 <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productSheetButton" aria-expanded="true" style="height: 0px;"> 1302 1303 <div class="panel-body print-hide"> 1304 <p>Printed</p> 1305 </div> 1306 1307 </div> 1308 1309 </div> 1310 <div id="product-collection-instructions" class="product-collection-instructions"> 1311 <img src="/Files/Templates/Designs/HagsCore/res/img/buttons/basket.jpg" /><h4>@Translate("AddToCollection", "Add to my collection")?</h4> 1312 <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> 1313 </div> 1314 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 1315 { 1316 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.AreaID); 1317 <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> 1318 } 1319 1320 1321 </div> 1322 </div> <!-- row --> 1323 </div> <!-- container-fluid --> 1324 </div> 1325 1326 @*Product Options*@ 1327 @if (GetLoop("VariantCombinations").Count() > 0) 1328 { 1329 <div class="m-sort m-theme-background-lightgrey product-options print-hide"> 1330 <div class="l-page"> 1331 <div class="container-fluid"> 1332 <div class="row"> 1333 <div> 1334 <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> 1335 </div> 1336 <form class="form-inline"> 1337 <div id="filter-variants"> 1338 1339 @if (anchoringOptions.Results.Count() > 0) 1340 { 1341 <div class="form-container"> 1342 <div class="form-group"> 1343 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 1344 <select class="form-control valid third" id="filter-anchoring" name="anchoring"> 1345 1346 @if (anchoringOptions.Results.Count() > 1) 1347 { 1348 <option value="0">@Translate("Any", "Any")</option> 1349 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 1350 { 1351 <option value="@anchor.Value">@anchor.Name</option> 1352 } 1353 } 1354 else 1355 { 1356 ResultField result = anchoringOptions.Results.FirstOrDefault(); 1357 <option value="@result.Value">@result.Name</option> 1358 } 1359 1360 </select> 1361 </div> 1362 1363 </div> 1364 } 1365 1366 @if (colourOptions.Results.Count() > 0) 1367 { 1368 <div class="form-container"> 1369 1370 <div class="form-group"> 1371 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 1372 <select class="form-control valid first" id="filter-colour" name="colour"> 1373 1374 @if (colourOptions.Results.Count() > 1) 1375 { 1376 <option value="0">@Translate("Any", "Any")</option> 1377 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 1378 { 1379 <option value="@colour.Value">@colour.Name</option> 1380 } 1381 } 1382 else 1383 { 1384 ResultField result = colourOptions.Results.FirstOrDefault(); 1385 <option value="@result.Value">@result.Name</option> 1386 } 1387 1388 1389 1390 </select> 1391 </div> 1392 1393 </div> 1394 } 1395 1396 @if (optionOptions.Results.Count() > 0) 1397 { 1398 <div class="form-container"> 1399 1400 <div class="form-group"> 1401 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 1402 <select class="form-control valid" id="filter-options" name="options"> 1403 1404 @if (optionOptions.Results.Count() > 1) 1405 { 1406 <option value="0">@Translate("Any", "Any")</option> 1407 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 1408 { 1409 <option value="@option.Value">@option.Name</option> 1410 } 1411 } 1412 else 1413 { 1414 ResultField result = optionOptions.Results.FirstOrDefault(); 1415 <option value="@result.Value">@result.Name</option> 1416 } 1417 </select> 1418 </div> 1419 1420 </div> 1421 } 1422 1423 </div> 1424 </form> 1425 </div> 1426 </div> 1427 </div> 1428 </div> 1429 1430 <div class="l-page print-hide"> 1431 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1432 1433 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1434 { 1435 var colourOption = string.Empty; 1436 var optionOption = string.Empty; 1437 var anchorOption = string.Empty; 1438 var materialOption = string.Empty; 1439 var colourId = string.Empty; 1440 var optionId = string.Empty; 1441 var anchorId = string.Empty; 1442 var materialId = string.Empty; 1443 var selectedVariant = string.Empty; 1444 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1445 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1446 1447 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1448 { 1449 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1450 { 1451 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1452 { 1453 1454 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1455 { 1456 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1457 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1458 } 1459 1460 } 1461 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1462 { 1463 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1464 { 1465 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1466 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1467 } 1468 } 1469 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1470 { 1471 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1472 { 1473 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1474 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1475 } 1476 } 1477 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1478 { 1479 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1480 { 1481 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1482 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1483 } 1484 } 1485 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1486 { 1487 selectedVariant = "selected-variant"; 1488 } 1489 } 1490 1491 } 1492 1493 <div class="m-attractor @selectedVariant" style="margin-bottom: 4em;"> 1494 1495 <div class="m-attractor-visual" style="height:180px;"> 1496 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1497 { 1498 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="img-responsive m-product-thumb" /></a> 1499 } 1500 else 1501 { 1502 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1503 } 1504 </div> 1505 1506 <input type="hidden" name="prop-colour" value="@colourId" /> 1507 <input type="hidden" name="prop-anchoring" value="@anchorId" /> 1508 <input type="hidden" name="prop-option" value="@optionId" /> 1509 1510 <div class="m-attractor-info m-attractor-info-product"> 1511 1512 1513 @if (thisPage.AreaID == 7) /*UK*/ 1514 { 1515 string ukId = ProductFieldValues.GetUkProductNumber(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), thisPage.Area.EcomLanguageId); 1516 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@ukId.ToString()</a></h3> 1517 } 1518 else 1519 { 1520 <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> 1521 } 1522 1523 <div class="m-attractor-info m-attractor-info-product"> 1524 <p>@optionOption @colourOption - @anchorOption</p> 1525 </div> 1526 <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> 1527 </div> 1528 </div> 1529 1530 } 1531 </div> 1532 1533 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1534 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1535 </div> 1536 </div> 1537 } 1538 1539 @* Play Functions*@ 1540 @if (relatedProducts.Any()) 1541 { 1542 int count = relatedProducts.Count(); 1543 <div class="m-heading m-theme-background-lightgrey print-hide"> 1544 <div class="l-page"> 1545 <div class="container-fluid"> 1546 <h4 class="m-panel-title">@Translate("PlayFunctions", "Play Functions")</h4> 1547 </div> <!-- container-fluid --> 1548 </div> <!-- l-page --> 1549 </div> 1550 1551 <div class="l-page play-functions print-hide" style="margin-bottom: 3em;"> 1552 <div class="box-slider-content" id="related-products-slider-content"> 1553 1554 @foreach (Product relatedProduct in relatedProducts) 1555 { 1556 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(relatedProduct.Number, AssetType.Images, false); 1557 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1558 1559 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1560 <div class="m-attractor"> 1561 <div class="m-attractor-visual"> 1562 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1563 { 1564 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1565 } 1566 else 1567 { 1568 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1569 } 1570 </div> 1571 <div class="m-attractor-info m-attractor-info-product"> 1572 <h3 class="m-theme-after-yellow m-theme-border-yellow">@relatedProduct.Name</h3> 1573 1574 @if (!string.IsNullOrWhiteSpace(relatedProduct.LongDescription)) 1575 { 1576 <div class="show-read-more" data-charlength="60" data-txtreadmore="@Translate("ReadMore","Read More")" data-txtreadless="@Translate("ReadLess","Read Less")">@relatedProduct.LongDescription</div> 1577 } 1578 1579 1580 </div> <!-- attractor-info --> 1581 </div> <!-- attractor --> 1582 </div> 1583 } 1584 1585 </div> <!-- box-slider-content --> 1586 </div><!-- l-page --> 1587 } 1588 1589 @if (thisPage.AreaID != 2 && productFunctions.Count > 0) 1590 { 1591 <div class="play-values"> 1592 <div class="m-heading m-theme-background-lightgrey print-hide"> 1593 <div class="l-page"> 1594 <div class="container-fluid"> 1595 <h4 class="m-panel-title">Play Values</h4> 1596 </div> 1597 <div class="m-decal-container" style="width: 100%; display: block; float: left;"> 1598 <div class="m-decal"> 1599 <ul class="list-inline"> 1600 @foreach (var d in productFunctions) 1601 { 1602 string image = "pf_" + d.Value + ".png"; 1603 <li class="decal"> 1604 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="" data-original-title="@d.Name"> 1605 <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"> 1606 <h5 class="">@d.Name</h5> 1607 </div> 1608 </li> 1609 } 1610 </ul> 1611 </div> 1612 </div> 1613 </div> 1614 </div> 1615 </div> 1616 } 1617 1618 1619 <!--<div class="m-heading m-theme-background-lightgrey print-hide"> 1620 <div class="l-page"> 1621 <div class="container-fluid"> 1622 <h4 class="m-panel-title">@Translate("WhatAboutTheseProducts", "What about these products")</h4> 1623 </div> 1624 </div> 1625 </div> 1626 1627 <div class="l-page print-hide"> 1628 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1629 @foreach (var item in GetLoop("eCom:Related.WhatAboutTheseProducts")) 1630 { 1631 var image = @item.GetValue("Ecom:Product.Number")+".jpg"; 1632 <div class="m-attractor" style="margin-bottom: 4em;"> 1633 <div class="m-attractor-visual" style="height:180px;"> 1634 <img src="Assets/@item.GetValue("Ecom:Product.Number")/Bilder/medium_@image" class="img-responsive m-product-thumb" /> 1635 </div> 1636 <div class="m-attractor-info m-attractor-info-product"> 1637 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@item.GetValue("Ecom:Product.Link.Clean")">@item.GetValue("Ecom:Product.Name")</a></h3> 1638 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@item.GetValue("Ecom:Product.Link.Clean")" role="button">@Translate("ProductDetails", "Product Details")</a> 1639 </div> 1640 </div> 1641 } 1642 </div> 1643 </div>--> 1644 1645 1646 <div class="m-heading m-theme-background-lightgrey print-hide"> 1647 <div class="l-page"> 1648 <div class="container-fluid"> 1649 <h4 class="m-panel-title">@Translate("YouHaveSeenTheseProducts", "Products you have viewed")</h4> 1650 </div> <!-- container-fluid --> 1651 </div> <!-- l-page --> 1652 </div> 1653 1654 <div class="l-page print-hide"> 1655 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1656 @foreach (var item in GetLoop("eCom:Related.YouHaveSeenTheseProducts")) 1657 { 1658 var image = @item.GetValue("Ecom:Product.Number")+".jpg"; 1659 <div class="m-attractor" style="margin-bottom: 4em;"> 1660 <div class="m-attractor-visual" style="height:180px;"> 1661 <img src="Assets/@item.GetValue("Ecom:Product.Number")/Bilder/medium_@image" class="img-responsive m-product-thumb" /> 1662 </div> 1663 <div class="m-attractor-info m-attractor-info-product"> 1664 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@item.GetValue("Ecom:Product.Link.Clean")">@item.GetValue("Ecom:Product.Name")</a></h3> 1665 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@item.GetValue("Ecom:Product.Link.Clean")" role="button">@Translate("ProductDetails", "Product Details")</a> 1666 </div> 1667 </div> 1668 } 1669 </div> 1670 </div> 1671 1672 1673 1674 <!--<div class="l-page"> 1675 <div class="container-fluid"> 1676 <h5>Customers also saw Loop:</h5> 1677 @foreach (var item in GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw")) 1678 { 1679 <p>@item.GetValue("Ecom:Product.Name") </p> 1680 } 1681 </div> 1682 </div> 1683 1684 <div class="l-page"> 1685 <div class="container-fluid"> 1686 <h5>You have seen these Products Loop:</h5> 1687 @foreach (var item in GetLoop("eCom:Related.YouHaveSeenTheseProducts")) 1688 { 1689 <p>@item.GetValue("Ecom:Product.Name") </p> 1690 } 1691 </div> 1692 </div>--> 1693 1694 1695