Error executing template "/Designs/HagsCore/Paragraph/AssetsSearch.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_45b8a73c8a5b4ba6b3888bbfe21b8d57.Execute() in C:\Projects\Hags_Dw9\Files\Templates\Designs\HagsCore\Paragraph\AssetsSearch.cshtml:line 887
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Web.Optimization; 3 @using Dynamicweb.Ecommerce.Variants; 4 @{ 5 string validationMessages = string.Format("messages_{0}.min.js", GetGlobalValue("Global:Area.Lang")); 6 string areaLanguage = GetGlobalValue("Global:Area.Lang"); 7 string customErrorMessage = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("AdvancedSearchError", "You must provide a Product Code or a Product Name for your Search", GetGlobalValue("Global:Area.LongLang")); 8 } 9 10 @*@Scripts.Render("~/bundle/AssetSearch") 11 12 @if (areaLanguage != "en") 13 { 14 // non english validation messages 15 <script src="/Files/Templates/Designs/HagsCore/script/source/libraries/validation/localization/@validationMessages"></script> 16 }*@ 17 18 <input type="hidden" id="CultureLanguage" value="@GetGlobalValue("Global:Area.LongLang")" /> 19 <input type="hidden" id="PageID" value="@GetGlobalValue("Global:Page.ID")" /> 20 <input type="hidden" id="ErrorMessage" value="@customErrorMessage" /> 21 22 <div id="advancedSearch"> 23 <div class="m-search-primary"> 24 <div class="text-center"> 25 <ul> 26 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#advancedsearch-ui" data-toggle="tab">@Translate("AdvancedSearch", "Advanced Search")</a></li> 27 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#downloadfinder" data-toggle="tab">@Translate("ProductDownloads", "Product Downloads")</a></li> 28 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#productcollection" data-toggle="tab">@Translate("MyProductCollection", "My Product Collection")</a></li> 29 <li><a class="m-btn-search-options btn btn-default text-uppercase" role="button" href="#inspirationfinder" data-toggle="tab">@Translate("InspirationFinder", "Inspiration Finder")</a></li> 30 </ul> 31 </div> 32 </div> 33 34 35 <div class="container"> 36 37 <div class="content"> 38 39 <div class="tab-content"> 40 41 <div class="tab-pane fade" id="advancedsearch-ui"> 42 43 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 44 @using Dynamicweb.Ecommerce.Variants; 45 @using HagsWeb.Library.BusinessObjects.UsersLists; 46 @using HagsWeb.Library.State; 47 @{} 48 49 @*@helper AdvancedSearch(string name) { 50 // your helper can contain code and/or markup, e.g. 51 // var msg = "Hello " + name; 52 // <p>@msg</p> 53 // For more information, visit http://go.microsoft.com/fwlink/?LinkID=204658 54 }*@ 55 56 57 @{ 58 Dynamicweb.Frontend.PageView advSearchPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 59 Dynamicweb.Content.Area advSearchArea = new Dynamicweb.Content.AreaService().GetArea(advSearchPage.AreaID); 60 61 string advancedSearchUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl((Int32)new Dynamicweb.Content.PageService().GetFirstModulePageForArea(advSearchArea.ID, "Searchv1").ID); 62 63 // Search Results in Session - Phase 2 64 //List<AdvancedSearchState> advancedSearchState = SessionManager.UsersAdvancedSearchState != null ? SessionManager.UsersAdvancedSearchState as List<AdvancedSearchState> : new List<AdvancedSearchState>(); 65 66 67 68 69 70 // Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 71 // var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 72 73 //var AnchoringVariants = GlobalAnchoringVariants; // Defined in AssetsSearch.cshtml, the controls' parent 74 75 //Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 76 //var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 77 78 //Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 79 //ParagraphCollection pageParagraphCollection = Dynamicweb.Content.Paragraph.GetParagraphsByPageID(thisPage.ID); 80 //string pageId = thisPage.ID.ToString(); 81 82 //var area = Dynamicweb.Content.Area.GetAreaById(thisPage.AreaID); 83 // //var l = area.EcomLanguageId; 84 //string EcomLanguageID = area.EcomLanguageId; 85 //string EcomShopID = area.EcomShopID; 86 87 ////string lang = thisPage.GlobalTags.GetTagByName("LongLang").Value; 88 //string l = thisPage.Area.Values["areaecomlanguageid"].ToString(); 89 } 90 91 <div class="m-search-advanced" style="display:block;visibility:visible;"> 92 <div class="m-search-advanced-panel m-search-advanced-product" id="m-search-advanced-product" style="display:block;visibility:visible;"> 93 <div class="l-page"> 94 <div class="container-fluid"> 95 <nav class="text-center"> 96 <ul class="m-nav-tabs-search nav nav-tabs text-uppercase"> 97 <li id="tabSearchPlay" class="active"><a href="#advancedsearch-Play" data-toggle="tab">@Translate("Play", "Play")</a></li> 98 <li id="tabSearchSportFitness"><a href="#advancedsearch-SportFitness" data-toggle="tab">@Translate("SportFitness", "Sport &amp; Fitness")</a></li> 99 <li id="tabSearchParkUrban"><a href="#advancedsearch-ParkUrban" data-toggle="tab">@Translate("ParkUrban", "Park &amp; Urban")</a></li> 100 <li id="tabSearchMarine"><a href="#advancedsearch-Marine" data-toggle="tab">@Translate("Marine", "Marine")</a></li> 101 <li id="tabSearchShade"><a href="#advancedsearch-Shade" data-toggle="tab">@Translate("Shade", "Shade")</a></li> 102 </ul> 103 </nav> 104 </div> <!-- container-fluid --> 105 <div class="tab-content"> 106 <div class="tab-pane fade in active" id="advancedsearch-Play"> 107 <form id="search-play" name="search-form" method="get" action="@advancedSearchUrl"> 108 <input type="hidden" name="Products" value="Play" /> 109 <div class="l-page"> 110 <div class="container-fluid"> 111 <div class="form-horizontal"> 112 <fieldset class="m-theme-border-grey"> 113 114 <div class="row"> 115 <div class="col-ms-4 col-sm-4"> 116 <div class="form-group"> 117 <label for="ProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 118 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 119 </div> 120 </div> 121 <div class="col-ms-4 col-sm-4"> 122 <div class="form-group"> 123 <label for="ProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 124 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 125 </div> 126 </div> 127 @{ 128 List<VariantOption> PlayAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Play", advSearchArea.EcomLanguageId); 129 130 if (PlayAnchoringVariants.Any()) 131 { 132 <div class="col-ms-4 col-sm-4"> 133 <div class="form-group"> 134 135 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 136 <div class="col-sm-7"> 137 <select class="form-control" name="AnchoringType"> 138 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 139 @foreach (var option in PlayAnchoringVariants) 140 { 141 <option value='@option.Id'>@option.Name</option> 142 } 143 </select> 144 </div> 145 </div> 146 </div> 147 } 148 else 149 { 150 <input type="hidden" name="AnchoringType" value="0" /> 151 } 152 153 } 154 155 </div> <!-- row --> 156 @*<input type="hidden" name="productsInSession" value="@advancedSearchState.Count()" />*@ 157 158 </fieldset> 159 160 161 162 163 </div> <!--form - horizontal--> 164 </div> <!--container - fluid--> 165 </div> <!--l - page--> 166 <div class="m-search-advanced-buttons text-center"> 167 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 168 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 169 </div> 170 </form> 171 172 @*<script> 173 $("#search-play").validate(); 174 </script>*@ 175 <div id="results-search-play" class="m-search-advanced-results-panel"> 176 177 @*// Search Results in Session - Phase 2 178 @if (advancedSearchState.Any()) 179 { 180 181 foreach (AdvancedSearchState product in advancedSearchState) 182 { 183 @String.Format("{0}", product.Products) 184 } 185 }*@ 186 187 </div> 188 </div> 189 <div class="tab-pane fade in" id="advancedsearch-SportFitness"> 190 <form id="search-sport" name="search-form" method="get" action="@advancedSearchUrl"> 191 <input type="hidden" name="Products" value="Sport" /> 192 <div class="l-page"> 193 <div class="container-fluid"> 194 <div class="form-horizontal"> 195 <fieldset class="m-theme-border-grey"> 196 <div class="row"> 197 <div class="col-ms-4 col-sm-4"> 198 <div class="form-group"> 199 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 200 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 201 </div> 202 </div> 203 <div class="col-ms-4 col-sm-4"> 204 <div class="form-group"> 205 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 206 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 207 </div> 208 </div> 209 210 @{ 211 List<VariantOption> SportAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Sport", advSearchArea.EcomLanguageId); 212 213 if (SportAnchoringVariants.Count() > 0) 214 { 215 <div class="col-ms-4 col-sm-4"> 216 <div class="form-group"> 217 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 218 <div class="col-sm-7"> 219 <select class="form-control" name="AnchoringType"> 220 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 221 @foreach (var option in SportAnchoringVariants) 222 { 223 <option value='@option.Id'> @option.Name </option> 224 } 225 </select> 226 </div> 227 </div> 228 </div> 229 } 230 else 231 { 232 <input type="hidden" name="AnchoringType" value="0" /> 233 } 234 } 235 236 </div> <!-- row --> 237 </fieldset> 238 </div> <!-- form-horizontal --> 239 </div> <!-- container-fluid --> 240 </div> <!-- l-page --> 241 <div class="m-search-advanced-buttons text-center"> 242 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 243 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 244 </div> 245 </form> 246 <div id="results-search-sportfitness" class="m-search-advanced-results-panel"> 247 @*// Search Results in Session - Phase 2 248 @if (advancedSearchState.Any()) 249 { 250 251 foreach (AdvancedSearchState product in advancedSearchState) 252 { 253 @String.Format("{0}", product.Products) 254 } 255 }*@ 256 </div> 257 </div> 258 <div class="tab-pane fade in" id="advancedsearch-ParkUrban"> 259 <form id="search-park" name="search-form" method="get" action="@advancedSearchUrl"> 260 <input type="hidden" name="Products" value="Park" /> 261 <div class="l-page"> 262 <div class="container-fluid"> 263 <div class="form-horizontal"> 264 <fieldset class="m-theme-border-grey"> 265 <div class="row"> 266 <div class="col-ms-4 col-sm-4"> 267 <div class="form-group"> 268 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 269 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 270 </div> 271 </div> 272 <div class="col-ms-4 col-sm-4"> 273 <div class="form-group"> 274 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 275 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 276 </div> 277 </div> 278 @{ 279 List<VariantOption> ParkAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Park", advSearchArea.EcomLanguageId); 280 281 if (ParkAnchoringVariants.Count() > 0) 282 { 283 <div class="col-ms-4 col-sm-4"> 284 <div class="form-group"> 285 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 286 <div class="col-sm-7"> 287 <select class="form-control" name="AnchoringType"> 288 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 289 @foreach (var option in ParkAnchoringVariants) 290 { 291 <option value='@option.Id'> @option.Name </option> 292 } 293 </select> 294 </div> 295 </div> 296 </div> 297 } 298 else 299 { 300 <input type="hidden" name="AnchoringType" value="0" /> 301 } 302 } 303 304 </div> <!-- row --> 305 </fieldset> 306 </div> <!-- form-horizontal --> 307 </div> <!-- container-fluid --> 308 </div> <!-- l-page --> 309 <div class="m-search-advanced-buttons text-center"> 310 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 311 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 312 </div> 313 </form> 314 <div id="results-search-parkurban" class="m-search-advanced-results-panel"> 315 @*// Search Results in Session - Phase 2 316 @if (advancedSearchState.Any()) 317 { 318 319 foreach (AdvancedSearchState product in advancedSearchState) 320 { 321 @String.Format("{0}", product.Products) 322 } 323 }*@ 324 </div> 325 </div> 326 <div class="tab-pane fade in" id="advancedsearch-Marine"> 327 <form id="search-marine" name="search-form" method="get" action="@advancedSearchUrl"> 328 <input type="hidden" name="Products" value="Marine" /> 329 <div class="l-page"> 330 <div class="container-fluid"> 331 <div class="form-horizontal"> 332 <fieldset class="m-theme-border-grey"> 333 <div class="row"> 334 <div class="col-ms-4 col-sm-4"> 335 <div class="form-group"> 336 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 337 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 338 </div> 339 </div> 340 <div class="col-ms-4 col-sm-4"> 341 <div class="form-group"> 342 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 343 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 344 </div> 345 </div> 346 @{ 347 List<VariantOption> MarineAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Marine", advSearchArea.EcomLanguageId); 348 349 if (MarineAnchoringVariants.Count() > 0) 350 { 351 <div class="col-ms-4 col-sm-4"> 352 <div class="form-group"> 353 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 354 <div class="col-sm-7"> 355 <select class="form-control" name="AnchoringType"> 356 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 357 @foreach (var option in MarineAnchoringVariants) 358 { 359 <option value='@option.Id'> @option.Name </option> 360 } 361 </select> 362 </div> 363 </div> 364 </div> 365 } 366 else 367 { 368 <input type="hidden" name="AnchoringType" value="0" /> 369 } 370 } 371 372 </div> <!-- row --> 373 </fieldset> 374 </div> <!-- form-horizontal --> 375 </div> <!-- container-fluid --> 376 </div> <!-- l-page --> 377 <div class="m-search-advanced-buttons text-center"> 378 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 379 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 380 </div> 381 </form> 382 <div id="results-search-marine" class="m-search-advanced-results-panel"> 383 @*// Search Results in Session - Phase 2 384 @if (advancedSearchState.Any()) 385 { 386 387 foreach (AdvancedSearchState product in advancedSearchState) 388 { 389 @String.Format("{0}", product.Products) 390 } 391 }*@ 392 </div> 393 </div> 394 <div class="tab-pane fade in" id="advancedsearch-Shade"> 395 <form id="search-shade" name="search-form" method="get" action="@advancedSearchUrl"> 396 <input type="hidden" name="Products" value="Shade" /> 397 <div class="l-page"> 398 <div class="container-fluid"> 399 <div class="form-horizontal"> 400 <fieldset class="m-theme-border-grey"> 401 <div class="row"> 402 <div class="col-ms-4 col-sm-4"> 403 <div class="form-group"> 404 <label for="inputAdvancedSearch1" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 405 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductCode" /></div> 406 </div> 407 </div> 408 <div class="col-ms-4 col-sm-4"> 409 <div class="form-group"> 410 <label for="inputAdvancedSearch3" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 411 <div class="col-sm-7"><input type="text" class="form-control search-group" name="ProductName" /></div> 412 </div> 413 </div> 414 @{ 415 List<VariantOption> ShadeAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().CheckValidVariantOptions("ATP3", "Shade", advSearchArea.EcomLanguageId); 416 417 if (ShadeAnchoringVariants.Count() > 0) 418 { 419 <div class="col-ms-4 col-sm-4"> 420 <div class="form-group"> 421 <label for="inputAdvancedSearch6" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 422 <div class="col-sm-7"> 423 <select class="form-control" name="AnchoringType"> 424 <option value="0"> @Translate("SelectAnchoring", "Select Anchoring Type") </option> 425 @foreach (var option in ShadeAnchoringVariants) 426 { 427 <option value='@option.Id'> @option.Name </option> 428 } 429 </select> 430 </div> 431 </div> 432 </div> 433 } 434 else 435 { 436 <input type="hidden" name="AnchoringType" value="0" /> 437 } 438 } 439 440 </div> <!-- row --> 441 </fieldset> 442 </div> <!-- form-horizontal --> 443 </div> <!-- container-fluid --> 444 </div> <!-- l-page --> 445 <div class="m-search-advanced-buttons text-center"> 446 <button class="m-btn-search btn btn-default text-uppercase" type="reset" name="reset">@Translate("Reset", "Reset")</button> 447 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 448 </div> 449 </form> 450 <div id="results-search-shade" class="m-search-advanced-results-panel"> 451 @*// Search Results in Session - Phase 2 452 @if (advancedSearchState.Any()) 453 { 454 455 foreach (AdvancedSearchState product in advancedSearchState) 456 { 457 @String.Format("{0}", product.Products) 458 } 459 }*@ 460 </div> 461 </div> 462 </div> 463 </div> <!-- l-page --> 464 </div> <!-- m-search-advanced-product --> 465 <div class="text-center"> 466 <a href="#advancedsearch-ui" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 467 </div> 468 </div> 469 470 471 472 @*<h1>@GetGlobalValue("Global:Page.Name")</h1> 473 <h1>@GetValue("Global:Page.Name")</h1> 474 <h1>The Advanced Search Include is here.. PageID = @pageId, l=, LanguageID=@EcomLanguageID, ShopID=@EcomShopID, lang=@l</h1> 475 476 <h1>Set Tag = @GetString("CheckTag") // @GetValue("CheckTag") </h1> 477 478 @foreach (var p in pageParagraphCollection) 479 { 480 var a = p.Template; 481 var b = p.ID.ToString(); 482 var c = p.Text; 483 var f = p.Languages; 484 <ul> 485 <li>@a</li> 486 <li>@b</li> 487 <li>@c</li> 488 <li>@f</li> 489 </ul> 490 }*@ 491 492 493 </div> 494 495 <div class="tab-pane fade" id="downloadfinder"> 496 497 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 498 @using HagsWeb.Library.BusinessObjects.UsersLists; 499 @using HagsWeb.Library.State; 500 @using Dynamicweb.Ecommerce.Variants; 501 @{ 502 Dynamicweb.Frontend.PageView downloadsPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 503 Dynamicweb.Content.Area downloadsArea = new Dynamicweb.Content.AreaService().GetArea(downloadsPage.AreaID); 504 505 string downloadsSearchUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl((Int32)new Dynamicweb.Content.PageService().GetFirstModulePageForArea(downloadsArea.ID, "Searchv1").ID); 506 507 // This seems to be still valid 508 List<VariantOption> ProductDownloadsAnchoringVariants = new HagsWeb.Library.Methods.AssetSearch.ProductAssets().GetVariantOptions("ATP3", downloadsArea.EcomLanguageId); 509 510 511 #region Search Results in Session - Phase 2 512 513 514 //// Search Results in Session - Phase 2 515 //List<AdvancedSearchState> downloadsSearchState = SessionManager.UsersAdvancedSearchState != null ? SessionManager.UsersAdvancedSearchState as List<AdvancedSearchState> : new List<AdvancedSearchState>(); 516 //List<AdvancedSearchState> brochuresStateList = new List<AdvancedSearchState>(); 517 //List<AdvancedSearchState> dwgsStateList = new List<AdvancedSearchState>(); 518 //List<AdvancedSearchState> certificatesStateList = new List<AdvancedSearchState>(); 519 //List<AdvancedSearchState> installationGuidesStateList = new List<AdvancedSearchState>(); 520 521 //if (downloadsSearchState.Count() > 0) 522 //{ 523 // foreach (AdvancedSearchState downloadsState in downloadsSearchState) 524 // { 525 // if (!String.IsNullOrEmpty(downloadsState.Brochures)) 526 // { 527 // AdvancedSearchState broch = new AdvancedSearchState(); 528 // broch.Brochures = downloadsState.Brochures; 529 // brochuresStateList.Add(broch); 530 // } 531 // if (!String.IsNullOrEmpty(downloadsState.Dwgs)) 532 // { 533 // AdvancedSearchState dwg = new AdvancedSearchState(); 534 // dwg.Dwgs = downloadsState.Dwgs; 535 // dwgsStateList.Add(dwg); 536 // } 537 // if (!String.IsNullOrEmpty(downloadsState.Certificates)) 538 // { 539 // AdvancedSearchState certs = new AdvancedSearchState(); 540 // certs.Certificates = downloadsState.Certificates; 541 // certificatesStateList.Add(certs); 542 // } 543 // if (!String.IsNullOrEmpty(downloadsState.InstallationGuides)) 544 // { 545 // AdvancedSearchState guide = new AdvancedSearchState(); 546 // guide.InstallationGuides = downloadsState.InstallationGuides; 547 // installationGuidesStateList.Add(guide); 548 // } 549 // } 550 551 //} 552 #endregion 553 554 } 555 556 557 <div class="m-search-advanced" style="display:block;visibility:visible;"> 558 <div class="m-search-advanced-panel m-search-advanced-product" id="m-search-advanced-product" style="display:block;visibility:visible;"> 559 <div class="l-page"> 560 <div class="container-fluid"> 561 <nav class="text-center"> 562 <ul class="m-nav-tabs-search nav nav-tabs text-uppercase"> 563 <li><a href="#download-brochures" data-toggle="tab">@Translate("Brochures", "Brochures")</a></li> 564 <li><a href="#download-dwg" data-toggle="tab">@Translate("DWGFiles", "DWG Files")</a></li> 565 <li><a href="#download-certificates" data-toggle="tab">@Translate("Certificates", "Certificates")</a></li> 566 <li><a href="#download-installationguides" data-toggle="tab">@Translate("InstallationGuides", "Installation Guides")</a></li> 567 </ul> 568 </nav> 569 <p>@Translate("ProductDownloadsInstructions", "To find product downloads simply click on one of the options above and then use the search form displayed to find all the documents associated with your search.")</p> 570 <p>&nbsp;</p> 571 </div> <!-- container-fluid --> 572 <div class="tab-content"> 573 574 575 576 577 <div class="tab-pane fade in" id="download-brochures"> 578 <form id="search-brochures" method="post" action="@downloadsSearchUrl?Assets=download-brochures"> 579 <div class="l-page"> 580 <div class="container-fluid"> 581 <div class="form-horizontal"> 582 <input type="hidden" name="SearchType" value="download-brochures" /> 583 @*<input type="hidden" name="ProductCode" value="0" /> 584 <input type="hidden" name="Products" value="0" />*@ 585 <!--<fieldset class="m-theme-border-grey"> 586 <input type="hidden" name="Assets" value="download-brochures" /> 587 <div class="row"> 588 <div class="col-ms-4 col-sm-4"> 589 <div class="form-group"> 590 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 591 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 592 </div> 593 </div> 594 <div class="col-ms-4 col-sm-4"> 595 <div class="form-group"> 596 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 597 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 598 </div> 599 </div> 600 601 @if (ProductDownloadsAnchoringVariants.Count() > 0) 602 { 603 604 <div class="col-ms-4 col-sm-4"> 605 <div class="form-group"> 606 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 607 <div class="col-sm-7"> 608 <select class="form-control" name="AnchoringType"> 609 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 610 @foreach (var option in ProductDownloadsAnchoringVariants) 611 { 612 <option value='@option.Id'>@option.Name</option> 613 } 614 </select> 615 </div> 616 </div> 617 </div> 618 619 } 620 621 </div> 622 </fieldset>--> 623 </div> <!-- form-horizontal --> 624 </div> <!-- container-fluid --> 625 </div> <!-- l-page --> 626 <div class="m-search-advanced-buttons text-center"> 627 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 628 @*<button class="m-btn-search btn btn-default text-uppercase" type="reset" >@Translate("Reset", "Reset")</button>*@ 629 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DisplayBrochures", "Display All Brochures")</button> 630 </div> 631 <div class="l-page"> 632 <div class="container-fluid"> 633 634 <div id="results-brochures" class="m-downloads m-search-advanced-results-panel"> 635 @*// SearchState - Phase 2 636 @if (brochuresStateList.Any()) 637 { 638 foreach (AdvancedSearchState brochures in brochuresStateList) 639 { 640 @String.Format("{0}", brochures.Brochures) 641 } 642 }*@ 643 </div> <!-- m-downloads --> 644 </div> <!-- container-fluid --> 645 </div> <!-- l-page --> 646 </form> 647 </div> 648 649 650 651 652 653 <div class="tab-pane fade in" id="download-dwg"> 654 <form id="search-dwg" method="post" action="@downloadsSearchUrl?Assets=download-dwg"> 655 <div class="l-page"> 656 <div class="container-fluid"> 657 <div class="form-horizontal"> 658 <fieldset id="dwg-criteria" class="m-theme-border-grey"> 659 <input type="hidden" name="SearchType" value="download-dwg" /> 660 <div class="row"> 661 <div class="col-ms-4 col-sm-4"> 662 <div class="form-group"> 663 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 664 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 665 </div> 666 </div> 667 <div class="col-ms-4 col-sm-4"> 668 <div class="form-group"> 669 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 670 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 671 </div> 672 </div> 673 @if (ProductDownloadsAnchoringVariants.Count() > 0) 674 { 675 676 <div class="col-ms-4 col-sm-4"> 677 <div class="form-group"> 678 679 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 680 <div class="col-sm-7"> 681 <select class="form-control" name="AnchoringType"> 682 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 683 @foreach (var option in ProductDownloadsAnchoringVariants) 684 { 685 <option value='@option.Id'>@option.Name</option> 686 } 687 </select> 688 </div> 689 </div> 690 </div> 691 692 } 693 </div> <!-- row --> 694 </fieldset> 695 </div> <!-- form-horizontal --> 696 </div> <!-- container-fluid --> 697 </div> <!-- l-page --> 698 <div class="m-search-advanced-buttons text-center"> 699 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 700 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 701 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 702 </div> 703 <div class="l-page"> 704 <div class="container-fluid"> 705 706 <div id="results-dwgs" class="m-downloads m-search-advanced-results-panel"> 707 @*// SearchState - Phase 2 708 @if (dwgsStateList.Any()) 709 { 710 foreach (AdvancedSearchState dwgs in dwgsStateList) 711 { 712 @String.Format("{0}", dwgs.Dwgs) 713 } 714 }*@ 715 </div> <!-- m-downloads --> 716 717 718 </div> <!-- container-fluid --> 719 </div> <!-- l-page --> 720 </form> 721 </div> 722 <div class="tab-pane fade in" id="download-certificates"> 723 <form id="search-certificates" method="post" action="@downloadsSearchUrl?Assets=download-certificates"> 724 <div class="l-page"> 725 <div class="container-fluid"> 726 <div class="form-horizontal"> 727 <fieldset id="certificates-criteria" class="m-theme-border-grey"> 728 <input type="hidden" name="SearchType" value="download-certificates" /> 729 <div class="row"> 730 <div class="col-ms-4 col-sm-4"> 731 <div class="form-group"> 732 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 733 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 734 </div> 735 </div> 736 <div class="col-ms-4 col-sm-4"> 737 <div class="form-group"> 738 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 739 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 740 </div> 741 </div> 742 @if (ProductDownloadsAnchoringVariants.Count() > 0) 743 { 744 745 <div class="col-ms-4 col-sm-4"> 746 <div class="form-group"> 747 748 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 749 <div class="col-sm-7"> 750 <select class="form-control" name="AnchoringType"> 751 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 752 @foreach (var option in ProductDownloadsAnchoringVariants) 753 { 754 <option value='@option.Id'>@option.Name</option> 755 } 756 </select> 757 </div> 758 </div> 759 </div> 760 761 } 762 </div> <!-- row --> 763 </fieldset> 764 </div> <!-- form-horizontal --> 765 </div> <!-- container-fluid --> 766 </div> <!-- l-page --> 767 <div class="m-search-advanced-buttons text-center"> 768 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 769 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 770 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 771 772 <div class="adviceMessage"></div> 773 774 </div> 775 <div class="l-page"> 776 <div class="container-fluid"> 777 778 <div id="results-certificates" class="m-downloads m-search-advanced-results-panel"> 779 @*// SearchState - Phase 2 780 @if (certificatesStateList.Any()) 781 { 782 foreach (AdvancedSearchState certs in certificatesStateList) 783 { 784 @String.Format("{0}", certs.Certificates) 785 } 786 }*@ 787 788 </div> <!-- m-downloads --> 789 790 791 </div> <!-- container-fluid --> 792 793 </div> <!-- l-page --> 794 </form> 795 </div> 796 <div class="tab-pane fade in" id="download-installationguides"> 797 <form id="search-installationguides" method="post" action="@downloadsSearchUrl?Assets=download-installationguides"> 798 <div class="l-page"> 799 <div class="container-fluid"> 800 <div class="form-horizontal"> 801 <fieldset id="installationguides-criteria" class="m-theme-border-grey"> 802 <input type="hidden" name="SearchType" value="download-installationguides" /> 803 <div class="row"> 804 <div class="col-ms-4 col-sm-4"> 805 <div class="form-group"> 806 <label for="inputProductCode" class="col-sm-5 control-label">@Translate("ProductCode", "Product Code")</label> 807 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductCode" name="ProductCode" /></div> 808 </div> 809 </div> 810 <div class="col-ms-4 col-sm-4"> 811 <div class="form-group"> 812 <label for="inputProductName" class="col-sm-5 control-label">@Translate("Name", "Name")</label> 813 <div class="col-sm-7"><input type="text" class="form-control search-group" id="inputProductName" name="ProductName" /></div> 814 </div> 815 </div> 816 @if (ProductDownloadsAnchoringVariants.Count() > 0) 817 { 818 819 <div class="col-ms-4 col-sm-4"> 820 <div class="form-group"> 821 822 <label for="AnchoringType" class="col-sm-5 control-label">@Translate("Anchoring", "Anchoring")</label> 823 <div class="col-sm-7"> 824 <select class="form-control" name="AnchoringType"> 825 <option value="0">@Translate("SelectAnchoring", "Select Anchoring Type")</option> 826 @foreach (var option in ProductDownloadsAnchoringVariants) 827 { 828 <option value='@option.Id'>@option.Name</option> 829 } 830 </select> 831 </div> 832 </div> 833 </div> 834 835 } 836 </div> <!-- row --> 837 </fieldset> 838 </div> <!-- form-horizontal --> 839 </div> <!-- container-fluid --> 840 </div> <!-- l-page --> 841 <div class="m-search-advanced-buttons text-center"> 842 @*<button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("DownloadAll", "Download All")</button>*@ 843 <button class="m-btn-search btn btn-default text-uppercase" type="reset">@Translate("Reset", "Reset")</button> 844 <button class="m-btn-search btn btn-default text-uppercase" type="submit">@Translate("Search", "Search")</button> 845 </div> 846 <div class="l-page"> 847 <div class="container-fluid"> 848 849 <div id="results-guides" class="m-downloads m-search-advanced-results-panel"> 850 @*// SearchState - Phase 2 851 @if (installationGuidesStateList.Any()) 852 { 853 foreach (AdvancedSearchState guide in installationGuidesStateList) 854 { 855 @String.Format("{0}", guide.InstallationGuides) 856 } 857 }*@ 858 859 </div> <!-- m-downloads --> 860 861 862 </div> <!-- container-fluid --> 863 </div> <!-- l-page --> 864 </form> 865 </div> 866 867 </div> 868 </div> <!-- l-page --> 869 </div> <!-- m-search-advanced-product --> 870 <div class="text-center"> 871 <a href="#downloadfinder" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 872 </div> 873 </div> 874 875 </div> 876 <div class="tab-pane fade" id="productcollection"> 877 878 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 879 @using HagsWeb.Library.BusinessObjects.UsersLists; 880 @using HagsWeb.Library.Methods.AssetManager; 881 @using HagsWeb.Library.State; 882 @{ 883 Dynamicweb.Frontend.PageView collectionPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 884 Dynamicweb.Content.Area collectionArea = new Dynamicweb.Content.AreaService().GetArea(collectionPage.AreaID); 885 886 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 887 bool isQuote = Convert.ToBoolean(collectionArea.Item["QuoteAndOrderChk"]); 888 string downloadingText = HagsWeb.Library.Utilities.DWUtilities.GetTranslation("Downloading...", "Downloading...", collectionArea.Culture); 889 int currentPage = collectionArea.ID; 890 } 891 892 893 <input type="hidden" id="isQuote" value="@isQuote" /> 894 <input type="hidden" id="downloadingText" value="@downloadingText" /> 895 <div class="m-search-advanced" style="display:block;visibility:visible;"> 896 897 <!--<div class="pull-left"><h4 class="clearfix">@Translate("MyProductCollection", "My Product Collection")</h4></div>--> 898 899 <div class="text-center" style="clear:both;padding-top:10px; border-bottom: 2px solid #000; padding-bottom: 20px;"> 900 <div id="btns_MyProductCollection"> 901 @if (productCollectionItems.Any()) 902 { 903 <p>@Translate("ProductCollectionButtonInstructions", "Use the buttons below to either download files, create quotes or create orders based on the products you have added to your collection.")</p> 904 905 <ul class="list-inline print-hide"> 906 @{ 907 List<ProductAsset> imageFileList = new List<ProductAsset>(); 908 List<ProductAsset> dwgFileList = new List<ProductAsset>(); 909 List<ProductAsset> instructionsFileList = new List<ProductAsset>(); 910 string contactUsLink = HagsWeb.Library.Utilities.DWUtilities.GetPageByNavigationTag("ContactUs", currentPage); // /kontakta-oss?mode=quote#contactForms // /kontakta-oss?success=True&mode=quote#contactForms // restful url 911 912 foreach (var item in productCollectionItems) 913 { 914 915 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.Images) && n.FileName == item.ProductNumber + ".jpg" || n.FileName == item.ProductNumber + "_Side.jpg" || n.FileName == item.ProductNumber + "_Top.jpg").ToList()) 916 { 917 imageFileList.Add(asset); 918 } 919 920 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.Drawings)).ToList()) 921 { 922 dwgFileList.Add(asset); 923 } 924 925 foreach (ProductAsset asset in item.AssetDownloads.Where(n => n.Index == HagsWeb.Library.Methods.AssetManager.AssetTypeEnum.ToFriendlyAssetName(HagsWeb.Library.Methods.AssetManager.AssetType.AssemblyInstructions)).ToList()) 926 { 927 instructionsFileList.Add(asset); 928 } 929 930 931 } 932 933 if (imageFileList.Any()) 934 { 935 <li> 936 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Bilder" id="imageDownloadButton">@Translate("DownloadImages", "Download Images")</a> 937 </li> 938 } 939 940 if (dwgFileList.Any()) 941 { 942 <li> 943 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Ritningar" id="dwgDownloadButton">@Translate("DownloadDWGFiles", "Download DWG Files")</a> 944 </li> 945 } 946 947 if (instructionsFileList.Any()) 948 { 949 <li> 950 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" name="download" role="button" data-parent="Monteringsanvisningar" id="instructionsDownloadButton">@Translate("DownloadInstallationGuides", "Download Installation Guides")</a> 951 </li> 952 } 953 954 if (isQuote) 955 { 956 if (!string.IsNullOrEmpty(contactUsLink)) 957 { 958 <li> 959 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@contactUsLink?mode=QuickQuote" role="button" data-parent="#quickquote" id="quickQuoteButton">@Translate("CreateQuickQuote", "Create a Quick Quote")</a> 960 </li> 961 <li> 962 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@contactUsLink?mode=QuickOrder" role="button" data-parent="#quickorder" id="quickOrderButton">@Translate("CreateQuickOrder", "Create a Quick Order")</a> 963 </li> 964 } 965 } 966 967 } 968 </ul> 969 970 } 971 972 <span class="error hide"></span> 973 974 </div> 975 976 <div class="m-search-advanced-results-panel" id="frm_MyProductCollection"> 977 <div class="row2"> 978 @if (productCollectionItems.Any()) 979 { 980 981 foreach (ProductCollectionItem item in productCollectionItems) 982 { 983 984 <div class="l-group-5 text-left"> 985 <div class="m-attractor"> 986 <div class="m-attractor-visual"> 987 <a href="@item.ProductUrlReference"><img src="@item.ProductImageUrl" class="img-responsive m-product-thumb"></a> 988 </div> 989 990 <div class="m-attractor-info m-attractor-info-product"> 991 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@item.ProductUrlReference">@item.ProductName</a></h3> 992 @*<p>@item.ProductDescription</p>*@ 993 <p>@Translate("ProductNumber", "Product Number"): @item.ProductNumber</p> 994 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@item.ProductUrlReference" role="button">@Translate("ProductDetails", "Product Details")</a> 995 </div> <!-- attractor-info --> 996 <div class="m-attractor-options"> 997 <ul class="m-icon-links list-unstyled"> 998 <li><a href="" name='productcollection' class="clearfix productcollection" data-removeProductlist="@item.ProductNumber"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/plus.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/plus.png" class="m-icon pull-left"><span>@Translate("RemoveFromCollection", "Remove from my collection")</span></a></li> 999 </ul> 1000 </div> <!-- m-attractor-options --> 1001 </div> 1002 1003 </div> 1004 1005 1006 } 1007 1008 } 1009 else 1010 { 1011 <p>@Translate("NoProductsInCollection", "You have no products in your collection.")</p> 1012 } 1013 </div> 1014 1015 </div> 1016 1017 </div> 1018 1019 <div class="text-center clearfix" style="clear:both;padding-top:10px;"> 1020 <a href="#productcollection" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 1021 </div> 1022 </div> 1023 1024 1025 1026 </div> 1027 1028 <div class="tab-pane fade" id="inspirationfinder"> 1029 1030 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1031 @using Dynamicweb.Content.Items; 1032 @{ 1033 Dynamicweb.Frontend.PageView thePage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 1034 int areaId = thePage.Area.ID; 1035 1036 // Get the current area's Paragraphs and find the ItemPublisher Module, returning a link and its paragraph content. Checks if Normalize latin Chars is set in DW 1037 var tuple = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetDefaultCaseStudies(areaId, 3); 1038 string paraContent = tuple.Item1; 1039 int pageId = tuple.Item2; // The Target Case Study Page listin Case study Item Types 1040 string hyperLink = tuple.Item3; 1041 bool latinCharacters = tuple.Item4; 1042 IEnumerable<Item> caseStudies = tuple.Item5; 1043 1044 //http://developer.dynamicweb-cms.com/documentation/for-developers/item-based-structure/querying-items.aspx 1045 1046 //string DataFromItem = RenderItemList(new 1047 //{ 1048 // ItemType = "Case_Study", 1049 // ListSourceType = "Page", 1050 // ListSourcePage = "62", 1051 // //IncludeAllChildItems = true, 1052 // //IncludeParagraphItems = true, 1053 // ItemFieldsList = "*", 1054 // ListTemplate = "ItemPublisher/List/Case Study List.cshtml", 1055 // ListPageSize = "100" 1056 //}).ToString(); 1057 1058 ////int productsPageId = GetPageIdByNavigationTag("Legals"); 1059 } 1060 1061 <div class="m-search-advanced" style="display:block;visibility:visible;"> 1062 <!--<h4>@Translate("InspirationFinder", "Inspiration Finder")</h4>--> 1063 1064 <div class="m-search-advanced-results-panel fade in" id="frm_InspirationFinder"> 1065 1066 @if (caseStudies.Any()) 1067 { 1068 1069 foreach (var study in caseStudies) 1070 { 1071 string studyId = study["Id"].ToString(); 1072 string Name = study["Study_Heading"] == null ? string.Empty : study["Study_Heading"].ToString(); 1073 string hyperlinkId = study["Read_More_Button"] == null ? String.Empty : study["Read_More_Button"].ToString(); 1074 string hyperlinkText = string.Empty; 1075 string Url = "Default.aspx?ID=" + pageId + "&itemId=Case_Study:" + studyId; 1076 1077 1078 // string sb_trim_Original = System.Text.RegularExpressions.Regex.Replace(Name, @"[., ?\/#!$%\^&\*;:{}=\-_`~()]", "-").ToLower(); 1079 //string sb_trim = System.Text.RegularExpressions.Regex.Replace(Name, @"[., ?\/#!$%\^&\*;:{}=\-_`~]", "-").ToLower(); 1080 1081 //string Url = hyperLink + "/" + sb_trim; 1082 1083 //if (latinCharacters) 1084 //{ 1085 // Url = HagsWeb.Library.Utilities.DWUtilities.NormalizeLatinCharacters(Url); 1086 //} 1087 1088 //string Url = hyperLink + "/" + sb_trim; 1089 string DateCreated = study["Study_Created_Date"] == null ? string.Empty : study["Study_Created_Date"].ToString(); 1090 string Description = study["Study_Content"] == null ? string.Empty : study["Study_Content"].ToString(); 1091 string StudyImages = study["Images"] == null ? string.Empty : study["Images"].ToString(); 1092 Item studyImage = null; 1093 1094 if (!string.IsNullOrEmpty(StudyImages)) 1095 { 1096 studyImage = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetItemImages(study["Images"].ToString(), 1).FirstOrDefault(); 1097 } 1098 1099 1100 <div class="l-group-content col-xs-6 col-ms-4 col-sm-3"> 1101 1102 <div class="m-attractor"> 1103 1104 <div class="m-attractor-visual"> 1105 1106 @if (studyImage == null) 1107 { 1108 <a href="@Url"><img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive" /></a> 1109 } 1110 else 1111 { 1112 <a href="@Url"><img src='@studyImage["Image"].ToString()' class="img-responsive"></a> 1113 } 1114 1115 1116 @*<img src="/Admin/Public/GetImage.ashx?width=1920&Compression=75&image=@image">*@ 1117 </div> 1118 1119 <div class="m-attractor-info m-attractor-info-product"> 1120 @if (!String.IsNullOrEmpty(Name)) 1121 { 1122 <h3 class="m-theme-after-yellow m-theme-border-yellow"><a href="@Url">@Name</a></h3> 1123 } 1124 @if (!String.IsNullOrEmpty(Description)) 1125 { 1126 <p>@Description</p> 1127 } 1128 1129 @if (!String.IsNullOrEmpty(DateCreated)) 1130 { 1131 <p>@DateCreated</p> 1132 } 1133 1134 @if (!String.IsNullOrEmpty(Url)) 1135 { 1136 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@Url" role="button">@Translate("CaseStudyDetails", "Case Study Details")</a> 1137 } 1138 1139 1140 </div> <!-- attractor-info --> 1141 @*<div class="m-attractor-options"> 1142 1143 <ul class="m-icon-links list-unstyled"> 1144 <li><a href="#" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/plus.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/plus.png" class="m-icon pull-left"><span>Add to my collection</span></a></li> 1145 </ul> 1146 1147 </div>*@ <!-- m-attractor-options --> 1148 1149 </div> <!-- attractor --> 1150 1151 </div> 1152 } 1153 } 1154 1155 </div> 1156 1157 <div class="text-center all-case-studies"> 1158 1159 @if (!String.IsNullOrEmpty(paraContent)) 1160 { 1161 @paraContent 1162 } 1163 1164 @if (!String.IsNullOrEmpty(hyperLink)) 1165 { 1166 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@hyperLink" role="button">@Translate("ViewAllCaseStudies", "View all our case studies")</a> 1167 } 1168 1169 </div> 1170 1171 @*<div class="m-search-advanced-buttons text-center"> 1172 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@hyperLink" role="button">@Translate("ViewAllCaseStudies", "View all our case studies")</a> 1173 </div>*@ 1174 1175 @*</div>*@ 1176 1177 <div class="text-center"> 1178 <a href="#inspirationfinder" class="m-search-advanced-close"><img src="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/buttons/search-advanced-close.png" width="112" alt="Search Advanced Close"></a> 1179 </div> 1180 </div> 1181 1182 </div> 1183 </div> 1184 1185 <div id="NoResults" style="display:none;">Sorry there are currently no items that match your search criteria. Please refine your search using the options above.</div> 1186 1187 </div> 1188 </div> 1189 1190 <div style="margin-top:50px; display:none;" id="SearchResults">@Translate("YourResults", "YourResults") **Search Results here**</div> 1191 1192 1193 </div> 1194 1195 @Scripts.Render("~/bundle/AssetSearch") 1196 1197 @if (areaLanguage != "en") 1198 { 1199 // non english validation messages 1200 <script src="/Files/Templates/Designs/HagsCore/script/source/libraries/validation/localization/@validationMessages"></script> 1201 } 1202
Error executing template "Designs/HagsCore/eCom/Product/Product.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_59f7196d0a1943b2b9eb2c0d45a1f991.Execute() in C:\Projects\Hags_Dw9\Files\Templates\Designs\HagsCore\eCom\Product\Product.cshtml:line 129
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Web.Optimization 3 @using Dynamicweb.Content.Items; 4 @using Dynamicweb.Ecommerce.Products; 5 @using HagsWeb.Library.Methods.AssetManager; 6 @using HagsWeb.Library.BusinessObjects.UsersLists; 7 @using HagsWeb.Library.Methods.AssetSearch; 8 @using HagsWeb.Library.Utilities; 9 @using HagsWeb.Library.State; 10 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 11 @using Dynamicweb.Rendering; 12 @using System; 13 @using System.Web; 14 @using System.Collections.Generic; 15 @using System.Linq; 16 @using Ionic.Zip; 17 @using System.IO; 18 @using System.Threading; 19 20 21 @helper GetButton(List<string> files, string sender) 22 { 23 var request = HttpContext.Current.Request.Form; 24 var response = HttpContext.Current.Response; 25 26 if (!string.IsNullOrEmpty(request["DownloadImages"])) 27 { 28 // Currently only used for Product Image download on results page - see also GetDownload.cshtml 29 // To do KOD extract this into a service in Library, also consider Hags\Application\Ajax\UsersProductCollection\UsersProductCollection.aspx.cs(398) 30 if (files.Any()) 31 { 32 try 33 { 34 35 var zipArchives = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Zips"); 36 var transferFolder = System.Web.HttpContext.Current.Server.MapPath("Files/System/UserDownloads/Transfers"); 37 38 // empty the zipArchives folder of zips that are 30 mins old (if any) 39 var oldZips = new DirectoryInfo(zipArchives).EnumerateFiles() 40 .Where(f => f.CreationTime < DateTime.Now.AddMinutes(-30)) 41 .ToList(); 42 oldZips.ForEach(f => f.Delete()); 43 44 DirectoryInfo Folder = new DirectoryInfo(transferFolder); 45 // Occasionally some files are read only and cannot be deleted so change all files, remove readonly before the delete 46 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 47 Directory.EnumerateFiles(transferFolder).ToList().ForEach(f => System.IO.File.Delete(f)); 48 49 // copy the selected files to the transferFolder and change from ReadOnly to try to prevent access to the path is denied error 50 files.ForEach(f => System.IO.File.Copy(f, Path.Combine(transferFolder, Path.GetFileName(f)), true)); 51 Folder.EnumerateFiles().ToList().ForEach(file => file.Attributes = FileAttributes.Normal); 52 53 // Set up our new zip folder 54 var downloadFileName = string.Format("Hags_Download_Pack-{0}.zip", DateTime.Now.ToString("dd-MM-yyyy-HH_mm_ss")); 55 56 //var zipLocationUrl = "Files/System/UserDownloads/Zips/" + downloadFileName; // Use this to return a link to the folder saved to disk 57 58 HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; // Important - as is AppendHeader, not AddHeader 59 HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 60 61 using (var zip = new ZipFile()) 62 { 63 List<string> fileList = Directory.EnumerateFiles(transferFolder).ToList(); 64 //zip.AddDirectoryByName(subfolderName); 65 foreach (string file in fileList) 66 { 67 zip.AddFile(file, string.Empty); 68 } 69 70 // Save to the OutputStream 71 zip.Save(HttpContext.Current.Response.OutputStream); 72 // Or save the file to the file system using TransmitFile to stream the file without storing to memory 73 //zip.Save(zipArchives + "/" + downloadFileName); 74 } 75 76 // Transmit a file that was created on disk 77 //HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; 78 //HttpContext.Current.Response.AppendHeader("Content-Disposition", "filename=" + downloadFileName); 79 //HttpContext.Current.Response.TransmitFile(zipArchives + "/" + downloadFileName); 80 81 82 83 } 84 catch (ZipException ze) 85 { 86 HagsWeb.Library.CustomException.HagsException.SetHagsException(ze, "ProductDownload/GetDownloadButton.cshtml ZipException download file error (" + sender + ") - Original File Count: " + files.Count() + "InnerEx: " + ze.InnerException, System.Diagnostics.EventLogEntryType.Error, 1, 1); 87 } 88 catch (System.IO.FileNotFoundException notFoundEx) 89 { 90 HagsWeb.Library.CustomException.HagsException.SetHagsException(notFoundEx, "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + notFoundEx.Message + " - The File: " + notFoundEx.FileName, System.Diagnostics.EventLogEntryType.Error, 1, 2); 91 } 92 catch (ThreadAbortException) 93 { 94 // A normal Thread abort after HttpContext.Current.Response.End(); we dont record it 95 //HagsWeb.Library.CustomException.HagsException.SetHagsException(tae, "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloads.cshtml " + tae.Message + " - The Inner Ex: " + tae.InnerException, System.Diagnostics.EventLogEntryType.Information, 1, 3); 96 } 97 catch (Exception ex) 98 { 99 HagsWeb.Library.CustomException.HagsException.SetHagsException(ex, "../Templates/HagsModules/UsersAssetsSearch/ProductDownloads/GetDownloadButton.cshtml (" + sender + ") " + ex.Message + " - The Inner Ex: " + ex.InnerException, System.Diagnostics.EventLogEntryType.Error, 1, 3); 100 } 101 finally 102 { 103 HttpContext.Current.Response.End(); 104 } 105 106 } 107 } 108 else 109 { 110 string buttonCaption = string.Empty; 111 if (sender == "Product") 112 { 113 buttonCaption = Translate("ImageDownloads", "Image Downloads"); 114 } 115 if (sender == "AdvancedSearch") 116 { 117 buttonCaption = Translate("DownloadAll", "Download All"); 118 } 119 120 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" 121 onclick="$('#downloadImagesForm').submit(); return false;" role="button"> 122 @buttonCaption 123 </a> 124 } 125 } 126 127 @{ 128 Dynamicweb.Frontend.PageView thisPage = Dynamicweb.Frontend.PageView.Current() ?? Dynamicweb.Frontend.PageView.Current(); 129 Item areaItem = Item.GetItemById("Website_Settings", thisPage.Area.Item.Id); 130 string pageUrl = thisPage.SearchFriendlyUrl; 131 var siteSection = HagsWeb.Library.Methods.Page.HagsPages.GetSiteSection(thisPage.AreaID, thisPage.ID); 132 string salesPhoneNumber = areaItem["Telephone"].ToString(); 133 134 string productNumber = GetString("Ecom:Product.Number"); // The Product NUMBER 135 136 string currentCulture = GetGlobalValue("Global:Area.LongLang"); //en-GB, sv-SE 137 string currentCountry = currentCulture.Substring(currentCulture.Length - 2); // GB, SE 138 string currentlanguage = currentCulture.Substring(0,2); // en, sv "de";// 139 string ipPriceAllowed = HagsWeb.Library.Services.IPService.IPCheck.CountryPriceAllowed(currentCountry); // ZZZ,GB,SE (Web.config) 140 141 IEnumerable<ProductAsset> assets = AssetManager_Repository.GetAssets(productNumber, AssetType.All, true); 142 IEnumerable<ProductAsset> allImages = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)); 143 144 IEnumerable<ProductAsset> carouselImages = allImages 145 .Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) 146 && n.FileName.StartsWith("big_") 147 || n.FileName.StartsWith("big_Color_")); 148 149 // thumbs as a dependency of carouselImages 150 List<ProductAsset> thumbs = new List<ProductAsset>(); 151 152 foreach (var i in carouselImages.OrderByDescending(n => n.FileBytes)) 153 { 154 thumbs.Add(allImages.Select(n => n).Where(n => n.FileName == i.FileName.Replace("big_", "thumb_")).FirstOrDefault()); 155 } 156 157 //IEnumerable<ProductAsset> thumbs = allImages.Where(n => n.FileName.StartsWith("thumb_")); 158 159 IEnumerable<ProductAsset> hiResDownloads = allImages.Where(n => thumbs.Any(y => y.FileName.Replace("thumb_", "") == n.FileName)); 160 161 // The users Product Collection in session 162 List<ProductCollectionItem> productCollectionItems = SessionManager.UsersMyProductCollection != null ? SessionManager.UsersMyProductCollection : new List<ProductCollectionItem>(); 163 bool isProductCollection = productCollectionItems.Any(n => n.ProductNumber == productNumber); 164 165 string collectionData = string.Empty; 166 167 if (!String.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.Name"))) 168 { 169 // not used even if logged-in collectionData = GetString("Ecom:Product.AddToList"); // only available if logged-in 170 } 171 else 172 { 173 collectionData = string.Format("CCAddToMyLists={0}&CCAddToListVariantID={1}&CCAreaID={2}&CCAddToListCulture={3}&CCAddToListLanguageID={4}#{5}", 174 GetString("Ecom:Product.Number"), GetString("Ecom:Product.VariantID"), GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Area.LongLang"), @GetString("Ecom:Product.LanguageID"), siteSection); 175 } 176 // users Product Collection 177 178 List<string> ageRanges = new List<string>(); 179 180 foreach (var age in GetLoop("AgeRange.Options")) 181 { 182 if (age.GetBoolean("AgeRange.Option.IsSelected")) 183 { 184 ageRanges.Add(age.GetString("AgeRange.Option.Name").Replace("+", "_")); 185 } 186 } 187 188 // For filtering the variants of this product 189 ResultSet colourOptions = new ResultSet(); 190 ResultSet materialOptions = new ResultSet(); 191 ResultSet anchoringOptions = new ResultSet(); 192 ResultSet optionOptions = new ResultSet(); 193 194 195 string selectedColourVariant = string.Empty; 196 string selectedAnchoringVariant = string.Empty; 197 string selectedAnchoringIcon = string.Empty; 198 string selectedMaterialVariant = string.Empty; 199 string selectedOptionVariant = string.Empty; 200 201 if (GetInteger("Ecom:Product.VariantCount") > 0) 202 { 203 foreach (var variantGroup in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) // Remove All Date Variants 204 { 205 int optionsCount = variantGroup.GetLoop("VariantAvailableOptions").Count(); 206 207 if (optionsCount > 0) 208 { 209 if (!string.IsNullOrEmpty("Ecom:Product.SelectedVariantComboID")) // optionsCount == 1 210 { 211 foreach (var availableOption in variantGroup.GetLoop("VariantAvailableOptions")) 212 { 213 214 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "S55") 215 { 216 colourOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 217 218 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 219 { 220 221 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 }); 222 223 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 224 { 225 selectedColourVariant = availableOption.GetString("Ecom:VariantOption.Name"); 226 } 227 } 228 } 229 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP1") 230 { 231 materialOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 232 233 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 234 { 235 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 }); 236 237 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 238 { 239 selectedMaterialVariant = availableOption.GetString("Ecom:VariantOption.Name"); 240 } 241 } 242 } 243 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP3") 244 { 245 anchoringOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 246 247 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 248 { 249 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 }); 250 251 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 252 { 253 selectedAnchoringVariant = availableOption.GetString("Ecom:VariantOption.Name"); 254 selectedAnchoringIcon = availableOption.GetString("Ecom:VariantOption.ID") + ".png"; 255 } 256 } 257 } 258 if (variantGroup.GetString("Ecom:VariantGroup.ID") == "ATP4") 259 { 260 optionOptions.Name = variantGroup.GetString("Ecom:VariantGroup.Name"); 261 262 if (availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 263 { 264 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 }); 265 266 if (availableOption.GetBoolean("Ecom:VariantOption.Selected")) 267 { 268 selectedOptionVariant = availableOption.GetString("Ecom:VariantOption.Name"); 269 } 270 } 271 272 } 273 } 274 } 275 } 276 } 277 } 278 279 280 // Related Products and their Assembly Instructions 281 List<Product> relatedProducts = new List<Product>(); 282 List<Product> relatedComponentProducts = new List<Product>(); 283 List<ProductAsset> relatedProductsAssemblyInstructions = new List<ProductAsset>(); 284 285 if (GetInteger("Ecom:Product.RelatedCount") > 0) 286 { 287 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 288 { 289 relatedProducts = HagsWeb.Library.Methods.ProductFilter.ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), "Product Modules"); 290 } 291 292 if (GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Components") != null) 293 { 294 relatedComponentProducts = HagsWeb.Library.Methods.ProductFilter.ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), "Product Components"); 295 // Lookup Assembly Instructions Assets 296 foreach (Product product in relatedComponentProducts) 297 { 298 List<ProductAsset> productAssemblyInstructions = AssetManager_Repository.GetAssets(product.Number, AssetType.AssemblyInstructions, false); 299 if (productAssemblyInstructions.Any()) 300 { 301 List<ProductAsset> result = productAssemblyInstructions.Where(pa => !relatedProductsAssemblyInstructions.Any(pa2 => pa2.FileName == pa.FileName)).ToList(); 302 relatedProductsAssemblyInstructions.AddRange(result); 303 } 304 } 305 } 306 } 307 } 308 309 310 <!--Templates/Designs/HagsCore/eCom/Product/Product.cshtml--> 311 312 @Scripts.Render("~/bundle/ProductFilter") 313 314 <input type="hidden" id="productVariantId" value="@GetString("Ecom:Product.VariantID")"> 315 316 <div class="m-heading m-theme-background-yellow m-theme-color-white breadcrumb product"> 317 <div class="l-page"> 318 <div class="container-fluid"> 319 @{ 320 string breadcrumb = HagsWeb.Library.Methods.Page.HagsPages.GetThisPageNavigation(pageUrl, GetGlobalValue("Global:Area.LongLang")); 321 } 322 <div class="m-menu-primary breadcrumb"> 323 <nav class="text-centre text-uppercase"> 324 @breadcrumb 325 </nav> 326 </div> 327 328 </div> <!-- container-fluid --> 329 </div> <!-- l-page --> 330 </div> <!-- m-heading --> 331 332 <div class="l-page"> 333 <div class="container-fluid"> 334 @*<p>@ipPriceAllowed || ShopID = @GetString("Ecom:Product.DefaultShopID")</p>*@ 335 @*<p> Variant?@GetString("Ecom:Product.VariantID")</p>*@ 336 <div class="row"> 337 <div class="col-sm-7" style="float:right;"> 338 <div class="m-product-gallery-visual-print"> 339 @foreach (ProductAsset image in carouselImages.OrderByDescending(n => n.FileBytes)) 340 { 341 <p style="text-align:center !important;"><img src="@image.uri" class="img-responsive" alt="Masthead image" /></p> 342 } 343 </div> <!-- m-product-gallery-visual --> 344 </div> 345 346 <div class="col-sm-5"> 347 348 <h1>@GetString("Ecom:Product.Name")</h1> 349 350 <p>@GetString("Ecom:Product.ShortDescription")</p> 351 352 <div class="col-sm-12"> 353 @if (thisPage.Area.ID == 7) /*UK*/ 354 { 355 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.UKProductNumber"))) 356 { 357 <h3>@GetString("Ecom:Product:Field.UKProductNumber")</h3> 358 } 359 else if (!string.IsNullOrEmpty(GetString("Ecom:Product.Number"))) 360 { 361 <h3>@GetString("Ecom:Product.Number")</h3> 362 } 363 } 364 else 365 { 366 <h3>@productNumber</h3> 367 } 368 </div> 369 370 @*Check if its a Master product*@ 371 @if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || GetLoop("VariantCombinations").Count() == 1) 372 { 373 <div class="col-sm-12" style="display:block;float:left;width:100%;overflow:auto;" data-toggle="tooltip" data-placement="top" title="@Translate("Anchoring", "Anchoring"): @selectedAnchoringVariant"> 374 375 @*Display the correct icon*@ 376 @if (!string.IsNullOrEmpty(selectedAnchoringIcon)) 377 { 378 <img src="Files/Templates/Designs/HagsCore/res/img/icons/anchoring/@selectedAnchoringIcon" alt="@selectedAnchoringVariant" style="display:block;float:left;" /> 379 } 380 <p style="display:block;float:left; margin-left:12px">@selectedOptionVariant<br />@selectedColourVariant - @selectedAnchoringVariant</p> 381 </div> 382 } 383 384 385 @*Only UK and Sweden have Pricing at the moment*@ 386 @if (thisPage.Area.ID == 2 && (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_"))) /*Sweden - would like no ,00 in dwFormattedPrice and a message if there is no price*/ 387 { 388 string krPrice = GetInteger("Ecom:Product.DBPrice") == 0 ? Translate("RequestAQuote", "Kontakta oss") : GetString("Ecom:Product.Price.PriceFormatted").Replace(",00", ""); 389 <p><strong>@Translate("Price", "Price"): @krPrice</strong></p> 390 } 391 @if (thisPage.Area.ID == 7) /*UK*/ 392 { 393 if (!string.IsNullOrEmpty(GetString("Ecom:Product:Field.UKProductNumber"))) 394 { 395 <p><strong>@Translate("ProductNumber", "Product Number"):</strong> @GetValue("Ecom:Product:Field.UKProductNumber")</p> 396 } 397 398 if (ipPriceAllowed.Contains(currentCountry) || ipPriceAllowed.Contains("Hags_")) 399 { 400 string ukPrice = string.IsNullOrEmpty(GetString("Ecom:Product:Field.UKProductPrice")) ? "On Application" : "&pound;" + string.Format(new System.Globalization.CultureInfo("en-GB", false), "{0:c}", GetValue("Ecom:Product:Field.UKProductPrice")); 401 <p><strong>@Translate("Price", "Price"): @ukPrice</strong></p> 402 } 403 404 } 405 406 407 408 @if (GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0 && GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 409 { 410 <div class="col-sm-12" style="display:block;float:left;width:100%;margin-top:10px;" data-toggle="tooltip" data-placement="top" title="@GetString("Ecom:Product:Field.SafetyAreaWidth.Name") x @GetString("Ecom:Product:Field.SafetyAreaLength.Name")"> 411 <img src="Files/Templates/Designs/HagsCore/res/img/icons/whtstar.png" alt="s" style="display:block;float:left;" /> 412 <p style="display:block;float:left; margin-left:12px;margin-top:3px;">@GetInteger("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") x @GetInteger("Ecom:Product:Field.SafetyAreaLength.Value.Raw")</p> 413 </div> 414 } 415 416 417 418 <div class="col-sm-12 panel-group" style="display:block;float:left;width:100%;margin-top:18px;" id="accordion" role="tablist" aria-multiselectable="false"> 419 <div class="panel panel-default"> 420 <div class="panel-heading" role="tab" id="headingOne"> 421 <h4 class="m-panel-title panel-title"> 422 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne" class=""> 423 @Translate("ProductSpecifications", "Product Specifications") 424 </a> 425 </h4> 426 </div> 427 <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true"> 428 <div class="panel-body"> 429 <div id="product-left"> 430 <div class="padding"> 431 432 <div id="product-list-information" class="box-padding"> 433 434 <ul> 435 436 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 437 { 438 <li><span><strong>@GetString("Ecom:Product:Field.AgeRange.Name"):</strong></span> <span>@string.Join(", ", ageRanges)</span></li> 439 } 440 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 441 { 442 <li><span><strong>@GetString("Ecom:Product:Field.AssemblyTime.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.AssemblyTime.Value.Raw") @Translate("Hours", "hours")</span></li> 443 } 444 @if (GetDouble("Ecom:Product:Field.Length.Value.Raw") > 0) 445 { 446 <li><span><strong>@GetString("Ecom:Product:Field.Length.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Length.Value.Raw") mm</span></li> 447 } 448 @if (GetDouble("Ecom:Product:Field.Width.Value.Raw") > 0) 449 { 450 <li><span><strong>@GetString("Ecom:Product:Field.Width.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Width.Value.Raw") mm</span></li> 451 } 452 @if (GetDouble("Ecom:Product:Field.Height.Value.Raw") > 0) 453 { 454 <li><span><strong>@GetString("Ecom:Product:Field.Height.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Height.Value.Raw") mm</span></li> 455 } 456 @if (GetDouble("Ecom:Product:Field.NetWeight.Value.Raw") > 0) 457 { 458 <li><span><strong>@GetString("Ecom:Product:Field.NetWeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.NetWeight.Value") kg</span></li> 459 } 460 @if (GetDouble("Ecom:Product:Field.Volume.Value.Raw") > 0) 461 { 462 <li><span><strong>@GetString("Ecom:Product:Field.Volume.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.Volume.Value.Raw") m&#179;</span></li> 463 } 464 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 465 { 466 <li><span><strong>@GetString("Ecom:Product:Field.FallHeight.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.FallHeight.Value.Raw") mm</span></li> 467 } 468 @if (GetDouble("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") > 0) 469 { 470 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaWidth.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaWidth.Value.Raw") mm</span></li> 471 } 472 @if (GetDouble("Ecom:Product:Field.SafetyAreaLength.Value.Raw") > 0) 473 { 474 <li><span><strong>@GetString("Ecom:Product:Field.SafetyAreaLength.Name"):</strong></span> <span>@GetString("Ecom:Product:Field.SafetyAreaLength.Value.Raw") mm</span></li> 475 } 476 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 477 { 478 <li><span><strong>@GetString("Ecom:Product:Field.SafetyArea.Name"):</strong></span> <span>@GetDouble("Ecom:Product:Field.SafetyArea.Value") m&#178;</span></li> 479 } 480 481 </ul> 482 483 @*Anchoring from Variant*@ 484 @if (!string.IsNullOrEmpty(selectedAnchoringVariant)) 485 { 486 string anchoringPage = HagsWeb.Library.Utilities.DWUtilities.GetPageByNavigationTag("AnchoringTypes", thisPage.Area.ID); 487 488 if (!string.IsNullOrEmpty(anchoringPage)) 489 { 490 <a href="@anchoringPage" class="print-hide">@Translate("ReadMoreAnchoring", "Read more about anchoring")</a> 491 } 492 493 } 494 495 </div> 496 497 </div> <!--! .padding --> 498 </div> 499 </div> 500 </div> 501 </div> 502 503 504 <div class="panel panel-default"> 505 <div class="panel-heading" role="tab" id="headingTwo"> 506 <h4 class="m-panel-title panel-title"> 507 <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo" class="collapsed"> 508 @GetString("Ecom:Product:Field.Material.Name") 509 </a> 510 </h4> 511 </div> 512 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true"> 513 <div class="panel-body"> 514 <div id="product-left"> 515 <div class="padding"> 516 517 518 <p>&nbsp;</p> 519 @{ 520 521 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"); 522 if (!string.IsNullOrEmpty(materialData)) 523 { 524 //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")); 525 System.Xml.Linq.XDocument dataXML = System.Xml.Linq.XDocument.Parse(materialData); 526 527 if (dataXML != null) 528 { 529 System.Globalization.NumberFormatInfo format = new System.Globalization.NumberFormatInfo(); 530 format.NumberGroupSeparator = ","; //for thousands 531 format.NumberDecimalSeparator = "."; //the decimal seperator 532 533 var totalweight = Math.Round((from nd in dataXML.Descendants("kg") 534 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 535 536 var totalpercent = Math.Round((from nd in dataXML.Descendants("percent") 537 select Double.Parse(nd.Value, format)).Sum(), 0).ToString(); 538 539 var details = from dat in dataXML.Descendants("Item") 540 select new 541 { 542 material = dat.Element("material").Value, 543 weight = dat.Element("kg").Value, 544 percent = dat.Element("percent").Value 545 }; 546 547 <table class="table"> 548 <thead> 549 <tr> 550 <th>@GetString("Ecom:Product:Field.Material.Name")</th> 551 <th>kg</th> 552 <th>&#37;</th> 553 </tr> 554 </thead> 555 556 <tbody> 557 558 @foreach (var item in details) 559 { 560 <tr> 561 <td>@item.material</td> 562 <td>@item.weight</td> 563 <td>@item.percent</td> 564 </tr> 565 } 566 567 568 569 </tbody> 570 571 <tfoot> 572 <tr> 573 <td>&nbsp;</td> 574 <td><strong>@totalweight kg</strong></td> 575 <td><strong>@totalpercent&#37;</strong></td> 576 </tr> 577 </tfoot> 578 </table> <!--! #table-materials --> 579 } 580 } 581 582 } 583 584 </div> <!--! .padding --> 585 </div> 586 </div> 587 </div> 588 </div> 589 590 591 </div> 592 593 </div> 594 595 <div class="col-sm-7"> 596 597 <div class="m-product-gallery-visual print-hide" style="margin-top: 30px;display:block;float:left;width:100%;"> 598 <ul> 599 @foreach (ProductAsset image in carouselImages.OrderByDescending(n => n.FileBytes)) 600 { 601 <li style="text-align:left !important;"><img src="@image.uri" class="img-responsive" alt="Masthead image" style="width:auto;margin: 0 auto 0 auto;" /></li> 602 } 603 </ul> 604 </div> <!-- m-product-gallery-visual --> 605 606 607 608 <div class="m-decal-container"> 609 610 <div class="m-decal"> 611 <ul class="list-inline"> 612 @if (!String.IsNullOrWhiteSpace(GetString("Ecom:Product:Field.AgeRange")) && ageRanges.Any()) 613 { 614 foreach (var range in ageRanges) 615 { 616 <li class="decal"> 617 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString("Ecom:Product:Field.AgeRange.Name") @range"> 618 <img src="Files/Templates/Designs/HagsCore/res/img/decals/agerange.png" alt="@GetString("Ecom:Product:Field.AgeRange.Name") @range" /> 619 <span class="decalvalue">@range</span> 620 </div> 621 </li> 622 } 623 } 624 625 @if (GetDouble("Ecom:Product:Field.AssemblyTime.Value.Raw") > 0) 626 { 627 <li class="decal"> 628 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString("Ecom:Product:Field.AssemblyTime.Name") @GetString("Ecom:Product:Field.AssemblyTime.Value.Raw") hrs"> 629 630 <img src="Files/Templates/Designs/HagsCore/res/img/decals/time.png" alt="@GetString("Ecom:Product:Field.AssemblyTime.Name") @GetString("Ecom:Product:Field.AssemblyTime.Value.Raw") hrs" /> 631 632 <span class="decalvalue">@GetString("Ecom:Product:Field.AssemblyTime.Value.Raw")</span> 633 634 </div> 635 </li> 636 } 637 638 @if (GetDouble("Ecom:Product:Field.FallHeight.Value.Raw") > 0) 639 { 640 <li class="decal"> 641 <div class="decal-header" data-toggle="tooltip" data-placement="top" title="@GetString("Ecom:Product:Field.FallHeight.Name") @GetString("Ecom:Product:Field.FallHeight.Value.Raw")"> 642 643 <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")" /> 644 645 <span class="decalvalue">@GetString("Ecom:Product:Field.FallHeight.Value.Raw")</span> 646 647 </div> 648 </li> 649 } 650 651 @if (GetDouble("Ecom:Product:Field.SafetyArea.Value.Raw") > 0) 652 { 653 <li class="decal"> 654 <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;"> 655 656 <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;" /> 657 658 <span class="decalvalue">@GetDouble("Ecom:Product:Field.SafetyArea.Value")</span> 659 660 </div> 661 </li> 662 } 663 </ul> 664 </div> <!-- m-decals --> 665 666 </div> <!-- m-decals-container --> 667 668 <div class="m-product-gallery-sync slider-nav print-hide"> 669 <ul class="list-inline thumbnails"> 670 @foreach (ProductAsset thumb in thumbs) 671 { 672 <li><img src="@thumb.uri" class="thumbnail img-responsive" alt="Masthead image" /></li> 673 } 674 @*<li class="slick-slide slick-active" data-slick-index="0" aria-hidden="false" tabindex="-1" role="option" aria-describedby="slick-slide20" style=""><img src="Assets/8048383/Bilder/thumb_8048383.jpg" class="thumbnail img-responsive" alt="Masthead image"></li> 675 <li class="slick-slide slick-active" data-slick-index="1" aria-hidden="false" tabindex="-1" role="option" aria-describedby="slick-slide21"><img src="Assets/8048383/Bilder/thumb_8048383_2_8048383_Abbax_2.jpg" class="thumbnail img-responsive" alt="Masthead image"></li> 676 <li class="slick-slide slick-active" data-slick-index="2" aria-hidden="false" tabindex="-1" role="option" aria-describedby="slick-slide22"><img src="Assets/8048383/Bilder/thumb_8048383_Side.jpg" class="thumbnail img-responsive" alt="Masthead image"></li> 677 <li class="slick-slide slick-current slick-active" data-slick-index="3" aria-hidden="false" tabindex="-1" role="option" aria-describedby="slick-slide23"><img src="Assets/8048383/Bilder/thumb_8048383_Top.jpg" class="thumbnail img-responsive" alt="Masthead image"></li>*@ 678 679 </ul> 680 </div> 681 682 <div> 683 684 <ul class="m-btn-menu-secondary print-hide"> 685 @{ 686 var imagesCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images)).Count(); 687 var brochCount = assets.Select(n => n).Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Brochures)).Count(); 688 } 689 690 @if (imagesCount + brochCount < assets.Count()) 691 { 692 <li> 693 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="#collapseThree" 694 role="button" 695 data-toggle="collapse" 696 data-parent="#productdownload" 697 id="productDownloadButton" 698 aria-controls="collapseThree">@Translate("ProductDownloads", "Product Downloads")</a> 699 </li> 700 } 701 702 @{ 703 if (hiResDownloads.Count() > 0) 704 { 705 List<string> fileList = new List<string>(); 706 foreach (var file in hiResDownloads) 707 { 708 fileList.Add(file.FullPath); 709 } 710 711 <li> 712 <form method="post" id="downloadImagesForm"> 713 <input type="hidden" name="DownloadImages" value="@productNumber" /> 714 @GetButton(fileList, "Product") 715 </form> 716 717 </li> 718 } 719 } 720 721 722 <li> 723 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="" 724 role="button" 725 data-toggle="collapse" 726 data-parent="#productdownload" 727 id="productSheetButton" 728 aria-controls="collapseFour" onclick="javascript:window.print();">@Translate("ProductSheet", "Product Sheet")</a> 729 </li> 730 731 @*<li>Check this again do we add a master with default Variant combinatiions to my product collection?? button is hidden.</li>*@ 732 733 @if (!string.IsNullOrEmpty(GetString("Ecom:Product.VariantID")) || GetLoop("VariantCombinations").Count() == 1) 734 { 735 //display the button if we have the appropriate script loaded (advanced-search-min.js) 736 737 <li id="btnMyProductCollection" style="margin-top: 8px;"> 738 739 @if (isProductCollection) 740 { 741 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase print-hide" href="" role="button" data-removeproductlist="@GetString("Ecom:Product.Number")" data-addproductlist=""><span>@Translate("RemoveFromCollection", "Remove from my Collection")</span></a> 742 } 743 else 744 { 745 <a class="m-btn-xs-more 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> 746 } 747 748 </li> 749 } 750 751 752 @*only works if logged-in 753 <li><a href="@GetString("Ecom:Product.AddToList")">Add To List Do something else</a></li>*@ 754 755 @if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 756 { 757 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 758 <a href="/default.aspx?id=@GetString("Ecom:Product:Page.ID")&amp;productid=@GetString("Ecom:Product.ID")&amp;CatalogPublishingcmd=addtocatalog">Add to catalog</a> 759 </li> 760 } 761 762 @if (GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing")) 763 { 764 <li class="show" style="clear: both; width: 100%;padding-bottom:5px; text-align: right;"> 765 <a href="/default.aspx?CatalogPublishingcmd=preview">Catalog Publishing</a> 766 </li> 767 } 768 </ul> 769 770 </div> 771 772 <div class="panel-group" id="productdownload" role="tablist" aria-multiselectable="false"> 773 774 <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productDownloadButton" aria-expanded="true" style="height: 0px;"> 775 776 <div class="panel panel-default panel-body print-hide"> 777 778 @{ 779 List<ProductAsset> certAssets = new List<ProductAsset>(); 780 if (thisPage.Area.ID == 1) 781 { 782 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates)).ToList(); 783 } 784 else 785 { 786 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith(currentCountry + "_")).ToList(); 787 } 788 789 if (certAssets.Count() == 0) // if none are found try to get GB certificates 790 { 791 certAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Certificates) && n.FileName.StartsWith("GB_")).ToList(); 792 } 793 } 794 795 @if (certAssets.Count > 0) 796 { 797 <h5>@Translate("Certificates", "Certificates")</h5> 798 <ul> 799 @foreach (ProductAsset cert in certAssets) 800 { 801 802 <li> 803 <a href="@cert.uri" download="@cert.FileName"> 804 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@cert.FileName</span> 805 </a> 806 </li> 807 } 808 </ul> 809 } 810 811 812 @{ 813 List<ProductAsset> assemblyAssets = new List<ProductAsset>(); 814 assemblyAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.AssemblyInstructions)).ToList(); 815 } 816 817 @if (assemblyAssets.Count > 0) 818 { 819 <h5>@Translate("InstallationGuides", "Installation Guides")</h5> 820 <ul> 821 @foreach (ProductAsset assemblyInstns in assemblyAssets) 822 { 823 <li> 824 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 825 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 826 </a> 827 </li> 828 } 829 </ul> 830 } 831 832 @if (relatedProductsAssemblyInstructions.Count > 0) 833 { 834 <h5>@Translate("DetailedInstallationGuides", "Detailed Installation Guides")</h5> 835 <ul class="list-column list-inline"> 836 @foreach (ProductAsset assemblyInstns in relatedProductsAssemblyInstructions) 837 { 838 <li> 839 <a href="@assemblyInstns.uri" download="@assemblyInstns.FileName"> 840 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif" /></span><span>@assemblyInstns.FileName</span> 841 </a> 842 </li> 843 } 844 </ul> 845 } 846 847 @{ 848 List<ProductAsset> dwgAssets = new List<ProductAsset>(); 849 dwgAssets = assets.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Drawings)).ToList(); 850 } 851 852 @if (dwgAssets.Count > 0) 853 { 854 <h5>@Translate("DWGFiles", "DWG Files")</h5> 855 <ul> 856 @foreach (ProductAsset dwg in dwgAssets) 857 { 858 <li> 859 <a href="@dwg.uri" download="@dwg.FileName"> 860 <span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/dwg_small.gif" /></span><span>@dwg.FileName</span> 861 </a> 862 </li> 863 } 864 </ul> 865 } 866 867 <h5>@Translate("GeneralInformation", "General Information")</h5> 868 <ul> 869 @if (thisPage.Area.ID == 2) 870 { 871 <li><a href="Files/Files/Downloads/Sweden/hags-general-info-se.pdf"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("GeneralInformation", "General Information")</span></a></li> 872 <li><a href="Files/Files/Downloads/Sweden/hags-technical-specs-se.pdf"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("TechnicalInformation", "Technical Information")</span></a></li> 873 } 874 else 875 { 876 <li><a href="Files/Files/Downloads/hags-general-info-en%20(6).pdf"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("GeneralInformation", "General Information")</span></a></li> 877 <li><a href="Files/Files/Downloads/hags-technical-specs-en%20(2).pdf"><span><img src="Files/Templates/Designs/HagsCore/res/img/icons/downloads/pdf_small.gif"></span><span>@Translate("TechnicalInformation", "Technical Information")</span></a></li> 878 } 879 880 </ul> 881 </div> 882 883 </div> 884 885 <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="productSheetButton" aria-expanded="true" style="height: 0px;"> 886 887 <div class="panel-body print-hide"> 888 <p>Printed</p> 889 </div> 890 891 </div> 892 893 </div> 894 895 @if (!String.IsNullOrEmpty(salesPhoneNumber)) 896 { 897 string contactUsLink = DWUtilities.GetPageByNavigationTag("ContactUs", thisPage.Area.ID); 898 <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> 899 } 900 901 902 </div> 903 </div> <!-- row --> 904 </div> <!-- container-fluid --> 905 </div> 906 907 908 @if (GetLoop("VariantCombinations").Count() > 0) 909 { 910 <div class="m-sort m-theme-background-lightgrey product-options print-hide"> 911 <div class="l-page"> 912 <div class="container-fluid"> 913 <div class="row"> 914 <div> 915 <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> 916 </div> 917 <form class="form-inline"> 918 <div id="filter-variants"> 919 920 @if (anchoringOptions.Results.Count() > 0) 921 { 922 <div class="form-container"> 923 <div class="form-group"> 924 <label for="anchoring" class="control-label">@Translate("Anchoring", "Anchoring")</label> 925 <select class="form-control valid third" id="filter-anchoring" name="anchoring"> 926 927 @if (anchoringOptions.Results.Count() > 1) 928 { 929 <option value="0">@Translate("Any", "Any")</option> 930 foreach (var anchor in anchoringOptions.Results.OrderBy(n => n.Sort)) 931 { 932 <option value="@anchor.Value">@anchor.Name</option> 933 } 934 } 935 else 936 { 937 ResultField result = anchoringOptions.Results.FirstOrDefault(); 938 <option value="@result.Value">@result.Name</option> 939 } 940 941 </select> 942 </div> 943 944 </div> 945 } 946 947 @if (colourOptions.Results.Count() > 0) 948 { 949 <div class="form-container"> 950 951 <div class="form-group"> 952 <label for="colour" class="control-label">@Translate("Colour", "Colour")</label> 953 <select class="form-control valid first" id="filter-colour" name="colour"> 954 955 @if (colourOptions.Results.Count() > 1) 956 { 957 <option value="0">@Translate("Any", "Any")</option> 958 foreach (var colour in colourOptions.Results.OrderBy(n => n.Sort)) 959 { 960 <option value="@colour.Value">@colour.Name</option> 961 } 962 } 963 else 964 { 965 ResultField result = colourOptions.Results.FirstOrDefault(); 966 <option value="@result.Value">@result.Name</option> 967 } 968 969 970 971 </select> 972 </div> 973 974 </div> 975 } 976 977 @if (optionOptions.Results.Count() > 0) 978 { 979 <div class="form-container"> 980 981 <div class="form-group"> 982 <label for="options" class="control-label">@Translate("ProductOptions", "Product Options")</label> 983 <select class="form-control valid" id="filter-options" name="options"> 984 985 @if (optionOptions.Results.Count() > 1) 986 { 987 <option value="0">@Translate("Any", "Any")</option> 988 foreach (var option in optionOptions.Results.OrderBy(n => n.Sort)) 989 { 990 <option value="@option.Value">@option.Name</option> 991 } 992 } 993 else 994 { 995 ResultField result = optionOptions.Results.FirstOrDefault(); 996 <option value="@result.Value">@result.Name</option> 997 } 998 </select> 999 </div> 1000 1001 </div> 1002 } 1003 1004 </div> 1005 </form> 1006 </div> 1007 </div> 1008 </div> 1009 </div> 1010 1011 1012 <div class="l-page print-hide"> 1013 <div class="box-slider-filter-content" id="filter-variants-slider-content"> 1014 1015 @foreach (LoopItem variantCombinations in GetLoop("VariantCombinations")) 1016 { 1017 var colourOption = string.Empty; 1018 var optionOption = string.Empty; 1019 var anchorOption = string.Empty; 1020 var materialOption = string.Empty; 1021 var colourId = string.Empty; 1022 var optionId = string.Empty; 1023 var anchorId = string.Empty; 1024 var materialId = string.Empty; 1025 var selectedVariant = string.Empty; 1026 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(variantCombinations.GetString("Ecom:VariantCombination.Product.Number"), AssetType.Images, false); 1027 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("big_") || n.FileName.StartsWith("big_Color_")).FirstOrDefault(); 1028 1029 foreach (var group in GetLoop("VariantGroups").Where(n => n.GetString("Ecom:VariantGroup.ID") != "D")) 1030 { 1031 foreach (var availableOption in group.GetLoop("VariantAvailableOptions")) 1032 { 1033 1034 if (group.GetString("Ecom:VariantGroup.ID") == "S55") 1035 { 1036 1037 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1038 { 1039 colourOption = availableOption.GetString("Ecom:VariantOption.Name"); 1040 colourId = availableOption.GetString("Ecom:VariantOption.ID"); 1041 } 1042 1043 } 1044 if (group.GetString("Ecom:VariantGroup.ID") == "ATP1") 1045 { 1046 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1047 { 1048 materialOption = availableOption.GetString("Ecom:VariantOption.Name"); 1049 materialId = availableOption.GetString("Ecom:VariantOption.ID"); 1050 } 1051 } 1052 if (group.GetString("Ecom:VariantGroup.ID") == "ATP3") 1053 { 1054 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1055 { 1056 anchorOption = availableOption.GetString("Ecom:VariantOption.Name"); 1057 anchorId = availableOption.GetString("Ecom:VariantOption.ID"); 1058 } 1059 } 1060 if (group.GetString("Ecom:VariantGroup.ID") == "ATP4") 1061 { 1062 if (variantCombinations.GetString("Ecom:VariantCombination.VariantID").Contains(availableOption.GetString("Ecom:VariantOption.ID")) && availableOption.GetString("Ecom:VariantOption.Name") != "Not applicable") 1063 { 1064 optionOption = availableOption.GetString("Ecom:VariantOption.Name"); 1065 optionId = availableOption.GetString("Ecom:VariantOption.ID"); 1066 } 1067 } 1068 if (variantCombinations.GetBoolean("Ecom:VariantCombination.Selected")) 1069 { 1070 selectedVariant = "selected-variant"; 1071 } 1072 } 1073 1074 } 1075 1076 <div class="m-attractor @selectedVariant" style="margin-bottom: 4em;"> 1077 1078 <div class="m-attractor-visual" style="height:180px;"> 1079 @if (productImages != null && productImages.Count > 0 && !String.IsNullOrEmpty(image.uri)) 1080 { 1081 <a href="@variantCombinations.GetString("Ecom:VariantCombination.Link.Clean")"><img src="@image.uri" class="img-responsive m-product-thumb" /></a> 1082 } 1083 else 1084 { 1085 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1086 } 1087 </div> 1088 1089 <input type="hidden" name="prop-colour" value="@colourId" /> 1090 <input type="hidden" name="prop-anchoring" value="@anchorId" /> 1091 <input type="hidden" name="prop-option" value="@optionId" /> 1092 1093 <div class="m-attractor-info m-attractor-info-product"> 1094 <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> 1095 <div class="m-attractor-info m-attractor-info-product"> 1096 <p>@optionOption<br /> @colourOption - @anchorOption</p> 1097 </div> 1098 <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> 1099 </div> 1100 </div> 1101 1102 } 1103 </div> 1104 1105 <div class="m-message" style="display:none;padding-bottom:20px;padding-left:6px;"> 1106 <p style="font-size: 1.2em;color:red;"><b>@Translate("VariantFilterMessage", "There were no options available for selection.")</b></p> 1107 </div> 1108 </div> 1109 } 1110 1111 @if (relatedProducts.Any()) 1112 { 1113 int count = relatedProducts.Count(); 1114 <div class="m-heading m-theme-background-lightgrey print-hide"> 1115 <div class="l-page"> 1116 <div class="container-fluid"> 1117 <h4 class="m-panel-title">@Translate("PlayFunctions", "Play Functions")</h4> 1118 </div> <!-- container-fluid --> 1119 </div> <!-- l-page --> 1120 </div> 1121 1122 <div class="l-page play-functions print-hide" style="margin-bottom: 3em;"> 1123 <div class="box-slider-content" id="related-products-slider-content"> 1124 1125 @foreach (Product product in relatedProducts) 1126 { 1127 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(product.Number, AssetType.Images, false); 1128 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("big_") || n.FileName.StartsWith("big_Color_")).FirstOrDefault(); 1129 1130 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1131 <div class="m-attractor"> 1132 <div class="m-attractor-visual"> 1133 @if (productImages != null && productImages.Count > 0 && !String.IsNullOrEmpty(image.uri)) 1134 { 1135 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1136 } 1137 else 1138 { 1139 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1140 } 1141 </div> 1142 <div class="m-attractor-info m-attractor-info-product"> 1143 <h3 class="m-theme-after-yellow m-theme-border-yellow">@product.Name</h3> 1144 </div> <!-- attractor-info --> 1145 </div> <!-- attractor --> 1146 </div> 1147 } 1148 1149 1150 </div> <!-- box-slider-content --> 1151 </div><!-- l-page --> 1152 } 1153 1154 @*@revisit This*@ 1155 1156 @if (GetInteger("Ecom:Product.RelatedCount") > 0 && GetLoop("ProductRelatedGroups").Where(n => n.GetString("Ecom:Product:RelatedGroup.Name") == "Product Modules") != null) 1157 { 1158 //List<Dynamicweb.Ecommerce.Products.Product> relatedProducts = HagsWeb.Library.Methods.ProductFilter.ProductFilter.GetRelatedProducts(GetString("Ecom:Product.Number"), "Product Modules"); 1159 1160 if (relatedProducts.Any()) 1161 { 1162 1163 <div class="m-heading m-theme-background-lightgrey screen-hide"> 1164 <div class="l-page"> 1165 <div class="container-fluid"> 1166 <h2>@Translate("PlayFunctions", "Play Functions")</h2> 1167 </div> <!-- container-fluid --> 1168 </div> <!-- l-page --> 1169 </div> 1170 1171 1172 <div class="m-attractor-group screen-hide"> 1173 <div class="l-page"> 1174 <div class="container-fluid"> 1175 <div class="l-group-6 row"> 1176 1177 @foreach (Product product in relatedProducts) 1178 { 1179 List<ProductAsset> productImages = AssetManager_Repository.GetAssets(product.Number, AssetType.Images, false); 1180 ProductAsset image = productImages.Where(n => n.Index == AssetTypeEnum.ToFriendlyAssetName(AssetType.Images) && n.FileName.StartsWith("big_") || n.FileName.StartsWith("big_Color_")).FirstOrDefault(); 1181 // in this case we dont show a link to the product -- // Create a Url through the Page hiearchy attached to Dw eCom_Catalog Module in a Paragraph to a product detail page 1182 //string detailUrl = DWUtilities.GetProductSearchResultUrl("ProductNumber=" + product.Number.ToString(), false, thisPage.Area.ID); 1183 //string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(detailUrl); 1184 // All Related products are now Active = false so no URLs exist 1185 <div class="l-group-content col-xs-12 col-ms-4 col-sm-2 modules"> 1186 <div class="m-attractor"> 1187 <div class="m-attractor-visual"> 1188 @if (productImages != null && productImages.Count > 0 && !String.IsNullOrEmpty(image.uri)) 1189 { 1190 <img src="@image.uri" class="img-responsive m-product-thumb" /> 1191 } 1192 else 1193 { 1194 <img src="/Files/Templates/Designs/HagsCore/res/img/image-not-found.png" class="img-responsive m-product-thumb" /> 1195 } 1196 </div> 1197 <div class="m-attractor-info m-attractor-info-product"> 1198 <h3 class="m-theme-after-yellow m-theme-border-yellow">@product.Name</h3> 1199 <!--<p><strong>Product Number:</strong> @product.Number</p>--> 1200 @*@if (thisPage.Area.ID > 1) // Not shown on Global Site 1201 { 1202 <p><stong>@product.Price.Price kr</stong></p> 1203 }*@ 1204 1205 </div> <!-- attractor-info --> 1206 </div> <!-- attractor --> 1207 </div> 1208 1209 } 1210 1211 </div> <!-- row --> 1212 </div> <!-- container-fluid --> 1213 </div> <!-- l-page --> 1214 </div> 1215 1216 } 1217 } 1218 1219 1220