Error executing template "Designs/BioLegend/_parsed/index.parsed.cshtml"
System.IO.IOException: The process cannot access the file 'f:\Domains\Sites\www.biolegend.com\Files\System\Diagnostics\Products\Products.index\C\2022-12-06 110052\status.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at BioLegend.Web.Helpers.CdnFunctions.GetTicksFromXmlFile(String xmlFile)
   at BioLegend.Web.Helpers.CdnFunctions.GetCdnVersion()
   at CompiledRazorTemplates.Dynamic.RazorEngine_788bf7223c7d4c6ba6535cb1c3b8d9da.Execute() in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\_parsed\index.parsed.cshtml:line 170
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using System 3 @using Dynamicweb.Rendering 4 @using System.Web; 5 @using System.Text; 6 @using System.Text.RegularExpressions; 7 @using System.Globalization; 8 @using System.Collections.Generic; 9 @using System.Linq; 10 @using Dynamicweb.Security.UserManagement; 11 @using BioLegend.Ecommerce.LiveIntegration; 12 @using Dynamicweb.Environment 13 @using System.Collections.Specialized; 14 @using System.Linq 15 @functions { 16 17 public string LocalizeLinksHTML (string HtmlContent){ 18 int areaID = Pageview.Area.ID; 19 var area = Dynamicweb.Services.Areas.GetArea(areaID); 20 string areaCulture = area.Culture.ToLower(); 21 if(!string.IsNullOrEmpty(HtmlContent)){ 22 if(HtmlContent.IndexOf("dwcountry") > -1){ 23 return HtmlContent.Replace("dwcountry",areaCulture); 24 } else{ 25 return HtmlContent; 26 } 27 28 } else { 29 return HtmlContent; 30 } 31 32 } 33 34 public string LocalizeLinks (string HtmlContent){ 35 int areaID = Pageview.Area.ID; 36 var area = Dynamicweb.Services.Areas.GetArea(areaID); 37 string areaCulture = area.Culture.ToLower(); 38 if(!string.IsNullOrEmpty(HtmlContent)){ 39 if(HtmlContent.IndexOf("dwcountry") > -1){ 40 return HtmlContent.Replace("dwcountry",areaCulture); 41 } else if (HtmlContent.IndexOf("?ID=") > -1) { 42 //do something 43 string baseHref = String.Format("https://{0}",GetGlobalValue("Global:Request.Host")); 44 HtmlContent = HtmlContent.Contains("http") ? HtmlContent : baseHref + "/" + HtmlContent; 45 var uri = new Uri(HtmlContent,UriKind.RelativeOrAbsolute); 46 var parsedQuery = HttpUtility.ParseQueryString(uri.Query); 47 var pageID = parsedQuery.Get("ID"); 48 49 string pageVersionID = pageID; 50 string localizedLink = HtmlContent; 51 if (!string.IsNullOrEmpty(pageID)){ 52 var pageService = new Dynamicweb.Content.PageService(); 53 var linkPage = pageService.GetPagesByAreaID(areaID).FirstOrDefault(x => x.MasterPageId == int.Parse(pageID)); 54 pageVersionID = linkPage != null ? linkPage.ID.ToString() : pageID ; 55 56 localizedLink = ModifyQueryStringValue(HtmlContent,"ID",pageVersionID); 57 } 58 //return string.Join(",", parsedQuery.AllKeys); 59 //return string.Join(HtmlContent,"-",pageVersionID); 60 return localizedLink; 61 } else { 62 return HtmlContent; 63 } 64 }else { 65 return HtmlContent; 66 } 67 68 } 69 70 private string ModifyQueryStringValue(string p_query, string p_Name, string p_NewValue) 71 { 72 Uri uri = new Uri(p_query,UriKind.RelativeOrAbsolute); 73 //if(p_query.Contains("http")) 74 //{ 75 //uri = new Uri(p_query); 76 //} else { 77 //uri = new Uri(p_query, UriKind.Relative); 78 //} 79 //uri = new Uri(p_query); 80 81 82 83 var nameValues = HttpUtility.ParseQueryString(uri.Query); 84 nameValues.Set(p_Name, p_NewValue); 85 string url = uri.AbsolutePath + "?" + nameValues.ToString(); 86 return url; 87 } 88 } 89 @using System.Collections.Generic 90 @using System.Data 91 92 @functions{ 93 94 /* Get related pages */ 95 public static List<Dictionary<string, string>> GetRelatedPages(string productID) 96 { 97 List<Dictionary<string, string>> relatedPages = new List<Dictionary<string, string>>(); 98 99 if(!string.IsNullOrEmpty(productID)){ 100 using (var connection = Dynamicweb.Data.Database.CreateConnection()) 101 { 102 using (var command = connection.CreateCommand()) 103 { 104 string sqlRaw = "SELECT RPI.* FROM Page P JOIN ItemType_PageProperties PP ON PP.Id = P.PagePropertyItemId JOIN ItemListRelation LR ON LR.ItemListRelationItemListId = PP.Related_Pages JOIN ItemType_Related_Product_Item RPI ON RPI.Id = LR.ItemListRelationItemId WHERE P.PageId ='{0}'"; 105 command.CommandText = string.Format(sqlRaw, productID); 106 107 using (var reader = command.ExecuteReader()) 108 { 109 if (reader != null) 110 { 111 while (reader.Read()) 112 { 113 Dictionary<string, string> relatedPagesProperties = new Dictionary<string, string>(); 114 115 relatedPagesProperties.Add("Page", reader["Page"].ToString()); 116 relatedPagesProperties.Add("Page_Link", reader["Page_Link"].ToString()); 117 relatedPagesProperties.Add("Icon_Source", "");//reader["Icon_Source"].ToString()); 118 relatedPagesProperties.Add("PageTitle", reader["PageTitle"].ToString()); 119 relatedPages.Add(relatedPagesProperties); 120 } 121 } 122 } 123 } 124 } 125 } 126 return relatedPages; 127 } 128 129 /* Get related products */ 130 public static List<Dictionary<string, string>> GetRelatedProducts(string productID) 131 { 132 List<Dictionary<string, string>> relatedProducts = new List<Dictionary<string, string>>(); 133 134 if(!string.IsNullOrEmpty(productID)){ 135 using (var connection = Dynamicweb.Data.Database.CreateConnection()) 136 { 137 using (var command = connection.CreateCommand()) 138 { 139 string sqlRaw = "SELECT RPI.* FROM Page P JOIN ItemType_PageProperties PP ON PP.Id = P.PagePropertyItemId JOIN ItemListRelation LR ON LR.ItemListRelationItemListId = PP.Related_Products JOIN ItemType_Related_Products RPI ON RPI.Id = LR.ItemListRelationItemId WHERE P.PageId ='{0}'"; 140 command.CommandText = string.Format(sqlRaw, productID); 141 142 using (var reader = command.ExecuteReader()) 143 { 144 if (reader != null) 145 { 146 while (reader.Read()) 147 { 148 Dictionary<string, string> relatedProductsProperties = new Dictionary<string, string>(); 149 150 relatedProductsProperties.Add("Page", reader["Page"].ToString()); 151 relatedProductsProperties.Add("Page_Link", reader["Page_Link"].ToString()); 152 relatedProductsProperties.Add("Icon_Source", "");//reader["Icon_Source"].ToString()); 153 relatedProductsProperties.Add("PageTitle", reader["PageTitle"].ToString()); 154 relatedProducts.Add(relatedProductsProperties); 155 } 156 } 157 } 158 } 159 } 160 } 161 return relatedProducts; 162 } 163 164 } 165 @{ 166 //START CUSTOM CODE 167 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); 168 var cdnJsCssDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("CSS_JS", "CSS_JS_Domain"); 169 var cdnAjaxCalls = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Ajax_Calls", "Ajax_Calls_Domain"); 170 var cdnVersion = BioLegend.Web.Helpers.CdnFunctions.GetCdnVersion(); 171 //END CUSTOM CODE 172 173 var designFolder = GetString("Template:DesignBaseUrl"); 174 var str_projectName = "BioLegend"; 175 var lst_socialMedia = GetLoop("Item.Area.Social"); 176 var loop_websiteLanguages = GetLoop("Languages"); 177 var companyName = GetString("Item.Area.CompanyName"); 178 var footerSlogan = GetString("Item.Area.FooterSlogan"); 179 var contactsParagraph = GetInteger("Item.Area.ContactsParagraph"); 180 var contactInfo = GetString("Item.Area.ContactInformation"); 181 var liveSearchPage = GetInteger("Item.Area.LiveSearchPage"); 182 var contentSearchPage = GetInteger("Item.Area.ContentSearchPage"); 183 var cartDisabled = GetBoolean("Item.Area.DisableAddToCart"); 184 var requestScheme = GetGlobalValue("Global:Request.Scheme"); 185 var requestHost = GetGlobalValue("Global:Request.Host"); 186 var baseHref = String.Format("https://{0}/",requestHost); 187 188 @* -------------------- Facebook ------------------- *@ 189 var imgBaseHref = String.Format("https://{0}",requestHost); 190 191 var ogImage = string.IsNullOrWhiteSpace(GetString("Item.Page.Og_Image.Value")) ? "" : imgBaseHref + GetString("Item.Page.Og_Image.Value"); 192 var ogImageWidth = string.IsNullOrWhiteSpace(GetString("Item.Page.Og_Image.Value")) ? "" : GetString("Item.Page.Og_Image_Width.Value"); 193 var ogImageHeight = string.IsNullOrWhiteSpace(GetString("Item.Page.Og_Image.Value")) ? "" : GetString("Item.Page.Og_Image_Height.Value"); 194 var ogType = string.IsNullOrWhiteSpace(GetString("Item.Page.Og_Image.Value")) ? "article" : GetString("Item.Page.Og_Type.Value"); 195 196 var printPage = GetString("Item.Area.PrintPage"); 197 var coaPage = GetString("Item.Area.CertificateAnalysisPage"); 198 199 var bol_userLogged = string.IsNullOrWhiteSpace(GetString("DWextranet_AccessUserUserName")) ? false : true; 200 var userName = string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")) ? "" : GetString("DW_extranet_AccessUserName"); 201 var userCountryCode = !string.IsNullOrEmpty(Pageview.User?.Country) ? Pageview.User.Country.ToString() : ""; 202 203 var str_miniCartPage = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.AddToCart")); 204 var str_CartPage = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.ViewCart")); 205 var str_relatedProductsJson = cdnAjaxCalls + Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.RelatedProductsAjax")) + "&cdnAjax=True&cdnVersion=" + cdnVersion; // CUSTOM CODE 206 207 var str_productDetailPageID = GetString("Item.Area.ProductDetail"); 208 var str_searchResultsPageID = GetString("Item.Area.SearchResults"); 209 var str_groupAjax = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.GroupAjax")); 210 211 var localArea = LocalizeLinksHTML("dwcountry"); 212 var wwOrdering = LocalizeLinksHTML("/dwcountry/worldwide-ordering"); 213 214 var isHomepage = GetString("Title") == "BioLegend | Your Partner for Antibodies, Proteins, Kits, Proteogenomics, Custom Services, and Reagents in Life Science" ? true : false; 215 216 @* -------------------- PageView ------------------- *@ 217 var obj_pageViewCurrent = Dynamicweb.Frontend.PageView.Current(); 218 var str_pageID = obj_pageViewCurrent.Page.ID.ToString(); 219 var str_areaID = obj_pageViewCurrent.AreaID.ToString(); 220 var str_countryCode = GetGlobalValue("Global:Area.Culture.CountryCode"); 221 var str_customCSSDeclaration = GetString("Item.Page.Custom_CSS_Declaration"); 222 var str_customCSSFile = GetString("Item.Page.Custom_CSS"); 223 224 @*-----------------Sidebar Navigation-----------------*@ 225 //we need to take related pages from the master page 226 var masterWebsite = loop_websiteLanguages.FirstOrDefault(x => x.GetString("Culture") == "en-US"); 227 var masterPage = masterWebsite?.GetString("PageID") != "" ? masterWebsite?.GetString("PageID") : str_pageID; 228 var relatedPages = GetRelatedPages(masterPage); 229 var relatedPageProducts = GetRelatedProducts(masterPage); 230 var propertyItem = !string.IsNullOrEmpty(masterPage) ? Dynamicweb.Frontend.PageView.GetPageviewByPageID(Int32.Parse(masterPage)).Page.PropertyItem : null; 231 //var relatedPages = GetLoop("Item.Page.Related_Pages.Value"); 232 var sidebarNavigation = propertyItem != null && propertyItem["Sidebar_Navigation"] != null ? propertyItem["Sidebar_Navigation"].ToString() : "1";// GetString("Item.Page.Sidebar_Navigation"); 233 var centralContentClass = "col-xs-12 col-md-9 shadowRight"; 234 var sidebarNavigationClass = "col-xs-12 col-md-3"; 235 var containerStyle = ""; 236 237 if (sidebarNavigation != "1" || ((relatedPages == null || !relatedPages.Any()) && (relatedPageProducts == null || !relatedPageProducts.Any()))) 238 { 239 centralContentClass = "col-md-12"; 240 sidebarNavigationClass = "col-md-12 sidewaysList"; 241 //containerStyle = "background-color:#fff"; 242 } 243 @* --------------- Cookier Setter Page-------------- *@ 244 //If OriginalPage is set then it's likely a call to the template header/footer and it's deliberately set 245 var str_referrerPage = HttpContext.Current.Request.QueryString["OriginalPage"]; 246 var referrerUrl = ""; 247 //If OriginalPage isn't set then it's likely a normal request so create the currentPage from the actual current page 248 if (String.IsNullOrEmpty(str_referrerPage)){ 249 referrerUrl = HttpUtility.UrlEncode("Default.aspx?ID="+GetString("PageID")); 250 } 251 else if (str_referrerPage == "/"){ 252 referrerUrl = ""; 253 } 254 else 255 { 256 referrerUrl = HttpUtility.UrlEncode(str_referrerPage); 257 } 258 259 var totalProdQty = ""; 260 if (bol_userLogged) 261 { 262 if(Pageview.User?.CurrentSecondaryUser != null && Pageview.User.CurrentSecondaryUser?.ID != 0) { 263 var secondaryUser = User.GetUserByID(Int32.Parse(Pageview.User.CurrentSecondaryUser.ID.ToString())); 264 @* var atTranslate = Translate("at", "at"); *@ 265 userName = String.Format("{0}", secondaryUser.Name); 266 } 267 268 @* -------------------- Total products in the cart context ------------------- *@ 269 var orderContext = GetString("Item.Area.OrderContext"); 270 var orderlinesContext = GetLoop("OrderContextCarts").Where(c => c.GetString("Ecom:OrderContext.ID").Equals(orderContext)).ToList(); 271 totalProdQty = orderlinesContext.FirstOrDefault()?.GetString("Ecom:Order.OrderLines.TotalProductQuantity"); 272 } 273 @* -------------------- Cookies ------------------- *@ 274 Dictionary<string, string> languageTypes = new Dictionary<string, string>(); 275 languageTypes.Add("US", "0"); 276 languageTypes.Add("JP", "1"); 277 languageTypes.Add("DE", "2"); 278 languageTypes.Add("GB", "3"); 279 languageTypes.Add("IT", "4"); 280 languageTypes.Add("AT", "5"); 281 languageTypes.Add("CH", "6"); 282 languageTypes.Add("FR", "7"); 283 languageTypes.Add("BE", "8"); 284 languageTypes.Add("LU", "9"); 285 languageTypes.Add("NL", "10"); 286 languageTypes.Add("IE", "11"); 287 288 var languageCookie = new HttpCookie("language"); 289 290 if(languageTypes.ContainsKey(str_countryCode)) 291 { 292 languageCookie.Value = languageTypes[str_countryCode].ToString(); 293 } 294 else{ 295 languageCookie.Value = "0"; 296 } 297 298 languageCookie.Expires = DateTime.Now.AddDays(7); 299 languageCookie.Path = "/"; 300 languageCookie.Domain = ".biolegend.com"; 301 languageCookie.HttpOnly = true; 302 303 System.Web.HttpContext.Current.Response.Cookies.Add(languageCookie); 304 305 @* --- Optimizer --- *@ 306 var minify = GetBoolean("Item.Area.Minify_CSS_And_JavaScript"); 307 var styleBundle = Dna.Optimizer.Renderer.RenderStyles(string.Format("{0}css", designFolder), "-main-styles", null, new[] { "exceptions", "headerFooter" }, minify); 308 var scriptBundle = Dna.Optimizer.Renderer.RenderScripts(string.Format("{0}js", designFolder), "-main-scripts", null, new[] { "exceptions" }, minify); 309 var isPdf = Convert.ToBoolean(Dynamicweb.Context.Current.Request.Params["pdf"]); 310 var isDesktop = GetGlobalValue("Global:Device.IsDesktop"); 311 var isMobile = GetGlobalValue("Global:Device.IsMobile"); 312 var isTablet = GetGlobalValue("Global:Device.IsTablet"); 313 314 /*Google tag manager*/ 315 var googleTagManagerId = Pageview.Area.Item["TagManager"]?.ToString(); 316 /*Google analytics*/ 317 var googleAnalyticsId = Pageview.Area.Item["Analytics"]?.ToString(); 318 } 319 320 <!DOCTYPE HTML> 321 <html lang='@GetGlobalValue("Global:Area.LongLang")'> 322 <head> 323 <title>@GetValue("Title")</title> 324 @GetValue("CopyRightNotice") 325 326 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 327 @* <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no"> 328 <meta http-equiv="X-UA-Compatible" content="IE=edge"> *@ 329 330 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 331 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 332 <base href="@baseHref"> 333 334 <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"> 335 @if(GetBoolean("Item.Area.DemoSticker")){ 336 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> 337 } 338 else { 339 if(GetBoolean("Item.Area.NoIndex")){ 340 <meta name="ROBOTS" content="NOINDEX"> 341 } 342 if(GetBoolean("Item.Area.NoFollow")){ 343 <meta name="ROBOTS" content="NOFOLLOW"> 344 } 345 } 346 347 <meta property="og:url:secure_url" content='@GetGlobalValue("Global:Request.Url")'> 348 <meta property="og:type" content='@ogType'> 349 <meta property="og:title" content='@GetString("Title")'> 350 <meta property="og:description" content='@GetString("Meta.Description")'> 351 <meta property="og:image" content='@ogImage'> 352 <meta property="og:image:width" content='@ogImageWidth'> 353 <meta property="og:image:height" content='@ogImageHeight'> 354 355 @RenderSnippet("metaViewport") 356 @SnippetStart("metaViewport") @SnippetEnd("metaViewport") 357 358 @GetValue("MetaTags") 359 <link rel="shortcut icon" href="@cdnStaticDomain/Files/Templates/Designs/@str_projectName/images/favicon.ico" type="image/x-icon"> 360 <link rel="stylesheet" href="@cdnJsCssDomain@styleBundle"> 361 <link rel="stylesheet" type="text/css" href="@cdnJsCssDomain/Files/Templates/Designs/BioLegend/css/exceptions/print.css" media="print"> 362 363 @RenderSnippet("loadNonResponsive") 364 @SnippetStart("loadNonResponsive") @SnippetEnd("loadNonResponsive") 365 366 @RenderSnippet("forcePrint") 367 @SnippetStart("forcePrint") @SnippetEnd("forcePrint") 368 369 @* Google Tag Manager *@ 370 @if (!string.IsNullOrEmpty(googleTagManagerId)) 371 { 372 <script> 373 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 374 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 375 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 376 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 377 })(window,document,'script','dataLayer','@googleTagManagerId'); 378 </script> 379 } 380 @* End Google Tag Manager *@ 381 382 @* Global site tag (gtag.js) - Google Analytics *@ 383 @if (!string.IsNullOrEmpty(googleAnalyticsId)) 384 { 385 <script async="" src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsId"></script> 386 <script> 387 window.dataLayer = window.dataLayer || []; 388 function gtag(){dataLayer.push(arguments);} 389 gtag('js', new Date()); 390 391 gtag('config', '@googleAnalyticsId'); 392 </script> 393 } 394 @* Google Analytics *@ 395 396 @if(!string.IsNullOrEmpty(str_customCSSFile)){ 397 <link href="@cdnJsCssDomain@str_customCSSFile" rel="stylesheet"> 398 } 399 400 @if (!isPdf) 401 { 402 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="fcba3ee2-cd5f-4717-ac84-9a54c43d889f" type="text/javascript" async=""></script> 403 } 404 @RenderSnippet("ExternalResourcesHead") 405 @GetValue("Stylesheets") 406 @GetValue("Javascripts") 407 </head> 408 @str_customCSSFile 409 <body id="body" class="non-non-responsive @str_customCSSDeclaration" data-pageid="@str_pageID" data-coaid="@coaPage" data-culture="" data-browser="@isDesktop" data-ipcountrycode='@Pageview.GlobalTags.GetTagByName("DynamicwebNA:CountryCode").Value.ToString()' data-languageselected='@str_countryCode'> 410 <div id="header-search-bar" class="punchout_@DynamicwebNA.PunchOutFacade.IsPunchOutUser().ToString() logged_@bol_userLogged.ToString()" style="display:none;">&nbsp;</div> 411 412 <!-- Google Tag Manager (noscript) --> 413 @if (!string.IsNullOrEmpty(googleTagManagerId)) 414 { 415 <noscript> 416 <iframe src="https://www.googletagmanager.com/ns.html?id=@googleTagManagerId" height="0" width="0" style="display:none;visibility:hidden"></iframe> 417 </noscript> 418 } 419 <!-- End Google Tag Manager (noscript) --> 420 421 <div class="wrap"> 422 <header data-totalproducts='@totalProdQty' id="blHeader" class="container-fluid noPadding" id="blHeader" data-contrycode="@str_countryCode" data-ipcountrycode='@Pageview.GlobalTags.GetTagByName("DynamicwebNA:CountryCode").Value.ToString()' data-languagecookie='@(System.Web.HttpContext.Current.Request.Cookies["language"] == null ? "" : System.Web.HttpContext.Current.Response.Cookies["language"].Value)'> 423 @* 424 if(GetString("Global.PageId") != GetString("Item.Area.MarketingPage")){ 425 <div style="color:red;">For Marketing site analyses only: Header and footer is loading from page id = <b> @GetString("Global.PageId")</b> instead of page id <b> @GetString("Item.Area.MarketingPage") </b></div> 426 } 427 else { 428 <div style="color:green;">For Marketing site analyses only: Header and footer is loading from the correct page id <b> @GetString("Global.PageId") </b></div> 429 } 430 *@ 431 @ShouldRedirectToSwitchAccount(bol_userLogged, GetLoop("DWExtranetSecondaryUsers"), (Pageview.User?.CurrentSecondaryUser == null ? 0 : Pageview.User.CurrentSecondaryUser?.ID), GetString("Global.PageId"), GetString("Item.Area.MyProfile"), GetString("Item.Area.SwitchAccount"), GetString("Item.Area.MarketingPage")) 432 <div class='container-fluid noPadding headerWrapper @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "") @((str_pageID == coaPage && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])) ? "coaHidden" : "")'> 433 <div class="container noPadding"> 434 435 436 437 @* Menu Bar *@ 438 439 @if(!String.IsNullOrEmpty(GetString("DwNavigation(menuMain)"))){ 440 <div id="menuMainContainer" class="col-md-12 col-sm-offset-0 noPadding hidden-xs hidden-sm" data-culturearea="@localArea"> 441 <div class="container noPadding"> 442 <nav class="navbar navbar-default"> 443 <div class="navbar-header"> 444 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> 445 <i class="fa fa-bars"></i> 446 </button> 447 </div> 448 @* Desktop *@ 449 <div id="navbar" class="navbar-collapse collapse noPadding col-md-8 col-lg-7"> 450 @GetValue("DwNavigation(menuMain)") 451 </div> 452 453 @RenderLoginRegister(bol_userLogged,"desktop",userName,cartDisabled) 454 @RenderMiniCart(cartDisabled,"desktop") 455 456 457 458 459 460 461 462 </nav> 463 </div> 464 </div> 465 } 466 467 468 </div> 469 </div> 470 471 472 473 474 @if (!isPdf) 475 { 476 477 478 @* Tablet *@ 479 <div class='subheader @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "") @((str_pageID == coaPage && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])) ? "coaHidden" : "")' id="blSubheaderTablet"> 480 <div class="hidden-lg hidden-md hidden-xs col-sm-12 mobileTopBar" id="tabletMenuContainer"> 481 <div id="headerMenuContainerTablet" class="hidden-lg hidden-md hidden-xs col-sm-4"> 482 <button type="button" class="mobile-menu-trigger" id="tabletMenuButton"> 483 <img src="@cdnStaticDomain/Files/Images/BioLegend/header/bars-mobile.png"> 484 <span class="tabletMenuText">Menu</span></button> 485 486 </div> 487 488 @RenderLoginRegister(bol_userLogged,"desktop",userName,cartDisabled) 489 @RenderMiniCart(cartDisabled,"desktop") 490 491 492 </div> 493 494 </div> 495 496 497 498 499 500 501 502 503 @* Mobile *@ 504 <div class='subheader @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "") @((str_pageID == coaPage && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])) ? "coaHidden" : "")' id="blSubheaderMobile"> 505 506 <div class="hidden-lg hidden-md hidden-sm col-xs-12 mobileTopBar"> 507 <div class="hidden-lg hidden-md hidden-sm col-xs-4"> 508 <button type="button" class="mobile-menu-trigger" id="mobileMenuButton"><i class="fa fa-bars"></i></button> 509 510 </div> 511 512 @RenderLoginRegister(bol_userLogged,"mobile",userName,cartDisabled) 513 @RenderMiniCart(cartDisabled,"mobile") 514 515 516 </div> 517 <div class='hidden-lg hidden-md hidden-sm col-xs-12 mobileBottomBar @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "")'> 518 <div class="hidden-lg hidden-md hidden-sm col-xs-4"> 519 <a href="/@localArea"><img src="@cdnStaticDomain/Files/Images/BioLegend/header/biolegend_enablling_center%201.png"></a> 520 </div> 521 522 <div class="hidden-lg hidden-md hidden-sm col-xs-4"> 523 <img src="@cdnStaticDomain/Files/Images/BioLegend/header/Magnifying-Glass.png" id="mobileSearchIcon"> 524 </div> 525 @RenderCountryFlags(str_areaID,referrerUrl,isHomepage,wwOrdering,str_pageID,"mobile") 526 527 528 529 530 531 532 533 </div> 534 535 <div id="mobileMenuContainer">Loading...</div> 536 <div id="mobileSearchContainer" class="col-xs-12 col-sm-12 col-md-8 header-search-bar"> 537 <form action="/@localArea/search-results" autocomplete="off" id="mobileProductSearchForm" method="get"> 538 <fieldset class="col-xs-12 col-sm-12 noPadding"> 539 <input class="mobileSearchField pull-left col-xs-10" id="search-text-mobile" name="Keywords" placeholder="Search For..." type="text" value=""> 540 <button class="mobileSearchButton" type="submit"><img src="@cdnStaticDomain/Files/Images/BioLegend/header/Magnifying-Glass.png"> <span class="hidden">Search</span></button> 541 </fieldset> 542 </form> 543 </div> 544 545 </div> 546 } 547 548 549 550 551 552 553 554 555 </header> 556 557 @if((str_pageID == coaPage) && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])){ 558 <div class='container-fluid noPadding headerWrapper noAffix coaHeader'> 559 <div class="container noPadding"> 560 <div class="col-xs-12 col-sm-12 col-md-12 noPadding header-logo-wrapper"> 561 <figure class="header-logo col-xs-3 col-sm-3 col-md-3 text-center"> 562 <img class="hidden-xs target-sticky" src="@cdnStaticDomain/Files/Templates/Designs/BioLegend/images/BLlogo.png" width="200" alt="@companyName" title="@companyName"> 563 </figure> 564 </div> 565 </div> 566 </div> 567 } 568 569 570 571 @if (!isPdf) 572 { 573 @* Desktop *@ 574 <div class='container-fluid subheader @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "") @((str_pageID == coaPage && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])) ? "coaHidden" : "")' id="blSubheader"> 575 <div class="container"> 576 577 578 <div class="hidden-xs col-sm-12 col-md-12 header-logo-wrapper" id="headerContainer"> 579 <figure class="header-logo col-xs-2 col-sm-3 col-md-3 col-lg-2 text-center"> 580 <a href="/@localArea"> 581 <img class="hidden-xs target-sticky bllogo" src="@cdnStaticDomain/Files/Templates/Designs/BioLegend/images/BLlogo.png" alt="@companyName" title="@companyName"> 582 <img class="img-responsive hidden-xs hidden-sm hidden-md hidden-lg bllogo" src="@cdnStaticDomain/Files/Templates/Designs/BioLegend/images/BLlogo.png" alt="@companyName" title="@companyName"> 583 </a> 584 </figure> 585 586 @RenderHeaderSearchBar(liveSearchPage) 587 588 589 590 591 592 593 594 595 @RenderCountryFlags(str_areaID,referrerUrl,isHomepage,wwOrdering,str_pageID,"desktop") 596 @RenderHeaderSearchBarOptions(liveSearchPage,contentSearchPage) 597 598 </div> 599 600 601 602 603 604 </div> 605 </div> 606 607 608 609 } 610 611 612 613 614 <section id="contentWrapper" class='container-fluid noPadding' style="@containerStyle"> 615 <div class="container"> 616 <div class="row"> 617 @RenderSnippet("topBanner") 618 619 @if (sidebarNavigation != "2" && (relatedPages.Any() || relatedPageProducts.Any())) 620 { 621 if(relatedPages.Any() || relatedPageProducts.Any()){ 622 <div class="@sidebarNavigationClass sidebarNavigation"> 623 @if(relatedPageProducts.Any()){ 624 <span class="relatedProductsHeader">@Translate("relatedProducts","Related Products")</span> 625 <ul> 626 @foreach(var row in relatedPageProducts){ 627 string link = !String.IsNullOrWhiteSpace(row["Page"]) ? "/Default.aspx?ID="+ row["Page"] : row["Page_Link"]; 628 string target = link.Contains("http:") ? "target='_blank'" : ""; 629 string iconSrc = !String.IsNullOrWhiteSpace(row["Icon_Source"]) ? row["Icon_Source"].Replace(".png", "_PD.png").Replace(".jpg", "_PD.jpg") : ""; 630 string itemName = row["PageTitle"]; 631 link = LocalizeLinks(link); 632 633 //int pageID = page.GetInteger("Item.Page.Related_Pages.Value.Page"); 634 //string pageTitle = page.GetString("Item.Page.Related_Pages.Value.PageTitle"); 635 //var pageIcon = "/Files/Images/media_assets/Lit_icon.png"; 636 //string pageLink = page.GetString("Item.Page.Related_Pages.Value.Page_Link"); 637 638 <li> 639 <a href="@link" @target="" class="relatedProductsItem"> 640 @if(!String.IsNullOrWhiteSpace(iconSrc)) 641 { 642 <figure> 643 <img width="20" height="20" src="@cdnStaticDomain@iconSrc" title="@itemName" alt="@itemName"> 644 </figure> 645 } 646 @itemName 647 </a> 648 </li> 649 } 650 </ul> 651 <br><br> 652 } 653 @if(relatedPages.Any()){ 654 <span class="relatedProductsHeader">@Translate("relatedPages","Related Pages")</span> 655 <ul> 656 @foreach(var row in relatedPages){ 657 string link = !String.IsNullOrWhiteSpace(row["Page"]) ? "/Default.aspx?ID="+ row["Page"] : row["Page_Link"]; 658 string target = link.Contains("http:") ? "target='_blank'" : ""; 659 string iconSrc = !String.IsNullOrWhiteSpace(row["Icon_Source"]) ? row["Icon_Source"].Replace(".png", "_PD.png").Replace(".jpg", "_PD.jpg") : ""; 660 string itemName = row["PageTitle"]; 661 link = LocalizeLinks(link); 662 663 //int pageID = page.GetInteger("Item.Page.Related_Pages.Value.Page"); 664 //string pageTitle = page.GetString("Item.Page.Related_Pages.Value.PageTitle"); 665 //var pageIcon = "/Files/Images/media_assets/Lit_icon.png"; 666 //string pageLink = page.GetString("Item.Page.Related_Pages.Value.Page_Link"); 667 668 <li> 669 <a href="@link" @target="" class="relatedProductsItem"> 670 @if(!String.IsNullOrWhiteSpace(iconSrc)) 671 { 672 <figure> 673 <img width="20" height="20" src="@cdnStaticDomain@iconSrc" title="@itemName" alt="@itemName"> 674 </figure> 675 } 676 @itemName 677 </a> 678 </li> 679 } 680 </ul> 681 } 682 </div> 683 } 684 } 685 686 @if(isPdf){ 687 <div class="col-xs-12 col-sm-12 col-md-12 noPadding header-logo-wrapper"> 688 <figure class="header-logo col-xs-3 col-sm-3 col-md-3 text-center"> 689 <img class="img-responsive visible-xs " src="@cdnStaticDomain/Files/Templates/Designs/BioLegend/images/BLlogo.png" width="200"> 690 </figure> 691 </div> 692 } 693 694 <div class="@centralContentClass"> 695 <div class="row"> 696 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 697 @using System; 698 @using System.Linq; 699 @using Dynamicweb.Rendering; 700 701 702 703 @{ 704 var renderNavigation = RenderNavigation(new{template = "breadCrumbs.xslt",expandmode = "pathonly",id = "breadCrumbs"}); 705 var titlePageOrProductName = System.Web.HttpUtility.HtmlDecode(GetString("Title").Replace("<!","<").Replace("&lt;!","&lt;")); 706 var searchPageID = GetString("Item.Area.SearchResults"); 707 } 708 709 @*removed responsive design on product pages 071817 sdt *@ 710 @SnippetStart("loadNonResponsive") 711 <link rel="stylesheet" type="text/css" href="@cdnJsCssDomain/Files/Templates/Designs/BioLegend/css/exceptions/non-responsive.css" /> 712 <meta name="viewport" content="width=970, initial-scale=1"> 713 @SnippetEnd("loadNonResponsive") 714 715 @if(!string.IsNullOrEmpty(renderNavigation) || System.Web.HttpContext.Current.Request.Params["productid"] == null) 716 { 717 <div class="breadCrumbs col-xs-12 hidden-xs"> 718 @renderNavigation 719 </div> 720 } 721 722 @RenderSnippet("forcePrintVersion") 723 @SnippetStart("forcePrintVersion") @SnippetEnd("forcePrintVersion") 724 725 <div class="container-fluid noPadding pageTitle"> 726 <div class="container"> 727 <h1 class='@(searchPageID.Equals(Pageview.Page.ID.ToString()) && System.Web.HttpContext.Current.Request.Params["productid"] == null ? "col-xs-12 col-md-5" : "col-xs-12") noPadding @(titlePageOrProductName == "BioLegend - 404" ? "hidden noPage" : "")'> 728 @if(System.Web.HttpContext.Current.Request.Params["productid"] == null) { 729 @titlePageOrProductName 730 } 731 else{ 732 @RenderSnippet("productName") 733 } 734 </h1> 735 </div> 736 </div> 737 738 @if(Pageview.Page.Parent != null) 739 { 740 if(Pageview.Page.Parent.NavigationTag == "myaccount") 741 { 742 if(!String.IsNullOrEmpty(GetString("DwNavigation(subMenu)"))){ 743 <nav class="navbar navbar-default hidden-print" id="subMenuNav"> 744 <div class="navbar-header"> 745 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar4" aria-expanded="false" aria-controls="navbar4"> 746 <i class="fa fa-bars"></i> 747 </button> 748 </div> 749 <div id="navbar4" class="navbar-collapse collapse"> 750 @GetValue("DwNavigation(subMenu)") 751 </div> 752 </nav> 753 } 754 } 755 } 756 @*limit:StandardParagraph.cshtml,moduleClean.cshtml,EmailMarketingParagraph.cshtml;*@ 757 @if(!String.IsNullOrEmpty(GetString("DwContent(centralContent)"))){ 758 <section class="col-xs-12"> 759 <div id="centralContent">@GetValue("DwContent(centralContent)")</div> 760 </section> 761 } 762 </div> 763 </div> 764 @if (sidebarNavigation != "1" && (relatedPages.Any() || relatedPageProducts.Any())) 765 { 766 if(relatedPages.Any() || relatedPageProducts.Any()){ 767 <div class="@sidebarNavigationClass sidebarNavigation"> 768 @if(relatedPageProducts.Any()){ 769 <span class="relatedProductsHeader">@Translate("relatedProducts","Related Products")</span> 770 <ul> 771 @foreach(var row in relatedPageProducts){ 772 string link = !String.IsNullOrWhiteSpace(row["Page"]) ? "/Default.aspx?ID="+ row["Page"] : row["Page_Link"]; 773 string target = link.Contains("http:") ? "target='_blank'" : ""; 774 string iconSrc = !String.IsNullOrWhiteSpace(row["Icon_Source"]) ? row["Icon_Source"].Replace(".png", "_PD.png").Replace(".jpg", "_PD.jpg") : ""; 775 string itemName = row["PageTitle"]; 776 link = LocalizeLinks(link); 777 778 //int pageID = page.GetInteger("Item.Page.Related_Pages.Value.Page"); 779 //string pageTitle = page.GetString("Item.Page.Related_Pages.Value.PageTitle"); 780 //var pageIcon = "/Files/Images/media_assets/Lit_icon.png"; 781 //string pageLink = page.GetString("Item.Page.Related_Pages.Value.Page_Link"); 782 783 <li> 784 <a href="@link" @target="" class="relatedProductsItem"> 785 @if(!String.IsNullOrWhiteSpace(iconSrc)) 786 { 787 <figure> 788 <img width="20" height="20" src="@cdnStaticDomain@iconSrc" title="@itemName" alt="@itemName"> 789 </figure> 790 } 791 @itemName 792 </a> 793 </li> 794 } 795 </ul> 796 <br><br> 797 } 798 @if(relatedPages.Any()){ 799 <span class="relatedProductsHeader">@Translate("relatedPages","Related Pages")</span> 800 <ul> 801 @foreach(var row in relatedPages){ 802 string link = !String.IsNullOrWhiteSpace(row["Page"]) ? "/Default.aspx?ID="+ row["Page"] : row["Page_Link"]; 803 string target = link.Contains("http:") ? "target='_blank'" : ""; 804 string iconSrc = !String.IsNullOrWhiteSpace(row["Icon_Source"]) ? row["Icon_Source"].Replace(".png", "_PD.png").Replace(".jpg", "_PD.jpg") : ""; 805 string itemName = row["PageTitle"]; 806 link = LocalizeLinks(link); 807 808 //int pageID = page.GetInteger("Item.Page.Related_Pages.Value.Page"); 809 //string pageTitle = page.GetString("Item.Page.Related_Pages.Value.PageTitle"); 810 //var pageIcon = "/Files/Images/media_assets/Lit_icon.png"; 811 //string pageLink = page.GetString("Item.Page.Related_Pages.Value.Page_Link"); 812 813 <li> 814 <a href="@link" @target="" class="relatedProductsItem"> 815 @if(!String.IsNullOrWhiteSpace(iconSrc)) 816 { 817 <figure> 818 <img width="20" height="20" src="@cdnStaticDomain@iconSrc" title="@itemName" alt="@itemName"> 819 </figure> 820 } 821 @itemName 822 </a> 823 </li> 824 } 825 </ul> 826 } 827 </div> 828 } 829 } 830 </div> 831 832 <!--Recently Viewed--> 833 <div class="row" id="recentlyViewed"> 834 ProductsHere 835 </div> 836 837 838 839 840 841 </div> 842 843 844 </section> 845 </div> 846 847 @if (!isPdf) 848 { 849 850 <div class='container-fluid subfooter @(str_pageID == printPage || str_pageID == coaPage ? "noAffix" : "") @((str_pageID == coaPage && !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["action"])) ? "coaHidden" : "")'> 851 <div class="container"> 852 <div id="footerLine" class="col-xs-12"><hr></div> 853 </div> 854 855 <div class='container' id="subfooterContainer"> 856 857 @GetValue("DwNavigation(footerMenu)") 858 859 860 @if(@Pageview.GlobalTags.GetTagByName("DynamicwebNA:CountryCode").Value.ToString() != "CN") 861 { 862 <div class="hidden-xs col-xs-3 pull-right" id="socialMedia"> 863 <div id="sunburst"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Sunburst.png"></div> 864 <h2> 865 @Translate("FollowUs","Follow Us") 866 </h2> 867 <div class="col-xs-4"><a href="https://www.linkedin.com/company/biolegend" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Linkedin.png"></a></div> 868 <div class="col-xs-4"><a href="https://www.facebook.com/BioLegend/" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Facebook.png"></a></div> 869 <div class="col-xs-4"><a href="https://twitter.com/BioLegend" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Twitter.png"></a></div> 870 871 </div> 872 873 874 875 876 877 } 878 </div> 879 880 881 <div class="hidden-sm hidden-md hidden-lg hidden-xl col-xs-12" id="socialMediaMobile"> 882 <h2> 883 @Translate("FollowUs","Follow Us") 884 </h2> 885 886 <div class="col-xs-12 footerIconContainer"> 887 <a href="https://www.linkedin.com/company/biolegend" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Linkedin.png"></a> 888 <a href="https://www.facebook.com/BioLegend/" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Facebook.png"></a> 889 <a href="https://twitter.com/BioLegend" target="_blank"><img src="@cdnStaticDomain/Files/Images/BioLegend/Footer/Twitter.png"></a> 890 891 </div> 892 </div> 893 894 </div> 895 896 897 898 <footer id="footer" class="container-fluid footer"> 899 900 <div class="container"> 901 <div class="col-xs-12 col-sm-6 noPadding sloganCompany"> 902 <a href="/@localArea" class="footer-logo"> 903 <img class="bllogo" src="@cdnStaticDomain/Files/Templates/Designs/BioLegend/images/footerLogo.png" title="@companyName" alt="@companyName"> 904 </a> 905 906 </div> 907 908 <div class="col-xs-12 col-sm-6 contactsFooter noPadding"> 909 <span class="col-xs-12 noPadding"> 910 &copy; @DateTime.Now.Year @companyName 911 912 @GetString("Item.Area.Copyright") 913 </span> 914 915 </div> 916 917 918 919 </div> 920 </footer> 921 } 922 923 @if(GetBoolean("Item.Area.DemoMode")){ 924 <div class="demoMode">Demo</div> 925 } 926 @RenderLoginRegisterOverlay(bol_userLogged) 927 </body> 928 929 <script data-id="scriptBundle" src="@cdnJsCssDomain@scriptBundle"></script> 930 @checkCookiePreferences() 931 932 <script type="text/javascript"> 933 @if(string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["pdf"])) 934 { 935 <text>if( window.location.protocol != "https:") 936 window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);</text> 937 } 938 939 @RenderSnippet("jsVariables") 940 @SnippetStart("jsVariables") @SnippetEnd("jsVariables") 941 </script> 942 <script data-id="dwScripts" type="text/javascript"> 943 var obj_formErrorMessages = { 944 str_errorMessagesTitle: "@(HttpUtility.JavaScriptStringEncode(Translate("errorMessagesTitle", "Error")))", 945 str_closeWarning: "@(HttpUtility.JavaScriptStringEncode(Translate("errorMessagesCloseWarning", "close")))", 946 str_emptyField: "@(HttpUtility.JavaScriptStringEncode(Translate("emptyField", "Empty fields")))", 947 str_mustBeEqual: "@(HttpUtility.JavaScriptStringEncode(Translate("equalFields", "Fields must be equal")))", 948 str_cannotBeEqual: "@(HttpUtility.JavaScriptStringEncode(Translate("diferentFields", "Cannot be equal to")))", 949 str_viewFullDetail: "@(HttpUtility.JavaScriptStringEncode(Translate("viewFullDetail", "View full detail")))", 950 str_selectDefault: "@(HttpUtility.JavaScriptStringEncode(Translate("selectDefault", "Select default")))", 951 str_invalidEmail: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidEmail", "Invalid e-mail")))", 952 str_invalidPhoneNumber: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidPhoneNumber", "Invalid phone number")))", 953 str_invalidDate: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidDate", "Invalid date")))", 954 str_checkoutIsUnderMaintenance: "@(HttpUtility.JavaScriptStringEncode(Translate("checkoutIsCurrentlyUnderMaintenance", "Checkout is currently under maintenance and you will only see list prices. You may continue adding products to your shopping cart and complete the checkout process later. Sorry for any inconvenience this may cause.")))" 955 }, 956 obj_loginMessages = { 957 str_login:"@(HttpUtility.JavaScriptStringEncode(Translate("login", "Login")))", 958 str_emailNotExists:"@(HttpUtility.JavaScriptStringEncode(Translate("emailNotExists", "Email not exists")))", 959 str_password:"@(HttpUtility.JavaScriptStringEncode(Translate("password", "Password")))", 960 str_forgotPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("forgotPassword", "Forgot password?")))", 961 str_email:"@(HttpUtility.JavaScriptStringEncode(Translate("email", "Email")))", 962 str_username:"@(HttpUtility.JavaScriptStringEncode(Translate("username", "Username")))", 963 str_recoverPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("recoverPassword", "Recover password")))", 964 str_errorPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("emptyPassword", "Empty password")))", 965 str_errorEmailEmpty:"@(HttpUtility.JavaScriptStringEncode(Translate("emptyEmail", "Empty email")))", 966 str_errorUserEmpty:"@(HttpUtility.JavaScriptStringEncode(Translate("userEmpty", "Empty user")))", 967 str_errorEmail:"@(HttpUtility.JavaScriptStringEncode(Translate("invalidEmail", "Invalid email")))", 968 str_fillTheFields:"@(HttpUtility.JavaScriptStringEncode(Translate("fillTheFields", "Fill the fields")))", 969 str_wrongData:"@(HttpUtility.JavaScriptStringEncode(Translate("wrongData", "Wrong data")))" 970 }, 971 obj_addToCartMessages = { 972 str_productNotFound :"@(HttpUtility.JavaScriptStringEncode(Translate("productNotFound", "Product not found")))", 973 str_orderContext: '@(GetString("Item.Area.OrderContext"))', 974 str_pleaseLogin : '@Translate("pleaseLogIn","To make purchases, please login if you are an existing customer. If you do not have an account, request an account after selecting Login.")', 975 str_guestLimitedFeatures : '@Translate("guestLimitedFeatures","shopping cart items can only be printed, downloaded or emailed.")', 976 str_guestMayContinue : '@Translate("guestMayContinue","You may continue as a Guest with limited features")', 977 str_continueAsGuest : '@Translate("continueAsGuest", "Continue as a Guest")' 978 }, 979 obj_popupMessages = { 980 str_tryAgainButton :"@Translate("Try Again")", 981 str_cancelButton :"@Translate("Cancel")" 982 }, 983 obj_pages = { 984 str_minicart:'@str_miniCartPage', 985 str_cart:'@str_CartPage', 986 str_relatedProducts: '@str_relatedProductsJson', 987 str_productsPageID: '@str_productDetailPageID', 988 str_searchPageID: '@str_searchResultsPageID', 989 str_searchGroups: '@str_groupAjax' 990 }, 991 obj_areaItems = { 992 bol_isTheCheckoutDisabled : "@(GetBoolean("Item.Area.DisableCheckout.Value") || !TemplatesHelper.IsWebServiceConnectionAvailable())" 993 }, 994 obj_user = { 995 bol_isLogged : '@bol_userLogged', 996 str_country : '@userCountryCode', 997 str_state: '@Pageview.User?.State' 998 }; 999 </script> 1000 <script type="text/javascript"> 1001 $(function () { 1002 @userNotExist() 1003 @RenderSnippet("jsOnLoadVariables") 1004 @SnippetStart("jsOnLoadVariables") @SnippetEnd("jsOnLoadVariables") 1005 @RenderSnippet("jsOnLoad") 1006 @SnippetStart("jsOnLoad") @SnippetEnd("jsOnLoad") 1007 }); 1008 </script> 1009 @RenderSnippet("SpectraAnalyzer") 1010 @RenderSnippet("SpectranalyzerModal") 1011 @RenderSnippet("ExternalResourcesFooter") 1012 </html> 1013 <!-- @GetGlobalValue("Global:Request.PathAndQuery") --> 1014 <!-- @GetGlobalValue("Global:Request.Url") --> 1015 @if (bol_userLogged) 1016 { 1017 @loadOldCart() 1018 } 1019 1020 @helper userNotExist() { 1021 if(Dynamicweb.Environment.ExecutingContext.IsFrontEnd() && !Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn()) 1022 { 1023 if(System.Web.HttpContext.Current.Request.Params["Password"] != null && System.Web.HttpContext.Current.Request.Params["Username"] != null) 1024 { 1025 @SnippetStart("jsOnLoad") 1026 @:alert('@Translate("incorrectUsernamePassword","Incorrect user name or password. Please verify your credentials and try again")'); 1027 @SnippetEnd("jsOnLoad") 1028 } 1029 1030 if(System.Web.HttpContext.Current.Request.Params["ForgotPassword"] != null && System.Web.HttpContext.Current.Request.Params["Username"] != null && Convert.ToBoolean(System.Web.HttpContext.Current.Request.Params["ForgotPassword"]) ) 1031 { 1032 @SnippetStart("jsOnLoad") 1033 @:alert('@Translate("Your password has been sent to you by e-mail")'); 1034 @SnippetEnd("jsOnLoad") 1035 } 1036 } 1037 } 1038 1039 @helper RenderHeaderSearchBar(int liveSearchPage) 1040 { 1041 var productDetail = GetString("Item.Area.ProductDetail"); 1042 var searchResultsID = GetInteger("Item.Area.SearchResults"); 1043 var queryStringPage = System.Web.HttpContext.Current.Request.Params["page"] ?? ""; 1044 var queryString = System.Web.HttpContext.Current.Request.Params["queryString"] ?? ""; 1045 var keywordsParam = System.Web.HttpContext.Current.Request.Params["Keywords"] ?? ""; 1046 var valueSearched = !string.IsNullOrWhiteSpace(keywordsParam) ? keywordsParam : queryString; 1047 var autocompletePageID = GetPageIdByNavigationTag("autocompleteFeed"); 1048 1049 //START CUSTOM CODE 1050 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); 1051 var cdnAjaxCalls = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Ajax_Calls", "Ajax_Calls_Domain"); 1052 var cdnVersion = BioLegend.Web.Helpers.CdnFunctions.GetCdnVersion(); 1053 //CUSTOM CODE 1054 1055 <div class="col-xs-12 col-sm-6 col-md-7 col-lg-8 header-search-bar" id="searchFormContainer"> 1056 <div class="form-fields searchMenuItem"> 1057 <form method="get" action="/Default.aspx" id="productSearchForm" autocomplete="off"> 1058 <input type="hidden" id="search-text-target" value="@valueSearched" name="Keywords"> 1059 <input type="hidden" value="@searchResultsID" name="ID" data-productsearch="@searchResultsID"> 1060 <fieldset class="col-xs-12 col-sm-12 noPadding" id="headerSearchBox"> 1061 <input type="text" id="search-text" data-autocomplete-page-id="@autocompletePageID" data-autocomplete-punchout-flag="no" value="@valueSearched" placeholder='@Translate("SearchFor", "Search for")...' class="pull-left col-xs-10" data-cdn-ajax="@cdnAjaxCalls" data-cdn-version="@cdnVersion"> @*CUSTOM CODE*@ 1062 <button type="submit" id="search-text-button" class="col-xs-1"> 1063 <img src="@cdnStaticDomain/Files/Images/BioLegend/header/Magnifying-Glass.png"> 1064 <span class="hidden">@Translate("search", "Search")</span> 1065 </button> 1066 </fieldset> 1067 1068 </form> 1069 </div> 1070 </div> 1071 1072 } 1073 1074 @helper RenderHeaderSearchBarOptions(int liveSearchPage, int contentSearchPage) 1075 { 1076 @*search options div*@ 1077 <div id="search-options"> 1078 1079 </div> 1080 } 1081 1082 @helper RenderLoginRegister(bool userLoggedIn, string loginRegisterView, string userName = "", bool cartDisabled = false) 1083 { 1084 var linkText = userLoggedIn ? Translate("welcomeMessage", "Welcome") : Translate("loginRegister", "Login / Register"); 1085 var classCartDisabled = (!cartDisabled ? "col-xs-2 col-sm-4 col-md-3 col-lg-4" : "col-xs-2 col-sm-4 col-md-3 col-lg-4"); 1086 var str_countryCode_a = GetGlobalValue("Global:Area.Culture.CountryCode"); 1087 1088 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); //CUSTOM CODE 1089 1090 if(loginRegisterView == "desktop"){ 1091 <div class="@classCartDisabled noPadding text-right miniInfoArea" id="headerLoginContainer"> 1092 @if(str_countryCode_a.Equals("JP")){ 1093 <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> 1094 } 1095 else{ 1096 <a id="headerExtranet" href="javascript:showLoginMobile();"> 1097 1098 <span class="hidden-xs" style="color:#fff;"><img src="@cdnStaticDomain/Files/Images/BioLegend/header/UserW.png"> @linkText@(userLoggedIn ? ", "+@userName : " ")</span> 1099 </a> 1100 1101 @*Set the site culture to the user culture*@ 1102 var cultureCode = GetUserCulture(GetLoop("Languages")); 1103 if (!string.IsNullOrEmpty(cultureCode) && GetCurrentCulture() != cultureCode) 1104 { 1105 var url = "/" + cultureCode; 1106 <script> 1107 if (typeof(Storage) !== "undefined") { 1108 var isoCode = "@cultureCode".split("-"); 1109 localStorage["currentCountry"] = isoCode[1]; 1110 } 1111 window.location = "@url"; 1112 </script> 1113 } 1114 } 1115 </div> 1116 } 1117 else{ 1118 1119 1120 <div class="hidden-lg hidden-md hidden-sm col-xs-4"> 1121 @if(str_countryCode_a.Equals("JP")){ 1122 <span>&nbsp;</span> 1123 } 1124 else{ 1125 <a id="headerExtranet" href="javascript:showLoginMobile();"><img src="@cdnStaticDomain/Files/Images/BioLegend/header/UserW.png"></a> 1126 } 1127 </div> 1128 1129 1130 } 1131 } 1132 1133 @helper RenderLoginRegisterOverlay(bool userLoggedIn) 1134 { 1135 <div id="accountContainerOverlay" class="blackOverlay"> 1136 <div class="container"> 1137 @if(userLoggedIn) 1138 { 1139 @RenderAccountMenu() 1140 } 1141 else 1142 { 1143 @RenderLoginForm() 1144 } 1145 </div> 1146 </div> 1147 } 1148 1149 @helper RenderCountryFlags( string str_areaID, string referrerUrl, bool isHomepage, string wwOrdering, string str_pageID, string CountryFlagDisplay ){ 1150 1151 var loop_websiteLanguages = GetLoop("Languages"); 1152 1153 //START CUSTOM CODE 1154 var itemArea = Pageview.Area.Item; 1155 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); 1156 //END CUSTOM CODE 1157 1158 if(CountryFlagDisplay == "desktop"){ 1159 var areaCurrent = Dynamicweb.Services.Areas.GetArea(Convert.ToInt32(str_areaID)); 1160 var cultureCurrent = CultureInfo.GetCultureInfo(areaCurrent.Culture); 1161 var currencyCurrent = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 1162 var currencyCodeCurrent = ""; 1163 foreach (var x in currencyCurrent.Where(x => x.Code == areaCurrent.EcomCurrencyId)) 1164 { 1165 currencyCodeCurrent = x.Symbol.ToString().Trim(); 1166 } 1167 var regionCurrent = new RegionInfo(cultureCurrent.Name); 1168 var str_languageCurrent = areaCurrent.Culture.Split('-'); 1169 var currentLanguageFlagSrc = cdnStaticDomain + "/Files/Templates/Designs/BioLegend/images/icons/" + str_languageCurrent[0] + str_languageCurrent[1] + "_flag_resized.gif"; 1170 <div class="col-xs-2 col-sm-3 col-md-2" id="countrySelectorContainer"> 1171 <span id="regionSelectText">@regionCurrent.DisplayName.ToString()</span> <img src="@cdnStaticDomain/Files/Images/BioLegend/header/GlobeP.png" alt='@areaCurrent.Culture' title='@areaCurrent.Culture' class="flagLink"> 1172 1173 <ul class="dropdown-menu col-xs-12" role="menu" id="regionMenu"> 1174 @foreach (var i in loop_websiteLanguages) 1175 { 1176 var str_areaLangID = i.GetString("ID"); 1177 var str_language = i.GetString("Culture").Split('-'); 1178 var thisCulture = i.GetString("Culture").ToLower(); 1179 var thisID = i.GetString("PageID"); 1180 var languageFlagSrc = cdnStaticDomain + "/Files/Templates/Designs/BioLegend/images/icons/" + str_language[0] + str_language[1] + "_flag_resized.gif"; 1181 1182 var area = Dynamicweb.Services.Areas.GetArea(Convert.ToInt32(str_areaLangID)); 1183 var culture = CultureInfo.GetCultureInfo(area.Culture); 1184 var currency = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 1185 var currencyCode = ""; 1186 var activeClass = ""; 1187 1188 /* Maintain the query string for languages */ 1189 var test = GetGlobalValue("Global:Request.Query").Replace("ID="+str_pageID,"ID="+i.GetString("PageID")); 1190 1191 if(str_areaLangID == str_areaID){ 1192 activeClass = "activeItem"; 1193 } 1194 1195 foreach (var x in currency.Where(x => x.Code == area.EcomCurrencyId)) 1196 { 1197 currencyCode = x.Symbol.ToString().Trim(); 1198 } 1199 1200 var region = new RegionInfo(culture.Name); 1201 1202 if(!isHomepage){ 1203 var urlParams = ""; 1204 if (HttpContext.Current.Request.QueryString.HasKeys()) { 1205 1206 foreach (var thisKey in HttpContext.Current.Request.QueryString.AllKeys){ 1207 if(thisKey == null){} 1208 else if (thisKey.Equals("ID") || thisKey.Equals("k1") || thisKey.Equals("k2") || thisKey.Equals("k3") || thisKey.Equals("k4") || thisKey.Equals("k5") || thisKey.Equals("k6") || thisKey.Equals("k7") || thisKey.Equals("k8") || thisKey.Equals("k9") || thisKey.Equals("k10") || thisKey.Equals("k11") || thisKey.Equals("k12") || thisKey.Equals("p1") || thisKey.Equals("p2") || thisKey.Equals("p3") || thisKey.Equals("p4") || thisKey.Equals("p5") || thisKey.Equals("p6") || thisKey.Equals("p7") || thisKey.Equals("p8") || thisKey.Equals("p9") || thisKey.Equals("p10") || thisKey.Equals("p11") || thisKey.Equals("p12") || thisKey.Equals("adv1") || thisKey.Equals("adv2") || thisKey.Equals("adv3") || thisKey.Equals("adv4") || thisKey.Equals("adv5") || thisKey.Equals("adv6") || thisKey.Equals("adv7") || thisKey.Equals("adv8")){} 1209 else{ 1210 var thisReturn = HttpContext.Current.Request.QueryString[thisKey]; 1211 urlParams += (!string.IsNullOrEmpty(urlParams) ? "&" : "") + thisKey + "=" + HttpUtility.UrlPathEncode(thisReturn); 1212 } 1213 } 1214 1215 } 1216 else{urlParams = "";} 1217 referrerUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + thisID + (!string.IsNullOrEmpty(urlParams) ? "&" : "") + urlParams); 1218 } 1219 else { 1220 referrerUrl = "/" + thisCulture; 1221 } 1222 1223 <li class="@activeClass col-xs-12 noPadding"> 1224 1225 <a href="#" onclick="changeCountryFlag('@referrerUrl','@region.Name.ToString()');return false;" title='@region.DisplayName.ToString()' class="col-xs-12"> 1226 <img src="@languageFlagSrc" alt='@region.DisplayName.ToString()' title='@region.DisplayName.ToString()'> 1227 <b>@region.DisplayName.ToString()</b>&nbsp;(@currencyCode) @area.EcomCurrencyId 1228 </a> 1229 </li> 1230 } 1231 <li class="col-xs-12 noPadding navwwo"><a href="@wwOrdering">If your country is not listed,<br>click here for <strong>Worldwide Ordering</strong></a></li> 1232 </ul> 1233 </div> 1234 1235 1236 } 1237 else{ 1238 var areaCurrent = Dynamicweb.Services.Areas.GetArea(Convert.ToInt32(str_areaID)); 1239 var cultureCurrent = CultureInfo.GetCultureInfo(areaCurrent.Culture); 1240 var currencyCurrent = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 1241 var currencyCodeCurrent = ""; 1242 foreach (var x in currencyCurrent.Where(x => x.Code == areaCurrent.EcomCurrencyId)) 1243 { 1244 currencyCodeCurrent = x.Symbol.ToString().Trim(); 1245 } 1246 var regionCurrent = new RegionInfo(cultureCurrent.Name); 1247 var str_languageCurrent = areaCurrent.Culture.Split('-'); 1248 var currentLanguageFlagSrc = cdnStaticDomain + "/Files/Templates/Designs/BioLegend/images/icons/" + str_languageCurrent[0] + str_languageCurrent[1] + "_flag_resized.gif"; 1249 <div class="hidden-lg hidden-md hidden-sm col-xs-4"> 1250 <img src="@cdnStaticDomain/Files/Images/BioLegend/header/GlobeP.png" alt='@areaCurrent.Culture' class="flagLink" id="mobileLanguageIcon"> 1251 </div> 1252 1253 <div class="mobile-language-wrapper mobileMenuItem" id="mobileLanguageMenu"> 1254 <ul> 1255 @foreach (var i in loop_websiteLanguages) 1256 { 1257 var str_areaLangID = i.GetString("ID"); 1258 var str_language = i.GetString("Culture").Split('-'); 1259 var languageFlagSrc = cdnStaticDomain + "/Files/Templates/Designs/BioLegend/images/icons/" + str_language[0] + str_language[1] + "_flag_resized.gif"; 1260 1261 var area = Dynamicweb.Services.Areas.GetArea(Convert.ToInt32(str_areaLangID)); 1262 var culture = CultureInfo.GetCultureInfo(area.Culture); 1263 var currency = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 1264 var currencyCode = ""; 1265 var activeClass = ""; 1266 var thisCulture = i.GetString("Culture").ToLower(); 1267 var thisID = i.GetString("PageID"); 1268 1269 /* Maintain the query string for languages */ 1270 var test = GetGlobalValue("Global:Request.Query").Replace("ID="+str_pageID,"ID="+i.GetString("PageID")); 1271 1272 if(str_areaLangID == str_areaID){ 1273 activeClass = "activeItem"; 1274 } 1275 1276 foreach (var x in currency.Where(x => x.Code == area.EcomCurrencyId)) 1277 { 1278 currencyCode = x.Symbol.ToString().Trim(); 1279 } 1280 1281 var region = new RegionInfo(culture.Name); 1282 1283 if(!isHomepage){ 1284 var urlParams = ""; 1285 if (HttpContext.Current.Request.QueryString.HasKeys()) { 1286 1287 foreach (var thisKey in HttpContext.Current.Request.QueryString.AllKeys){ 1288 if(thisKey == null){} 1289 else if (thisKey.Equals("ID") || thisKey.Equals("k1") || thisKey.Equals("k2") || thisKey.Equals("k3") || thisKey.Equals("k4") || thisKey.Equals("k5") || thisKey.Equals("k6") || thisKey.Equals("k7") || thisKey.Equals("k8") || thisKey.Equals("k9") || thisKey.Equals("k10") || thisKey.Equals("k11") || thisKey.Equals("k12") || thisKey.Equals("p1") || thisKey.Equals("p2") || thisKey.Equals("p3") || thisKey.Equals("p4") || thisKey.Equals("p5") || thisKey.Equals("p6") || thisKey.Equals("p7") || thisKey.Equals("p8") || thisKey.Equals("p9") || thisKey.Equals("p10") || thisKey.Equals("p11") || thisKey.Equals("p12") || thisKey.Equals("adv1") || thisKey.Equals("adv2") || thisKey.Equals("adv3") || thisKey.Equals("adv4") || thisKey.Equals("adv5") || thisKey.Equals("adv6") || thisKey.Equals("adv7") || thisKey.Equals("adv8")){} 1290 else{ 1291 var thisReturn = HttpContext.Current.Request.QueryString[thisKey]; 1292 urlParams += "&" + thisKey + "=" + HttpUtility.UrlPathEncode(thisReturn); 1293 } 1294 } 1295 1296 } 1297 else{urlParams = "";} 1298 referrerUrl = "/Default.aspx?ID=" + @thisID + @urlParams; 1299 } 1300 else { 1301 referrerUrl = "/" + @thisCulture; 1302 } 1303 1304 <li class="@activeClass col-xs-12 noPadding"> 1305 1306 <a href="#" onclick="changeCountryFlag('@referrerUrl','@region.Name.ToString()');return false;" title='@region.DisplayName.ToString()' class="col-xs-12"> 1307 <img src="@languageFlagSrc" alt='@i.GetString("Culture")' title='@i.GetString("Culture")'> 1308 <b>@region.DisplayName.ToString()</b>&nbsp;(@currencyCode) @area.EcomCurrencyId 1309 </a> 1310 </li> 1311 } 1312 <li class="col-xs-12 noPadding navwwo"><a href="@wwOrdering">If your country is not listed,<br>click here for <strong>Worldwide Ordering</strong></a></li> 1313 </ul> 1314 </div> 1315 1316 } 1317 1318 } 1319 1320 @helper RenderAccountMenu() 1321 { 1322 <div id="loginForm" class="col-xs-12 col-sm-4 col-sm-offset-8"> 1323 <span>@Translate("myAccount", "My Account")</span> 1324 <i class="fa fa-close fa-lg"></i> 1325 @if(!String.IsNullOrEmpty(GetString("DwNavigation(myAccountMenu)"))){ 1326 @GetValue("DwNavigation(myAccountMenu)") 1327 } 1328 <a id="logoutBtn" href="/Admin/Public/Extranetlogoff.aspx" class="btn btn-primary">@Translate("logout", "Logout")</a> 1329 </div> 1330 } 1331 1332 @helper RenderLoginForm() 1333 { 1334 var loginLabel = Translate("login", "Login"); 1335 var createAccount = GetString("Item.Area.CreateAccount"); 1336 var viewCart = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetGlobalValue("Global:Request.PathAndQuery")); 1337 var myAccount = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetString("Item.Area.MyAccount")); 1338 var forgotPassword = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + GetString("Item.Area.ResetPassword")) + "?LoginAction=Recovery"; 1339 var autoImpersonate = GetString("Item.Area.AutoImpersonate").Replace("Default.aspx?ID=", ""); 1340 1341 <form action="Default.aspx?ID=@autoImpersonate" id="loginForm" method="post" class="col-xs-12 col-sm-6 col-sm-offset-6 col-lg-4 col-lg-offset-8"> 1342 <div class="hidden"> 1343 <input type="hidden" name="ID" value="@autoImpersonate"> 1344 @*<input type="hidden" value="../Designs/BioLegend/Extranet/recoveryPasswordTemplate.html" name="ForgotPasswordMailTemplate"> 1345 <input type="hidden" value="BioLegend - Password recover" name="ForgotPasswordMailSubject"> 1346 <input type="hidden" value="Your password has been sent to you by e-mail" name="ForgotPasswordConfirm"> 1347 <input type="checkbox" name="ForgotPassword" id="ForgotPasswordCheckbox" value="false" class="hidden">*@ 1348 <input type="hidden" name="DWExtranetUsernameRemember" value="True"> 1349 <input type="hidden" name="DWExtranetPasswordRemember" value="True"> 1350 <input type="hidden" name="referrerID" value="@Pageview.Page.ID"> 1351 <input type="hidden" id="loginRedirect" name="dummyRedirect" value=""> 1352 <input type="hidden" id="jsonAddProduct" name="jsonAddProduct" value=""> 1353 <input type="hidden" name="rawRedirect" value='@GetGlobalValue("Global:Request.PathAndQuery")'> 1354 </div> 1355 1356 <span>@Translate("loginRegister", "Login / Register")</span> 1357 <i class="fa fa-close fa-lg"></i> 1358 1359 <fieldset class="mandatory checkEmail"> 1360 <label for="userEmail">@Translate("emailAddress", "Email Address")</label> 1361 <input type="text" name="Username" id="userEmail"> 1362 </fieldset> 1363 <fieldset class="mandatory"> 1364 <label for="userPassword">@Translate("password", "Password")</label> 1365 <input id="userPassword" type="password" name="Password"> 1366 </fieldset> 1367 <input type="checkbox" name="Autologin"> @Translate("Remember me") 1368 <input type="submit" class="btn btn-primary" value="@loginLabel"> 1369 <div class="forgotButtons"> 1370 @Translate("Forgot your password?") 1371 <a class="pull-right forgotBtn btn btn-default" href="@forgotPassword">@Translate("resetPassword","Reset password?")</a> 1372 </div> 1373 <a href="@createAccount" class="btn btn-default">@Translate("createAccount", "Create an Account")</a> 1374 @*<a href="@viewCart" class="btn btn-default continueAsGuestButton hidden"> 1375 @Translate("continueAsGuest", "Continue as a Guest") 1376 <br> 1377 <small>@Translate("guestLoginMessage","* Shopping cart items can only be printed or emailed")</small> 1378 </a>*@ 1379 </form> 1380 } 1381 1382 @helper ShouldRedirectToSwitchAccount(bool bol_userLogged, List<LoopItem> loop, dynamic SecondaryUserID, string pageID, string myProfile, string switchAccount, string marketingPage){ 1383 if (bol_userLogged) 1384 { 1385 if (DynamicwebNA.PunchOutFacade.IsPunchOutUser()) 1386 { 1387 return; 1388 } 1389 1390 if((SecondaryUserID == 0) && !(pageID.Equals(myProfile.Replace("Default.aspx?ID=", ""))) && !(pageID.Equals(switchAccount.Replace("Default.aspx?ID=", "")))){ 1391 var url = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(switchAccount); 1392 1393 if((pageID.Equals(marketingPage.Replace("Default.aspx?ID=", "")))){ 1394 <div id="switchAccountPage" class="hidden">@url</div> 1395 } 1396 else { 1397 BioLegend.Shared.WebUtility.Redirect(url); 1398 } 1399 } 1400 else if(SecondaryUserID != 0) { 1401 var currentUser = User.GetCurrentUser(); 1402 var secondaryUser = User.GetUserByID(Int32.Parse(SecondaryUserID.ToString())); 1403 // todo remove after DK correct the issue 1404 System.Web.HttpContext.Current.Session["DW_extranet_AccessSecondaryUserID"] = SecondaryUserID; 1405 1406 // Save the current user ID (Impersonated user) 1407 foreach (var customField in secondaryUser.CustomFieldValues) 1408 { 1409 if (customField.CustomField.SystemName == "AccessUser_Last_impersonation_ID") 1410 { 1411 if (customField.Value.ToString() != currentUser.ID.ToString()) 1412 { 1413 customField.Value = currentUser.ID.ToString(); 1414 secondaryUser.Save(); 1415 } 1416 } 1417 } 1418 } 1419 } 1420 } 1421 1422 @helper RenderMiniCart(bool cartDisabled, string miniCartVersion){ 1423 1424 if(!cartDisabled) 1425 { 1426 var item2 = Pageview.Area.Item; 1427 var orderContext2 = item2["OrderContext"] != null ? item2["OrderContext"].ToString() : ""; 1428 var orderlinesContext2 = GetLoop("OrderContextCarts").Where(c => c.GetString("Ecom:OrderContext.ID").Equals(orderContext2)).ToList(); 1429 var totalProdQty2 = orderlinesContext2.FirstOrDefault()?.GetInteger("Ecom:Order.OrderLines.TotalProductQuantity"); 1430 var dateOrderModified = orderlinesContext2.FirstOrDefault()?.GetDate("Ecom:Order.Modified"); 1431 var orderlinesTest= GetLoop("OrderContextCarts").Where(c => c.GetString("Ecom:OrderContext.ID").Equals(orderContext2)); 1432 foreach(var item in GetLoop("OrderContextCarts")) { 1433 if(item.GetString("Ecom:OrderContext.ID") == orderContext2) { 1434 foreach( var orderline in item.GetLoop("OrderLines")) { 1435 if (orderline.GetDate("Ecom:Order:OrderLine.Modified") > dateOrderModified) { 1436 dateOrderModified = orderline.GetDate("Ecom:Order:OrderLine.Modified"); 1437 } 1438 } 1439 } 1440 } 1441 1442 if(miniCartVersion == "mobile"){ 1443 <div class="hidden-lg hidden-md hidden-sm col-xs-4 minicartHeader" id="minicartContainerMobile"> 1444 <a href="javascript:showMobileCart()" id="myCartButton" data-order-modified="@dateOrderModified"> 1445 <img src="/Files/Images/BioLegend/header/CartW.png"> 1446 </a> 1447 </div> 1448 } 1449 else{ 1450 <div class="col-xs-1 col-sm-4 col-md-1 noPadding text-center minicartHeader" id="minicartContainer"> 1451 <a href="javascript:showMobileCart()" id="myCartButton" data-order-modified="@dateOrderModified"> 1452 <span class="hidden-xs header-white-link" style="color:#fff;"><img src="/Files/Images/BioLegend/header/CartW.png"></span> 1453 <span class="cart-count header-white-link" style="color:#fff !important;">(@totalProdQty2)</span> 1454 </a> 1455 </div> 1456 } 1457 } 1458 1459 } 1460 1461 @helper loadOldCart(){ 1462 var savedCartPage = GetPageIdByNavigationTag("SavedCart"); 1463 var thisCart = ""; 1464 var orderContext = GetString("Item.Area.OrderContext"); 1465 var orderlinesContext = GetLoop("OrderContextCarts").Where(c => c.GetString("Ecom:OrderContext.ID").Equals(orderContext)).ToList(); 1466 thisCart = orderlinesContext.FirstOrDefault()?.GetString("Ecom:Order.ID"); 1467 var isCart = GetString("Title") == "BioLegend - View cart" ? true : false; 1468 var dirty = "/dwcountry/saved-cart?SavedCart="; 1469 var sessionCart = ""; 1470 if(System.Web.HttpContext.Current.Session["CurrentCart"] != null){ 1471 sessionCart = System.Web.HttpContext.Current.Session["CurrentCart"].ToString(); 1472 } 1473 1474 1475 var cartList = ""; 1476 if (string.IsNullOrWhiteSpace(thisCart) && (!string.IsNullOrWhiteSpace(sessionCart)) && savedCartPage != Pageview.Page.ID) 1477 { 1478 dirty += sessionCart; 1479 var order = !string.IsNullOrWhiteSpace(sessionCart) ? Dynamicweb.Ecommerce.Orders.Order.GetOrderById(sessionCart) : null; 1480 if(order != null) { 1481 cartList = "["; 1482 var orderlines = order.OrderLines; 1483 foreach (var ol in orderlines) 1484 { 1485 if(!string.IsNullOrWhiteSpace(ol.ProductNumber)){ 1486 cartList += "{catalog : \""+@ol.ProductNumber+"\", qty : \""+@ol.Quantity+"\"},"; 1487 } 1488 } 1489 cartList = cartList + "]"; 1490 cartList = cartList.Replace(",]", "]"); 1491 } 1492 1493 if(!string.IsNullOrWhiteSpace(cartList) && cartList != "[]" && !isCart){ 1494 <script type="text/javascript"> 1495 window.onload = addCatToCart(@cartList); 1496 </script> 1497 } 1498 else if(!string.IsNullOrWhiteSpace(cartList) && cartList != "[]" && isCart){ 1499 <script type="text/javascript"> 1500 document.getElementById("emptyCart").innerHTML = "Loading..."; 1501 document.addEventListener('cartAdded', function (e) { 1502 location.reload(); 1503 }, false); 1504 if (obj_areaItems.bol_isTheCheckoutDisabled == "True" && sessionStorage.getItem('checkoutDisabled') === null) { 1505 document.getElementById("emptyCart").innerHTML = "Checkout is currently disabled. Please try again later."; 1506 } 1507 else{ 1508 window.onload = addCatToCart(@cartList); 1509 } 1510 1511 </script> 1512 } 1513 1514 } 1515 } 1516 1517 @helper checkCookiePreferences(){ 1518 var DWOptin = 0; 1519 if(System.Web.HttpContext.Current.Request.Cookies["Dynamicweb.CookieOptInLevel"] == null){DWOptin = 12;} 1520 else{DWOptin = Int32.Parse(System.Web.HttpContext.Current.Request.Cookies["Dynamicweb.CookieOptInLevel"].Value);} 1521 1522 if(System.Web.HttpContext.Current.Request.Cookies["CookieConsent"] == null){ 1523 <script type="text/javascript"> 1524 window.onload = setOptInCookie(1,@DWOptin); 1525 </script> 1526 } 1527 else{ 1528 if(System.Web.HttpContext.Current.Request.Cookies["CookieConsent"].Value.Equals(0)){ 1529 <script type="text/javascript"> 1530 window.onload = setOptInCookie(1,@DWOptin); 1531 </script> 1532 } 1533 else if(System.Web.HttpContext.Current.Request.Cookies["CookieConsent"].Value.Contains("statistics:true")){ 1534 <script type="text/javascript"> 1535 window.onload = setOptInCookie(2,@DWOptin); 1536 </script> 1537 } 1538 else{} 1539 } 1540 } 1541 1542 @functions { 1543 public static string StripHtml(string source) 1544 { 1545 var teste = source.Replace("&gt;",">").Replace("&lt;","<"); 1546 return Regex.Replace(teste, "<.*?>", string.Empty); 1547 } 1548 1549 public static string GetUserCulture(IList<LoopItem> websiteLanguages) 1550 { 1551 if (Dynamicweb.Frontend.PageView.Current().User == null) return string.Empty; 1552 1553 var user = Dynamicweb.Frontend.PageView.Current().User; 1554 var userCulture = websiteLanguages.FirstOrDefault(x => x.GetString("Name").IndexOf(user.Country, StringComparison.InvariantCultureIgnoreCase) != -1); 1555 1556 return userCulture == null ? string.Empty : userCulture.GetString("Culture"); 1557 } 1558 1559 public static string GetCurrentCulture() 1560 { 1561 var areaId = Dynamicweb.Frontend.PageView.Current().Area.ID; 1562 var areaCurrent = Dynamicweb.Services.Areas.GetArea(Convert.ToInt32(areaId)); 1563 var currentCulture = areaCurrent.Culture; 1564 return currentCulture; 1565 } 1566 }