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