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