Sie haben keine Produkte in Ihrer Kollektion.

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_067db6db978f46b29695c7dba7ac4257.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 557 @if (thisPage.AreaID == 2 || thisPage.AreaID == 4) 558 { 559 //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 560 // with the appropriate translation 561 562 if (GetBoolean("Ecom:Product:Field.SwedishStock")) 563 { 564 string fastDeliveryTxt = thisPage.AreaID == 2 ? "Snabb Leverans" : "Hurtig Levering"; 565 string flagImg = thisPage.AreaID == 2 ? "flag_se.png" : "flag_dk.png"; 566 567 <div style="float:left;display:block;"> 568 <h3 id="displayproductnumber"> 569 @productNumber-1 570 </h3> 571 </div> 572 <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"> 573 @*<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>*@ 574 <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> 575 </div> 576 } 577 else 578 { 579 <div style="float:left;display:block;"> 580 <h3 id="displayproductnumber"> 581 @productNumber 582 </h3> 583 </div> 584 } 585 } 586 else if (thisPage.AreaID != 7) /*Not UK see line 503 below*/ 587 { 588 if (GetBoolean("Ecom:Product:Field.CentralStock")) 589 { 590 <div style="float:left;display:block;"> 591 <h3 id="displayproductnumber"> 592 @productNumber-2 593 </h3> 594 </div> 595 } 596 else 597 { 598 <div style="float:left;display:block;"> 599 <h3 id="displayproductnumber"> 600 @productNumber 601 </h3> 602 </div> 603 } 604 } 605 606 </div> 607 608 @if (!string.IsNullOrWhiteSpace(selectedAnchoringIcon ?? selectedAnchoringVariant)) 609 { 610 <div style="display:block;float:left;overflow:auto;margin-left:0px;width:100%" data-toggle="tooltip" data-placement="top" title="@Translate(" Anchoring", "Anchoring" ): @selectedAnchoringVariant"> 611 @{//Display the correct icon if available 612 bool isIcon = true; 613 isIcon = File.Exists(HttpContext.Current.Server.MapPath(@"Files/Templates/Designs/HagsCore/res/img/icons/anchoring/" + selectedAnchoringIcon)); 614 } 615 616 @if (isIcon) 617 { 618 <img src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" style="display:block;float:left;" /> 619 } 620 621 <p style="display: block; float: left; margin-left: 12px; margin-bottom: 0px;"> 622 @selectedMaterialVariant @selectedOptionVariant<br /> 623 @selectedColourVariant &ndash; @selectedAnchoringVariant 624 625 </p> 626 </div> 627 } 628 629 @if (GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0 && GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 630 { 631 <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")"> 632 <img src="Files/Templates/Designs/HagsCore/res/img/icons/whtstar.png" alt="s" style="display:block;float:left;" /> 633 <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> 634 </div> 635 } 636 637 <div class="m-decal-container" style="width:100%;display:block;float:left;"> 638 639 @* ageRanges *@ 640 <div class="m-decal"> 641 <ul class="list-inline"> 642 643 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 644 { 645 foreach (var range in ageRanges) 646 { 647 if (range.Trim() != "-") 648 { 649 <li class="decal"> 650 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.AgeRange.Name") @range"> 651 <img src="Files/Templates/Designs/HagsCore/res/img/decals/agerange.png" alt="@GetString(" Ecom:Product:Field.AgeRange.Name") @range" /> 652 <span class="decalvalue">@range</span> 653 </div> 654 </li> 655 } 656 } 657 } 658 659 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 660 { 661 <li class="decal"> 662 <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"> 663 664 <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" /> 665 666 <span class="decalvalue">@Math.Ceiling(GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw"))</span> 667 668 </div> 669 </li> 670 } 671 672 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 673 { 674 <li class="decal"> 675 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString(" Ecom:Product:Field.FallHeight.Name") @GetString("Ecom:Product:Field.FallHeight.Value.Raw")"> 676 677 <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")" /> 678 679 <span class="decalvalue">@GetString("Ecom:Product:Field.FallHeight.Value.Raw")</span> 680 681 </div> 682 </li> 683 } 684 685 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 686 { 687 <li class="decal"> 688 <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;"> 689 690 <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;" /> 691 692 <span class="decalvalue">@GetDouble("Ecom:Product:Field.SafetyArea.Value")</span> 693 694 </div> 695 </li> 696 } 697 698 @if (GetBoolean("Ecom:Product:Field.InclusivePlay.Value")) 699 { 700 <li class="decal"> 701 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="Inclusive Play"> 702 703 <img src="Files/Templates/Designs/HagsCore/res/img/decals/play-for-all-small.png" alt="Inclusive Play" /> 704 705 </div> 706 </li> 707 } 708 709 </ul> 710 </div> <!-- m-decals --> 711 </div> <!-- m-decals-container --> 712 @*Only UK and Sweden have Pricing at the moment*@ 713 @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*/ 714 { 715 string krPrice = GetInteger("Ecom:Product.DBPrice") == 0 ? Translate("RequestAQuote", "Kontakta oss") : GetString("Ecom:Product.Price.PriceFormatted").Replace(",00", ""); 716 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @krPrice</strong></p></div> 717 } 718 719 @if (thisPage.AreaID == 7) /*UK with special layout*/ 720 { 721 if (GetBoolean("Ecom:Product:Field.CentralStock")) 722 { 723 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")-2</p> 724 } 725 else 726 { 727 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")</p> 728 } 729 @* GL 15/02/2021 now remove all pricing for the UK (Also check pdf templates)*@ 730 @*if (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_")) 731 { 732 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")); 733 <div style="clear:both;"><p><strong>@Translate("Price", "Price"): @ukPrice </strong></p></div> 734 }*@ 735 736 } 737 738 <div class="col-sm-12 panel-group" style="display:block;float:left;width:100%;margin-top:18px;" id="accordion" role="tablist" aria-multiselectable="false"> 739 <div class="panel panel-default"> 740 <div class="panel-heading" role="tab" id="headingOne"> 741 <h4 class="m-panel-title panel-title"> 742 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne" class=""> 743 @Translate("ProductSpecifications", "Product Specifications") 744 </a> 745 </h4> 746 </div> 747 <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true"> 748 <div class="panel-body"> 749 <div id="product-left"> 750 <div class="padding"> 751 752 <div id="product-list-information" class="box-padding"> 753 754 <ul> 755 756 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 757 { 758 <li><span><strong>@GetString("Ecom:Product:Field.AgeRange.Name"):</strong></span> <span>@string.Join(", ", ageRanges)</span></li> 759 } 760 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 761 { 762 <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> 763 } 764 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 765 { 766 <li><span><strong>@GetString("Ecom:Product:Field.Length.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</span></li> 767 } 768 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 769 { 770 <li><span><strong>@GetString("Ecom:Product:Field.Width.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</span></li> 771 } 772 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 773 { 774 <li><span><strong>@GetString("Ecom:Product:Field.Height.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</span></li> 775 } 776 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 777 { 778 <li><span><strong>@GetString("Ecom:Product:Field.NetWeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.NetWeight.Value") kg</span></li> 779 } 780 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 781 { 782 <li><span><strong>@GetString("Ecom:Product:Field.Volume.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</span></li> 783 } 784 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 785 { 786 <li><span><strong>@GetString("Ecom:Product:Field.FallHeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</span></li> 787 } 788 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 789 { 790 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</span></li> 791 } 792 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 793 { 794 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaLength.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</span></li> 795 } 796 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 797 { 798 <li><span><strong>@GetString("Ecom:Product:Field.SafetyArea.Name"):</strong></span> <span>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</span></li> 799 } 800 801 </ul> 802 803 @*Anchoring from Variant*@ 804 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 805 { 806 string anchoringPage = DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.AreaID) + "#" + GetGlobalValue("Global:HagsTheme"); 807 808 if (!string.IsNullOrEmpty(anchoringPage)) 809 { 810 <a href="@anchoringPage" class="print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a> 811 } 812 813 } 814 815 </div> 816 817 </div> <!--! .padding --> 818 </div> 819 </div> 820 </div> 821 </div> 822 823 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.Material"))) 824 { 825 <div class="panel panel-default"> 826 <div class="panel-heading" role="tab" id="headingTwo"> 827 <h4 class="m-panel-title panel-title"> 828 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo" class="collapsed"> 829 @GetString("Ecom:Product:Field.Material.Name") 830 </a> 831 </h4> 832 </div> 833 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true"> 834 <div class="panel-body"> 835 <div id="product-left"> 836 <div class="padding"> 837 838 839 <p>&nbsp;</p> 840 @{ 841 842 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"); 843 if (!string.IsNullOrEmpty(materialData)) 844 { 845 //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")); 846 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 847 848 if (dataXML != null) 849 { 850 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 851 //format.NumberGroupSeparator = ","; //for thousands 852 //format.NumberDecimalSeparator = "."; //the decimal seperator 853 854 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 855 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 856 857 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 858 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 859 860 var details = from dat in dataXML.Descendants("Item") 861 select new 862 { 863 material = dat.Element("material").Value, 864 //weight = dat.Element("kg").Value,// string.Format("{0:0.00}", Double.Parse(dat.Element("kg").Value)), Occasionally throwing format errors 865 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 866 percent = Math.Round(Double.Parse(dat.Element("percent").Value, format), 1).ToString() // string.Format("{0:0.00}", Double.Parse(dat.Element("percent").Value)) 867 }; 868 869 <table class="table"> 870 <thead> 871 <tr> 872 <th>@GetString("Ecom:Product:Field.Material.Name")</th> 873 <th>kg</th> 874 <th>&#37;</th> 875 </tr> 876 </thead> 877 878 <tbody> 879 880 @foreach (var item in details) 881 { 882 <tr> 883 <td>@item.material</td> 884 <td>@item.weight</td> 885 <td>@item.percent</td> 886 </tr> 887 } 888 889 890 891 </tbody> 892 893 <tfoot> 894 <tr> 895 <td>&nbsp;</td> 896 <td><strong>@totalweight kg</strong></td> 897 <td><strong>@totalpercent&#37;</strong></td> 898 </tr> 899 </tfoot> 900 </table> <!--! #table-materials --> 901 } 902 } 903 904 } 905 906 </div> <!--! .padding --> 907 </div> 908 </div> 909 </div> 910 </div> 911 912 } 913 914 </div> 915 916 </div> 917 918 <div class="col-sm-7"> 919 920 <div class="image-gallery-container"> 921 922 <div class="fc-zoom"> 923 @*Zoom Product Images*@ 924 @if (zoomList.Count > 0) 925 926 { 927 <div class="fc-zoom__view"> 928 <div class="fc-zoom__target" id="zoom-target-1"> 929 @{ var i = 0; } 930 @foreach (var zoomSet in zoomList) 931 { 932 string[,] imgSet = zoomSet.Value; 933 string imgId = string.Format("img_0{0}", zoomSet.Key); 934 if (i == 0) 935 { 936 <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")"> 937 } 938 else 939 { 940 <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")"> 941 } 942 i++; 943 } 944 </div> 945 946 <button class="fc-zoom__button fc-zoom__button--in" id="zoom-toggle"> 947 <span class="fc-zoom__button-text">Toggle Zoom</span> 948 <span class="fc-zoom__icon fc-zoom__icon--in"> 949 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 950 <g fill-rule="nonzero"> 951 <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" /> 952 <path d="M77.737 37.683H60.56v22.89H37.683v17.175H60.56v22.878h17.176V77.748h22.889V60.573h-22.89z" /> 953 </g> 954 </svg> 955 </span> 956 <span class="fc-zoom__icon fc-zoom__icon--out"> 957 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 164 164"> 958 <g fill-rule="nonzero"> 959 <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" /> 960 <path d="M60.56 60.573H37.684v17.175h62.943V60.573h-22.89z" /> 961 </g> 962 </svg> 963 </span> 964 </button> 965 </div> 966 967 <div class="fc-zoom__thumbs" id="zoom-gallery"> 968 @{ i = 0; } 969 @foreach (var zoomSet in zoomList) 970 { 971 string[,] imgSet = zoomSet.Value; 972 string imgId = string.Format("img_0{0}", zoomSet.Key); 973 <a class="fc-zoom__link" href="@imgSet[0, 1]" data-image-target="zoom-full-image-@i" data-image="" data-zoom-image="@imgSet[0, 2]"> 974 <img class="fc-zoom__thumb" src="@imgSet[0, 0]" alt="@GetString("Ecom:Product.Name")"> 975 </a> 976 i++; 977 978 } 979 </div> 980 } 981 </div> 982 983 </div> 984 985 986 987 <div> 988 989 <ul class="m-btn-menu-secondary print-hide"> 990 @{ 991 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 992 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 993 } 994 995 @if (imagesCount + brochCount < assets.Count()) 996 { 997 <li> 998 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="#collapseThree" 999 role="button" 1000 data-toggle="collapse" 1001 data-parent="#productdownload" 1002 id="productDownloadButton" 1003 aria-controls="collapseThree">@Translate("ProductDownloads", "Product Downloads")</a> 1004 </li> 1005 } 1006 1007 @{ 1008 if (hiResDownloads.Count() > 0) 1009 { 1010 List 1011 <string> 1012 fileList = new List<string> 1013 (); 1014 foreach (var file in hiResDownloads) 1015 { 1016 fileList.Add(file.FullPath); 1017 } 1018 1019 <li> 1020 <form method="post" id="downloadImagesForm"> 1021 <input type="hidden" name="ProductNumber" value="@productNumber" /> 1022 <input type="hidden" name="ProductName" value="@GetString("Ecom:Product.Name")" /> 1023 @GetButton(fileList, "Product") 1024 </form> 1025 1026 </li> 1027 } 1028 } 1029 1030 @{ 1031 string printShout = Translate("SaveOrPrint", "Save or Print your Product PDF "); 1032 } 1033 1034 <li> 1035 1036 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1037 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> 1038 1039 @*<ul class="dropdown-menu" role="menu" style="position: relative; width: 100%; clear: both; margin-left: 0px; margin-top: 0px;"> 1040 <li> 1041 <a href="" 1042 data-target="#CreatePdf" 1043 name="catalogPublishing" 1044 data-productid="@GetString("Ecom:Product.ID")" 1045 data-productnumber="@productNumber" 1046 data-variantid="@GetString("Ecom:Product.VariantID")" 1047 data-toggle="modal" 1048 data-request="productsheet" 1049 data-shout="@printShout">@Translate("ProductSheet", "Product Sheet")</a> 1050 </li> 1051 <li> 1052 <a href="" 1053 data-target="#CreatePdf" 1054 name="catalogPublishing" 1055 data-productid="@GetString("Ecom:Product.ID")" 1056 data-productnumber="@productNumber" 1057 data-variantid="@GetString("Ecom:Product.VariantID")" 1058 data-toggle="modal" 1059 data-request="technicalsheet" 1060 data-shout="@printShout">@Translate("TechnicalSheet", "Technical Sheet")</a> 1061 </li> 1062 </ul>*@ 1063 1064 </li> 1065 1066 @*<li> 1067 <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> 1068 </li>*@ 1069 @*<li> 1070 <a class="m-btn-xs-more download btn btn-default btn-xs text-uppercase" href="" 1071 role="button" 1072 data-toggle="collapse" 1073 data-parent="#productdownload" 1074 id="productSheetButtonz" 1075 aria-controls="collapseFour" onclick="javascript:window.print();">@Translate("ProductSheet", "Product Sheet") (Print)</a> 1076 </li>*@ 1077 1078 @*<li>Check this again do we add a master with default Variant combinatiions to my product collection?? button is hidden.</li>*@ 1079 @*<li>@GetString("Ecom:Product.SelectedVariantComboName")||Variant Group Link: @GetString("Ecom:Product.VariantLinkGroup") |**| @GetLoop("VariantCombinations").Count()</li>*@ 1080 1081 @*<li>@prod.Id||@GetString("Ecom:Product.LanguageID") || @GetString("Ecom:Product.Number") || @prod.IsVariantMaster</li>*@ 1082 @*<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>*@ 1083 1084 1085 @*@if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || GetLoop("VariantCombinations").Count() == 1) 1086 {*@ 1087 @*display the button if we have the appropriate script loaded (advanced-search-min.js)*@ 1088 @*<li>@GetString("Ecom:Product.VariantID") || @GetLoop("VariantCombinations").Count()</li>*@ 1089 1090 <li id="btnMyProductCollection"> 1091 1092 @if (isProductCollection) 1093 { 1094 <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> 1095 } 1096 else 1097 { 1098 <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> 1099 } 1100 1101 </li> 1102 @*}*@ 1103 1104 1105 @*only works if logged-in 1106 <li><a href="@GetString(" Ecom:Product.AddToList")">Add To List Do something else</a></li>*@ 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?id=@GetString(" Ecom:Product:Page.ID")&amp;productid=@GetString("Ecom:Product.ID")&amp;CatalogPublishingcmd =addtocatalog">Add to catalog</a> 1112 </li> 1113 } 1114 1115 @if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 1116 { 1117 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 1118 <a href="/default.aspx?CatalogPublishingcmd=preview">Catalog Publishing</a> 1119 </li> 1120 }*@ 1121 </ul> 1122 1123 </div> 1124 1125 <div class="panel-group" id="productdownload" role="tablist" aria-multiselectable="false"> 1126 1127 <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productDownloadButton" aria-expanded="true" style="height: 0px;"> 1128 1129 <div class="panel panel-default panel-body print-hide"> 1130 1131 @{ 1132 List<ProductAsset> certAssets = new List<ProductAsset>(); 1133 1134 if (thisPage.AreaID == 1) // For Global get all certificates 1135 { 1136 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 1137 } 1138 else 1139 { 1140 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith(currentCountry + "_")).ToList(); 1141 } 1142 1143 if (certAssets.Count() == 0) // if none are found try to get EN certificates 1144 { 1145 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("EN_")).ToList(); 1146 } 1147 if (certAssets.Count() == 0) // if none are found try to get GB certificates 1148 { 1149 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("GB_")).ToList(); 1150 } 1151 } 1152 1153 @if (certAssets.Count > 0) 1154 { 1155 <h5>@Translate("Certificates", "Certificates")</h5> 1156 <ul> 1157 @foreach (ProductAsset cert in certAssets) 1158 { 1159 1160 <li> 1161 <a href="@cert.uri" download="@cert.FileName"> 1162 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@cert.FileName</span> 1163 </a> 1164 </li> 1165 } 1166 </ul> 1167 } 1168 1169 1170 @{ 1171 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 1172 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 1173 } 1174 1175 @*<h1>Product Assy Instructions: @assemblyAssets.Count</h1>*@ 1176 @if (assemblyAssets.Count > 0) 1177 { 1178 <h5>@Translate("InstallationGuides", "Installation Guides")</h5> 1179 <ul> 1180 @foreach (ProductAsset assemblyInstns in assemblyAssets) 1181 { 1182 assemblyInstns.RelatedProduct = productNumber; 1183 1184 <li> 1185 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1186 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1187 </a> 1188 </li> 1189 } 1190 </ul> 1191 1192 } 1193 1194 @{ 1195 // add relatedProductsAssemblyInstructions to product assemblyAssets and store to session. Used in UsersProductCollection.GetAssets for the product 1196 assemblyAssets.AddRange(relatedProductsAssemblyInstructions); 1197 SessionManager.SetSession(productNumber + "_" + AssetType.AssemblyInstructions.ToFriendlyAssetName(), new List<ProductAsset>(assemblyAssets)); 1198 } 1199 1200 @*<h3>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</h3>*@ 1201 @if (relatedProductsAssemblyInstructions.Count > 0) 1202 { 1203 <h5>@Translate("DetailedInstallationGuides", "Detailed Installation Guides")</h5> 1204 @*<p>Product Installation Guides plus relatedProductsAssemblyInstructions (Detailed Installation Guides): @assemblyAssets.Count</p>*@ 1205 <ul class="list-column list-inline"> 1206 @foreach (ProductAsset assemblyInstns in relatedProductsAssemblyInstructions) 1207 { 1208 <li> 1209 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 1210 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 1211 </a> 1212 </li> 1213 } 1214 </ul> 1215 } 1216 1217 @if (assemblyAssets.Count > 0) 1218 { 1219 <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> 1220 } 1221 1222 @{ 1223 List<ProductAsset> inspAssets = new List<ProductAsset>(); 1224 inspAssets = FileSystem.GetPdfFilesFromDirectoryBySiteCulture("/Files/System/ProductCollectionDownloads/InspectionMaintenance", "_" + currentlanguage.ToUpper()); 1225 } 1226 1227 @if (inspAssets != null && inspAssets.Count > 0) 1228 { 1229 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1230 1231 <ul> 1232 @foreach (ProductAsset pdf in inspAssets) 1233 { 1234 <li> 1235 <a href="@pdf.uri" download="@pdf.FileName"> 1236 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@pdf.FileName</span> 1237 </a> 1238 </li> 1239 } 1240 </ul> 1241 } 1242 else 1243 { 1244 <h5>@Translate("InspectionMaintenance", "Inspection & Maintenance")</h5> 1245 1246 <ul> 1247 <li> 1248 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Playground Equipment I&M guide_EN.pdf" download="Playground Equipment I&M Guide"> 1249 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Playground Equipment I&M Guide</span> 1250 </a> 1251 </li> 1252 <li> 1253 <a href="/Files/System/ProductCollectionDownloads/InspectionMaintenance/Sports and fitness I&M guide_EN.pdf" download="Sports and Fitness I&M Guide"> 1254 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>Sports and Fitness I&M Guide</span> 1255 </a> 1256 </li> 1257 </ul> 1258 1259 } 1260 1261 1262 @{ 1263 List<ProductAsset> 1264 dwgAssets = new List<ProductAsset> 1265 (); 1266 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 1267 } 1268 1269 @if (dwgAssets.Count > 0) 1270 { 1271 <h5>@Translate("DWGFiles", "DWG Files")</h5> 1272 <ul> 1273 @foreach (ProductAsset dwg in dwgAssets) 1274 { 1275 <li> 1276 <a href="@dwg.uri" download="@dwg.FileName"> 1277 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/dwg_small.gif" /></span><span>@dwg.FileName</span> 1278 </a> 1279 </li> 1280 } 1281 </ul> 1282 } 1283 1284 <h5>@Translate("GeneralInformation", "General Information")</h5> 1285 <ul> 1286 @if (thisPage.AreaID == 2) 1287 { 1288 <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> 1289 <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> 1290 } 1291 else 1292 { 1293 <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> 1294 <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> 1295 } 1296 1297 </ul> 1298 </div> 1299 1300 </div> 1301 1302 <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productSheetButton" aria-expanded="true" style="height: 0px;"> 1303 1304 <div class="panel-body print-hide"> 1305 <p>Printed</p> 1306 </div> 1307 1308 </div> 1309 1310 </div> 1311 <div id="product-collection-instructions" class="product-collection-instructions"> 1312 <img src="/Files/Templates/Designs/HagsCore/res/img/buttons/basket.jpg" /><h4>@Translate("AddToCollection", "Add to my collection")?</h4> 1313 <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> 1314 </div> 1315 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 1316 { 1317 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.AreaID); 1318 <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> 1319 } 1320 1321 1322 </div> 1323 </div> <!-- row --> 1324 </div> <!-- container-fluid --> 1325 </div> 1326 1327 @*Product Options*@ 1328 @if (GetLoop("VariantCombinations").Count() > 0) 1329 { 1330 <div class="m-sort m-theme-background-lightgrey product-options print-hide"> 1331 <div class="l-page"> 1332 <div class="container-fluid"> 1333 <div class="row"> 1334 <div> 1335 <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> 1336 </div> 1337 <form class="form-inline"> 1338 <div id="filter-variants"> 1339 1340 @if (anchoringOptions.Results.Count() > 0) 1341 { 1342 <div class="form-container"> 1343 <div class="form-group"> 1344 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 1345 <select class="form-control valid third" id="filter-anchoring" name="anchoring"> 1346 1347 @if (anchoringOptions.Results.Count() > 1) 1348 { 1349 <option value="0">@Translate("Any", "Any")</option> 1350 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 1351 { 1352 <option value="@anchor.Value">@anchor.Name</option> 1353 } 1354 } 1355 else 1356 { 1357 ResultField result = anchoringOptions.Results.FirstOrDefault(); 1358 <option value="@result.Value">@result.Name</option> 1359 } 1360 1361 </select> 1362 </div> 1363 1364 </div> 1365 } 1366 1367 @if (colourOptions.Results.Count() > 0) 1368 { 1369 <div class="form-container"> 1370 1371 <div class="form-group"> 1372 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 1373 <select class="form-control valid first" id="filter-colour" name="colour"> 1374 1375 @if (colourOptions.Results.Count() > 1) 1376 { 1377 <option value="0">@Translate("Any", "Any")</option> 1378 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 1379 { 1380 <option value="@colour.Value">@colour.Name</option> 1381 } 1382 } 1383 else 1384 { 1385 ResultField result = colourOptions.Results.FirstOrDefault(); 1386 <option value="@result.Value">@result.Name</option> 1387 } 1388 1389 1390 1391 </select> 1392 </div> 1393 1394 </div> 1395 } 1396 1397 @if (optionOptions.Results.Count() > 0) 1398 { 1399 <div class="form-container"> 1400 1401 <div class="form-group"> 1402 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 1403 <select class="form-control valid" id="filter-options" name="options"> 1404 1405 @if (optionOptions.Results.Count() > 1) 1406 { 1407 <option value="0">@Translate("Any", "Any")</option> 1408 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 1409 { 1410 <option value="@option.Value">@option.Name</option> 1411 } 1412 } 1413 else 1414 { 1415 ResultField result = optionOptions.Results.FirstOrDefault(); 1416 <option value="@result.Value">@result.Name</option> 1417 } 1418 </select> 1419 </div> 1420 1421 </div> 1422 } 1423 1424 </div> 1425 </form> 1426 </div> 1427 </div> 1428 </div> 1429 </div> 1430 1431 <div class="l-page print-hide"> 1432 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1433 1434 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1435 { 1436 var colourOption = string.Empty; 1437 var optionOption = string.Empty; 1438 var anchorOption = string.Empty; 1439 var materialOption = string.Empty; 1440 var colourId = string.Empty; 1441 var optionId = string.Empty; 1442 var anchorId = string.Empty; 1443 var materialId = string.Empty; 1444 var selectedVariant = string.Empty; 1445 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1446 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1447 1448 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1449 { 1450 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1451 { 1452 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1453 { 1454 1455 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1456 { 1457 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1458 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1459 } 1460 1461 } 1462 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1463 { 1464 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1465 { 1466 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1467 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1468 } 1469 } 1470 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1471 { 1472 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1473 { 1474 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1475 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1476 } 1477 } 1478 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1479 { 1480 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1481 { 1482 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1483 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1484 } 1485 } 1486 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1487 { 1488 selectedVariant = "selected-variant"; 1489 } 1490 } 1491 1492 } 1493 1494 <div class="m-attractor @selectedVariant" style="margin-bottom: 4em;"> 1495 1496 <div class="m-attractor-visual" style="height:180px;"> 1497 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1498 { 1499 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="img-responsive m-product-thumb" /></a> 1500 } 1501 else 1502 { 1503 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1504 } 1505 </div> 1506 1507 <input type="hidden" name="prop-colour" value="@colourId" /> 1508 <input type="hidden" name="prop-anchoring" value="@anchorId" /> 1509 <input type="hidden" name="prop-option" value="@optionId" /> 1510 1511 <div class="m-attractor-info m-attractor-info-product"> 1512 1513 1514 @if (thisPage.AreaID == 7) /*UK*/ 1515 { 1516 string ukId = ProductFieldValues.GetUkProductNumber(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), thisPage.Area.EcomLanguageId); 1517 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")">@ukId.ToString()</a></h3> 1518 } 1519 else 1520 { 1521 <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> 1522 } 1523 1524 <div class="m-attractor-info m-attractor-info-product"> 1525 <p>@optionOption @colourOption - @anchorOption</p> 1526 </div> 1527 <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> 1528 </div> 1529 </div> 1530 1531 } 1532 </div> 1533 1534 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1535 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1536 </div> 1537 </div> 1538 } 1539 1540 @* Play Functions*@ 1541 @if (relatedProducts.Any()) 1542 { 1543 int count = relatedProducts.Count(); 1544 <div class="m-heading m-theme-background-lightgrey print-hide"> 1545 <div class="l-page"> 1546 <div class="container-fluid"> 1547 <h4 class="m-panel-title">@Translate("PlayFunctions", "Play Functions")</h4> 1548 </div> <!-- container-fluid --> 1549 </div> <!-- l-page --> 1550 </div> 1551 1552 <div class="l-page play-functions print-hide" style="margin-bottom: 3em;"> 1553 <div class="box-slider-content" id="related-products-slider-content"> 1554 1555 @foreach (Product relatedProduct in relatedProducts) 1556 { 1557 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(relatedProduct.Number, AssetType.Images, false); 1558 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("medium_")).FirstOrDefault(); 1559 1560 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1561 <div class="m-attractor"> 1562 <div class="m-attractor-visual"> 1563 @if (image != null && !String.IsNullOrEmpty(image.uri)) 1564 { 1565 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1566 } 1567 else 1568 { 1569 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1570 } 1571 </div> 1572 <div class="m-attractor-info m-attractor-info-product"> 1573 <h3 class="m-theme-after-yellow m-theme-border-yellow">@relatedProduct.Name</h3> 1574 1575 @if (!string.IsNullOrWhiteSpace(relatedProduct.LongDescription)) 1576 { 1577 <div class="show-read-more" data-charlength="60" data-txtreadmore="@Translate("ReadMore","Read More")" data-txtreadless="@Translate("ReadLess","Read Less")">@relatedProduct.LongDescription</div> 1578 } 1579 1580 1581 </div> <!-- attractor-info --> 1582 </div> <!-- attractor --> 1583 </div> 1584 } 1585 1586 </div> <!-- box-slider-content --> 1587 </div><!-- l-page --> 1588 } 1589 1590 @if (thisPage.AreaID != 2 && productFunctions.Count > 0) 1591 { 1592 <div class="play-values"> 1593 <div class="m-heading m-theme-background-lightgrey print-hide"> 1594 <div class="l-page"> 1595 <div class="container-fluid"> 1596 <h4 class="m-panel-title">Play Values</h4> 1597 </div> 1598 <div class="m-decal-container" style="width: 100%; display: block; float: left;"> 1599 <div class="m-decal"> 1600 <ul class="list-inline"> 1601 @foreach (var d in productFunctions) 1602 { 1603 string image = "pf_" + d.Value + ".png"; 1604 <li class="decal"> 1605 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="" data-original-title="@d.Name"> 1606 <img src="Files/Templates/Designs/HagsCore/res/img/icons/playfunctions/@image" alt="@d.Name"> 1607 <h5 class="">@d.Name</h5> 1608 </div> 1609 </li> 1610 } 1611 </ul> 1612 </div> 1613 </div> 1614 </div> 1615 </div> 1616 </div> 1617 } 1618 1619 1620 <!--<div class="m-heading m-theme-background-lightgrey print-hide"> 1621 <div class="l-page"> 1622 <div class="container-fluid"> 1623 <h4 class="m-panel-title">@Translate("WhatAboutTheseProducts", "What about these products")</h4> 1624 </div> 1625 </div> 1626 </div> 1627 1628 <div class="l-page print-hide"> 1629 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1630 @foreach (var item in GetLoop("eCom:Related.WhatAboutTheseProducts")) 1631 { 1632 var image = @item.GetValue("Ecom:Product.Number")+".jpg"; 1633 <div class="m-attractor" style="margin-bottom: 4em;"> 1634 <div class="m-attractor-visual" style="height:180px;"> 1635 <img src="Assets/@item.GetValue("Ecom:Product.Number")/Bilder/medium_@image" class="img-responsive m-product-thumb" /> 1636 </div> 1637 <div class="m-attractor-info m-attractor-info-product"> 1638 <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> 1639 <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> 1640 </div> 1641 </div> 1642 } 1643 </div> 1644 </div>--> 1645 1646 1647 <div class="m-heading m-theme-background-lightgrey print-hide"> 1648 <div class="l-page"> 1649 <div class="container-fluid"> 1650 <h4 class="m-panel-title">@Translate("YouHaveSeenTheseProducts", "Products you have viewed")</h4> 1651 </div> <!-- container-fluid --> 1652 </div> <!-- l-page --> 1653 </div> 1654 1655 <div class="l-page print-hide"> 1656 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1657 @foreach (var item in GetLoop("eCom:Related.YouHaveSeenTheseProducts")) 1658 { 1659 var image = @item.GetValue("Ecom:Product.Number") + ".jpg"; 1660 <div class="m-attractor" style="margin-bottom: 4em;"> 1661 <div class="m-attractor-visual" style="height:180px;"> 1662 <img src="Assets/@item.GetValue("Ecom:Product.Number")/Bilder/medium_@image" class="img-responsive m-product-thumb" /> 1663 </div> 1664 <div class="m-attractor-info m-attractor-info-product"> 1665 <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> 1666 <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> 1667 </div> 1668 </div> 1669 } 1670 </div> 1671 </div> 1672 1673 1674 1675 <!--<div class="l-page"> 1676 <div class="container-fluid"> 1677 <h5>Customers also saw Loop:</h5> 1678 @foreach (var item in GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw")) 1679 { 1680 <p>@item.GetValue("Ecom:Product.Name") </p> 1681 } 1682 </div> 1683 </div> 1684 1685 <div class="l-page"> 1686 <div class="container-fluid"> 1687 <h5>You have seen these Products Loop:</h5> 1688 @foreach (var item in GetLoop("eCom:Related.YouHaveSeenTheseProducts")) 1689 { 1690 <p>@item.GetValue("Ecom:Product.Name") </p> 1691 } 1692 </div> 1693 </div>--> 1694