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