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