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