Search Results

Error executing template "Designs/BioLegend/eCom/Productlist/productList_detail.cshtml"
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at CompiledRazorTemplates.Dynamic.RazorEngine_326db89b21f04220b6f827e8ad030bfd.GetFilterData(String fieldID) in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_detail.cshtml:line 972
   at CompiledRazorTemplates.Dynamic.RazorEngine_326db89b21f04220b6f827e8ad030bfd.Execute() in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_detail.cshtml:line 663
   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 Dynamicweb; 3 @using Dynamicweb.Frontend; 4 @using Dynamicweb.Rendering; 5 @using System; 6 @using System.IO; 7 @using System.Web; 8 @using System.Data; 9 @using System.Text; 10 @using System.Text.RegularExpressions; 11 @using BioLegend.Ecommerce.LiveIntegration; 12 @using System.Collections.Generic; 13 @using System.Linq; 14 @using System.Collections; 15 16 @using System.Collections.Specialized; 17 @using System.Linq 18 @functions { 19 20 public string LocalizeLinksHTML (string HtmlContent){ 21 int areaID = Pageview.Area.ID; 22 var area = Dynamicweb.Services.Areas.GetArea(areaID); 23 string areaCulture = area.Culture.ToLower(); 24 if(!string.IsNullOrEmpty(HtmlContent)){ 25 if(HtmlContent.IndexOf("dwcountry") > -1){ 26 return HtmlContent.Replace("dwcountry",areaCulture); 27 } else{ 28 return HtmlContent; 29 } 30 31 } else { 32 return HtmlContent; 33 } 34 35 } 36 37 public string LocalizeLinks (string HtmlContent){ 38 int areaID = Pageview.Area.ID; 39 var area = Dynamicweb.Services.Areas.GetArea(areaID); 40 string areaCulture = area.Culture.ToLower(); 41 if(!string.IsNullOrEmpty(HtmlContent)){ 42 if(HtmlContent.IndexOf("dwcountry") > -1){ 43 return HtmlContent.Replace("dwcountry",areaCulture); 44 } else if (HtmlContent.IndexOf("?ID=") > -1) { 45 //do something 46 string baseHref = String.Format("https://{0}",GetGlobalValue("Global:Request.Host")); 47 HtmlContent = HtmlContent.Contains("http") ? HtmlContent : baseHref + "/" + HtmlContent; 48 var uri = new Uri(HtmlContent,UriKind.RelativeOrAbsolute); 49 var parsedQuery = HttpUtility.ParseQueryString(uri.Query); 50 var pageID = parsedQuery.Get("ID"); 51 52 string pageVersionID = pageID; 53 string localizedLink = HtmlContent; 54 if (!string.IsNullOrEmpty(pageID)){ 55 var pageService = new Dynamicweb.Content.PageService(); 56 var linkPage = pageService.GetPagesByAreaID(areaID).FirstOrDefault(x => x.MasterPageId == int.Parse(pageID)); 57 pageVersionID = linkPage != null ? linkPage.ID.ToString() : pageID ; 58 59 localizedLink = ModifyQueryStringValue(HtmlContent,"ID",pageVersionID); 60 } 61 //return string.Join(",", parsedQuery.AllKeys); 62 //return string.Join(HtmlContent,"-",pageVersionID); 63 return localizedLink; 64 } else { 65 return HtmlContent; 66 } 67 }else { 68 return HtmlContent; 69 } 70 71 } 72 73 private string ModifyQueryStringValue(string p_query, string p_Name, string p_NewValue) 74 { 75 Uri uri = new Uri(p_query,UriKind.RelativeOrAbsolute); 76 //if(p_query.Contains("http")) 77 //{ 78 //uri = new Uri(p_query); 79 //} else { 80 //uri = new Uri(p_query, UriKind.Relative); 81 //} 82 //uri = new Uri(p_query); 83 84 85 86 var nameValues = HttpUtility.ParseQueryString(uri.Query); 87 nameValues.Set(p_Name, p_NewValue); 88 string url = uri.AbsolutePath + "?" + nameValues.ToString(); 89 return url; 90 } 91 } 92 @{ 93 bool isAValidSearch = true; 94 if ((System.Web.HttpContext.Current.Request.QueryString["Keywords"] != null || System.Web.HttpContext.Current.Request.QueryString["adv1"] != null ) && System.Web.HttpContext.Current.Request.QueryString["k1"] == null && System.Web.HttpContext.Current.Request.QueryString["p1"] == null && System.Web.HttpContext.Current.Request.QueryString["adv1-k1"] == null) 95 { 96 isAValidSearch = ProcessRequest(); 97 } 98 } 99 @functions { 100 public const int numberOfAdvFields = 7; // Number of free text fields (adv) in the advanced search 101 102 /* This method get all the ADV parameters values and concatenate that values into a string */ 103 public static string GetAllTheAdvValuesFromQuery() 104 { 105 var allAdvValues = string.Empty; 106 107 for (int adv = 1; adv <= numberOfAdvFields; adv++) 108 { 109 var currentAdv = System.Web.HttpContext.Current.Request.Params["adv" + adv]; 110 111 if (!string.IsNullOrEmpty(currentAdv)) 112 { 113 allAdvValues += " " + currentAdv; 114 } 115 } 116 117 return allAdvValues; 118 } 119 120 /* This method gets the number of kewords per input */ 121 public static List<int> GetNumberOfKeywordsPerInput() 122 { 123 var kewordsCount = new List<int>(); 124 125 for (int adv = 1; adv <= numberOfAdvFields; adv++) 126 { 127 var currentAdv = System.Web.HttpContext.Current.Request.Params["adv" + adv]; 128 129 if (string.IsNullOrEmpty(currentAdv)) continue; 130 string[] splitParams = currentAdv.Split(' '); 131 kewordsCount.Add(splitParams.Length); 132 } 133 134 return kewordsCount; 135 } 136 137 /* This method returns the parameters from the "thesaurus" named item list */ 138 public static string GetParamsFromThesaurus( bool isLiveSearch, List<string> keywords, int advNumber = 1) 139 { 140 var prefixParameter = isLiveSearch ? string.Format("adv{0}-k", advNumber) : "k"; 141 var parameter = string.Empty; 142 143 for (var i = 0; i < keywords.Count; i++) 144 { 145 parameter += "&" + prefixParameter + (i + 1) + "=" + keywords[i]; 146 147 using (var connection = Dynamicweb.Data.Database.CreateConnection()) 148 { 149 using (var commandSearchTerms = connection.CreateCommand()) 150 { 151 commandSearchTerms.CommandText = string.Format("SELECT RelatedTerm FROM {0} WHERE SearchTerm = ''+@keywordSearch+''", "itemtype_thesaurus"); 152 153 commandSearchTerms.Parameters.Add(new System.Data.SqlClient.SqlParameter() 154 { 155 ParameterName = "keywordSearch", 156 SqlDbType = System.Data.SqlDbType.NVarChar, 157 Value = keywords[i] 158 }); 159 160 var readerSearch = commandSearchTerms.ExecuteScalar(); 161 162 if(readerSearch != null && !string.IsNullOrWhiteSpace(readerSearch.ToString())) 163 { 164 parameter += ","+readerSearch; 165 } 166 } 167 } 168 } 169 return parameter; 170 } 171 172 public bool ProcessRequest() 173 { 174 string id = Pageview.Page.ID.ToString(); 175 string postKeywords = System.Web.HttpContext.Current.Request.QueryString["Keywords"] ?? ""; 176 postKeywords = !string.IsNullOrEmpty(postKeywords) ? postKeywords : GetAllTheAdvValuesFromQuery(); 177 string criteria = ""; 178 bool isLiveSearch = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["isLiveSearch"]) ? Convert.ToBoolean(System.Web.HttpContext.Current.Request.Params["isLiveSearch"]) : false; 179 180 if (!string.IsNullOrWhiteSpace(postKeywords)) 181 { 182 criteria = System.Web.HttpUtility.HtmlEncode(postKeywords.Trim()); 183 criteria = criteria.Replace("\"", ""); 184 criteria = criteria.Replace("&ldquo;", ""); 185 criteria = criteria.Replace("&rdquo;", ""); 186 criteria = criteria.Replace("“", ""); 187 criteria = criteria.Replace("”;", ""); 188 criteria = criteria.Replace("&#8220;", ""); 189 criteria = criteria.Replace("&#8221;", ""); 190 criteria = criteria.Replace("&#34;", ""); 191 } 192 193 criteria = Regex.Replace(criteria, "cyclin a", "cyclin.a", RegexOptions.IgnoreCase); 194 criteria = Regex.Replace(criteria, "protein a", "protein.a", RegexOptions.IgnoreCase); 195 criteria = Regex.Replace(criteria, "granzyme a", "granzyme.a", RegexOptions.IgnoreCase); 196 criteria = Regex.Replace(criteria, "buffer set a", "buffer set.a", RegexOptions.IgnoreCase); 197 criteria = Regex.Replace(criteria, "glycophorin a", "glycophorin.a", RegexOptions.IgnoreCase); 198 criteria = Regex.Replace(criteria, "do-7", "DO7", RegexOptions.IgnoreCase); 199 criteria = Regex.Replace(criteria, "and-1", "AND1", RegexOptions.IgnoreCase); 200 criteria = Regex.Replace(criteria, "total%20seq", "totalseq", RegexOptions.IgnoreCase); 201 criteria = Regex.Replace(criteria, "totalseq-a", "totalseqa", RegexOptions.IgnoreCase); 202 criteria = Regex.Replace(criteria, "totalseq-b", "totalseqb", RegexOptions.IgnoreCase); 203 criteria = Regex.Replace(criteria, "totalseq-c", "totalseqc", RegexOptions.IgnoreCase); 204 criteria = Regex.Replace(criteria, "totalseq-d", "totalseqd", RegexOptions.IgnoreCase); 205 206 207 string tableName = "UrlPath"; 208 string urlToRedirect = ""; 209 using (var connection = Dynamicweb.Data.Database.CreateConnection()) 210 { 211 using (var command = connection.CreateCommand()) 212 { 213 command.CommandText = string.Format("SELECT * FROM {0} WHERE UrlPathPath = ''+@keyword+''", tableName); 214 command.Parameters.Add(new System.Data.SqlClient.SqlParameter() 215 { 216 ParameterName = "keyword", 217 SqlDbType = System.Data.SqlDbType.NVarChar, 218 Value = criteria.ToUpper() 219 }); 220 221 using (var reader = command.ExecuteReader()) 222 { 223 if (reader != null) 224 { 225 while (reader.Read()) 226 { 227 urlToRedirect = reader["UrlPathRedirect"].ToString(); 228 break; 229 } 230 } 231 } 232 } 233 } 234 235 if (!string.IsNullOrWhiteSpace(urlToRedirect)) 236 { 237 urlToRedirect = urlToRedirect.Replace("http://www.biolegend.com", "").Replace("PageSize=1", "PageSize=99999"); 238 urlToRedirect = LocalizeLinks(urlToRedirect); 239 var friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(urlToRedirect); 240 urlToRedirect = !string.IsNullOrEmpty(friendlyUrl) ? friendlyUrl : urlToRedirect; 241 BioLegend.Shared.WebUtility.Redirect(urlToRedirect); 242 } 243 else 244 { 245 string kParameter = ""; 246 string tmpVal = criteria.Replace("chr(169)", "").Replace("chr(194).chr(174)", " ").Replace("chr(206).chr(177)", "") 247 .Replace("chr(206).chr(178)", "&alpha;").Replace("chr(206).chr(179)", "&beta;").Replace("chr(206).chr(180)", "&gamma;") 248 .Replace("chr(206).chr(181)", "&delta;").Replace("chr(206).chr(186)", "&epsilon;").Replace("chr(226).chr(132).chr(162)", "&kappa;") 249 .Replace("anti-biotin", "biotinAb").Replace("anti-PE", "PEab").Replace("anti-APC", "APCab").Replace("anti-streptavidin", "streptavidinab") 250 .Replace("anti-Biotin", "biotinAb").Replace("anti-pe", "PEab").Replace("anti-apc", "APCab").Replace("anti-Streptavidin", "streptavidinab") 251 .Replace("anti-FITC", "FITCab").Replace("anti-fitc", "FITCab").Replace("anti-SAV", "SAVab").Replace("anti-sav", "SAVab").Replace("anti-Sav", "SAVab") 252 .Replace("anti-", " ").Replace("antibody", "").Replace("Antibody", ""); //.Replace("anti", ""); 253 254 tmpVal = tmpVal == "anti" ? "" : tmpVal; 255 tmpVal = tmpVal.StartsWith("anti") ? tmpVal.Replace("anti", "") : tmpVal; 256 tmpVal = tmpVal.EndsWith("anti") ? tmpVal.Replace("anti", "") : tmpVal; 257 258 string[] tmpValWords = criteria.Split(' '); 259 260 if (tmpValWords.Length > 1) 261 { 262 List<string> tmpWords = new List<string>(); 263 foreach (var w in tmpValWords) 264 { 265 string word = w.ToLower(); 266 267 if (word.StartsWith("anti") || word.EndsWith("anti")) 268 { 269 word = word.Replace("anti", ""); 270 } 271 tmpWords.Add(word); 272 } 273 tmpVal = string.Join(" ", tmpWords.ToArray()); 274 } 275 276 tmpVal = tmpVal.Replace("%20", " ").Replace("+", " ").Replace(" ", ",").Replace("-", "-").Replace(" / ", ","); 277 278 // Named Item List 279 var keywords = new List<string>(); 280 char[] splitter = {','}; 281 keywords.AddRange(tmpVal.Split(splitter, System.StringSplitOptions.RemoveEmptyEntries)); 282 283 if (isLiveSearch) 284 { 285 var tmpKeywords = new List<string>(); 286 tmpKeywords.AddRange(tmpVal.Split(splitter, System.StringSplitOptions.RemoveEmptyEntries)); 287 int advIndex = 1; 288 foreach (var kewordsNumber in GetNumberOfKeywordsPerInput()) 289 { 290 var kewordsPerField = new List<string>(); 291 int tempKeywordsIndex = 1; 292 293 foreach (var keyword in tmpKeywords) 294 { 295 if( tempKeywordsIndex > kewordsNumber) 296 break; 297 298 kewordsPerField.Add(keyword); 299 tempKeywordsIndex++; 300 } 301 302 tmpKeywords.RemoveRange(0, kewordsPerField.Count); 303 304 kParameter += GetParamsFromThesaurus(true, kewordsPerField, advIndex); 305 advIndex++; 306 } 307 } 308 else 309 { 310 kParameter += GetParamsFromThesaurus(false, keywords); 311 } 312 313 if (!string.IsNullOrEmpty(criteria)) 314 { 315 string applications, 316 productType, 317 reactivy, 318 format, 319 cellType, 320 regulatoryStatus, 321 companyOld, 322 sortBy, 323 pageSize, 324 paragraphID, 325 redirectToThisUrl = string.Format("{0}?Keywords={1}{2}", Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + id), string.Join(" ", keywords.ToArray()), kParameter); 326 327 if (isLiveSearch) 328 { 329 applications = System.Web.HttpContext.Current.Request.QueryString["Applications"] ?? ""; 330 productType = System.Web.HttpContext.Current.Request.QueryString["ProductType"] ?? ""; 331 reactivy = System.Web.HttpContext.Current.Request.QueryString["Reactivity"] ?? ""; 332 format = System.Web.HttpContext.Current.Request.QueryString["Format"] ?? ""; 333 cellType = System.Web.HttpContext.Current.Request.QueryString["CellType"] ?? ""; 334 regulatoryStatus = System.Web.HttpContext.Current.Request.QueryString["RegulatoryStatus"] ?? ""; 335 companyOld = System.Web.HttpContext.Current.Request.QueryString["CompanyOld"] ?? ""; 336 sortBy = System.Web.HttpContext.Current.Request.QueryString["SortBy"] ?? ""; 337 pageSize = System.Web.HttpContext.Current.Request.QueryString["PageSize"] ?? ""; 338 paragraphID = System.Web.HttpContext.Current.Request.QueryString["PID"] ?? ""; 339 340 redirectToThisUrl += !string.IsNullOrWhiteSpace(applications) ? "&Applications=" + applications : ""; 341 redirectToThisUrl += !string.IsNullOrWhiteSpace(productType) ? "&ProductType=" + productType : ""; 342 redirectToThisUrl += !string.IsNullOrWhiteSpace(reactivy) ? "&Reactivity=" + reactivy : ""; 343 redirectToThisUrl += !string.IsNullOrWhiteSpace(format) ? "&Format=" + format : ""; 344 redirectToThisUrl += !string.IsNullOrWhiteSpace(cellType) ? "&CellType=" + cellType : ""; 345 redirectToThisUrl += !string.IsNullOrWhiteSpace(regulatoryStatus) ? "&RegulatoryStatus=" + regulatoryStatus : ""; 346 redirectToThisUrl += !string.IsNullOrWhiteSpace(companyOld) ? "&CompanyOld=" + companyOld : ""; 347 redirectToThisUrl += !string.IsNullOrWhiteSpace(sortBy) ? "&SortBy=" + sortBy : ""; 348 redirectToThisUrl += !string.IsNullOrWhiteSpace(pageSize) ? "&PageSize=" + (pageSize == "1" ? "99999" : pageSize) : ""; 349 redirectToThisUrl += !string.IsNullOrWhiteSpace(paragraphID) ? "&PID=" + paragraphID : ""; 350 } 351 352 BioLegend.Shared.WebUtility.Redirect(redirectToThisUrl); 353 } 354 } 355 return false; 356 } 357 358 } 359 @using System 360 @functions { 361 362 public double ConvertPrice(double price, Dynamicweb.Ecommerce.International.Currency fromCurrency, Dynamicweb.Ecommerce.International.Currency toCurrency, bool roundPrice = false) 363 { 364 if (price.Equals(0.0d)) 365 { 366 return price; 367 } 368 if (fromCurrency is null || toCurrency is null || (fromCurrency.Code ?? "") == (toCurrency.Code ?? "")) 369 { 370 return price; 371 } 372 else 373 { 374 var convertedPrice =fromCurrency.Rate / toCurrency.Rate * price; 375 return roundPrice ? Math.Ceiling(convertedPrice) : convertedPrice; 376 } 377 } 378 379 string RoundPrice(double price, bool isPriceInterestPointValue = true, bool roundPrice = true, bool showDecimals = false) 380 { 381 var priceDouble = price; 382 if(isPriceInterestPointValue) { 383 priceDouble = price * 0.01; 384 } 385 var isCurrencyJp = Dynamicweb.Ecommerce.Common.Context.Currency.CultureInfo == "ja-JP"; 386 /*var roundPriceDouble = Math.Round(priceDouble, 0, MidpointRounding.AwayFromZero);*/ 387 var roundPriceDouble = Math.Ceiling(priceDouble); 388 var roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString() : priceDouble.ToString()); 389 if(showDecimals){ 390 roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString("0.00") : priceDouble.ToString("0.00")); 391 } 392 393 var priceWithSymbol = string.Empty; 394 var currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 395 var positivePattern = Dynamicweb.Ecommerce.Common.Context.Currency.PositivePattern; 396 var symbolPlace = Dynamicweb.Ecommerce.Common.Context.Currency.SymbolPlace; 397 398 if (positivePattern == 3) 399 { 400 priceWithSymbol = String.Format("{0} {1}", currencySymbol, roundedPrice); 401 } 402 else if (positivePattern == 1) 403 { 404 priceWithSymbol = String.Format("{0} {1}", roundedPrice, currencySymbol); 405 } 406 else if (symbolPlace == 0 || positivePattern == 2) { 407 priceWithSymbol = String.Format("{0}{1}", currencySymbol, roundedPrice); 408 } 409 else 410 { 411 priceWithSymbol = String.Format("{0}{1}", roundedPrice, currencySymbol); 412 } 413 414 return priceWithSymbol; 415 } 416 417 string RoundPriceToCurrentCurrency(double price, bool roundPrice = false) 418 { 419 var defaultCurrency = Dynamicweb.Ecommerce.Common.Application.DefaultCurrency; 420 var currentCurrency = Dynamicweb.Ecommerce.Common.Context.Currency; 421 var convertedPrice = ConvertPrice(price, defaultCurrency, currentCurrency, roundPrice); 422 return FormatPrice(convertedPrice); 423 } 424 425 string FormatPrice(double price) 426 { 427 var formattedPrice = (new Dynamicweb.Ecommerce.International.CurrencyService()).FormatCurrency(Dynamicweb.Ecommerce.Common.Context.Currency, price, true); 428 return formattedPrice; 429 } 430 } 431 @{ 432 // List view by cookie ot parameter 433 string listView = System.Web.HttpContext.Current.Request.Cookies["dataList"] != null ? System.Web.HttpContext.Current.Request.Cookies["dataList"].Value : ""; 434 listView = System.Web.HttpContext.Current.Request.Params["view"] != null ? (System.Web.HttpContext.Current.Request.Params["view"].ToString() == "detail" ? "detailedView" : "") : listView; 435 var item = Pageview.Area.Item; 436 437 //-- REDIRECT 438 // If is the ExploreNewProducts page, redirect and put some parameters to filter 439 440 if( Pageview.Page.ID.ToString() != (item["LiveSearchPage"] ?? "").ToString() && Pageview.Page.ID.ToString() == (item["ExploreNewProducts"] ?? "").ToString() && (System.Web.HttpContext.Current.Request.QueryString["DateReleasedMin"] == null || System.Web.HttpContext.Current.Request.QueryString["DateReleasedMax"] == null)){ 441 string redirect = String.Format("Default.aspx?ID={0}&DateReleasedMin={1}&DateReleasedMax={2}", Pageview.Page.ID.ToString(), DateTime.Today.AddMonths(-6).ToString("yyyy-MM-dd"), DateTime.Today.ToString("yyyy-MM-dd")); 442 if(System.Web.HttpContext.Current.Request.Params["view"] == null && !String.IsNullOrEmpty(listView)) { 443 redirect = redirect + "&view=detail"; 444 } 445 BioLegend.Shared.WebUtility.Redirect(Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(redirect)); 446 } 447 var loop_subgroups = GetLoop("Subgroups").OrderBy(o => o.GetString("Ecom:Group.Name")).ToList(); 448 // If have subgroups, redirecto to the groups list page 449 if(loop_subgroups.Any()){ 450 string redirect = "/"+item["GroupsPage"].ToString()+"&GroupID="+System.Web.HttpContext.Current.Request.QueryString["GroupID"].ToString(); 451 BioLegend.Shared.WebUtility.Redirect(redirect); 452 } 453 454 455 var loopProduct = GetLoop("Products"); 456 string currentPageId = Pageview.Page.ID.ToString(); 457 bool isWebserviceAvailable = TemplatesHelper.IsWebServiceConnectionAvailable(); 458 var contentSearchPage = item["ContentSearchPage"]; 459 // SORT BY 460 string sortByName = "Name_sortable,Price"; 461 string sortByClone = "CloneIndexed,Name_sortable,Price"; 462 string sortByMatch = "-_score,CloneIndexed,Name_sortable,Price"; 463 string sortByApplication = "AppAbrvString,Name_sortable,Price"; 464 string sortByRegulatoryStatus = "CustomField_RegulatoryStatus,Name_sortable,Price"; 465 string str_sortOrder = System.Web.HttpContext.Current.Request.Params["SortOrder"] ?? ""; 466 string str_sortBy = System.Web.HttpContext.Current.Request.Params["SortBy"] ?? ""; 467 string str_pageSize = System.Web.HttpContext.Current.Request.Params["PageSize"] ?? "25"; 468 string str_keywordsParam = System.Web.HttpContext.Current.Request.Params["Keywords"] ?? ""; 469 string str_k1 = System.Web.HttpContext.Current.Request.Params["k1"] ?? ""; 470 string str_GeneIDParam = System.Web.HttpContext.Current.Request.Params["GeneID"] ?? ""; 471 string str_SpecificityParam = System.Web.HttpContext.Current.Request.Params["Specificity"] ?? ""; 472 string str_paramGroupID = System.Web.HttpContext.Current.Request.Params["groupid"] ?? ""; 473 bool isASimpleSearch = (System.Web.HttpContext.Current.Request.QueryString.Count <=3 && !String.IsNullOrEmpty(str_keywordsParam) && !String.IsNullOrEmpty(str_k1)) || (System.Web.HttpContext.Current.Request.QueryString.Count <=2 && !String.IsNullOrEmpty(str_keywordsParam)); 474 475 str_sortBy = str_sortBy.Replace("%2C",","); 476 string str_FormatsParam = System.Web.HttpContext.Current.Request.Params["Format"] ?? ""; 477 string str_CloneParam = System.Web.HttpContext.Current.Request.Params["Clone"] ?? ""; 478 479 480 481 @functions{ 482 public static string GetImage(string str_source, int num_width, int num_height, int num_widthTablet = 0, int num_heightTablet = 0, int num_widthMobile = 0, int num_heightMobile = 0, string str_format = "jpg", int num_compression = 75, int num_crop = 5) 483 { 484 Dynamicweb.Frontend.PageView obj_currentPageview = Dynamicweb.Frontend.PageView.Current(); 485 string str_currDevice = obj_currentPageview.Device.ToString(); 486 string str_alternativeImage = obj_currentPageview.Area.Item["NoImage"] != null ? obj_currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/Lorenz/images/alternativeImage.jpg"; 487 488 string str_width = ""; 489 string str_height = ""; 490 int num_getImageWidth = num_width != 0 ? num_width : 0; 491 int num_getImageHeight = num_height != 0 ? num_height : 0; 492 string str_getImageFormat = str_format != "jpg" ? "&amp;Format=" + str_format : ""; 493 string str_getImageCompression = num_compression != 75 ? "&amp;Compression=" + num_compression : ""; 494 495 var cdnImageHandleDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Image_Handler", "Image_Handler_Domain"); //CUSTOM CODE 496 497 if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 498 { 499 num_getImageWidth = num_widthTablet != 0 ? num_widthTablet : num_getImageWidth; 500 num_getImageHeight = num_heightTablet != 0 ? num_heightTablet : num_getImageHeight; 501 } 502 else if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 503 { 504 num_getImageWidth = num_widthMobile != 0 ? num_widthMobile : num_getImageWidth; 505 num_getImageHeight = num_heightMobile != 0 ? num_heightMobile : num_getImageHeight; 506 } 507 508 if (num_getImageWidth != 0) 509 { 510 str_width = "&amp;Width=" + num_getImageWidth; 511 } 512 if (num_getImageHeight != 0) 513 { 514 str_height = "&amp;Height=" + num_getImageHeight; 515 } 516 517 string str_output = cdnImageHandleDomain + "/Admin/Public/GetImage.ashx?Image=" + str_source + str_width + str_height + "&amp;altFmImage_path=" + str_alternativeImage + str_getImageFormat + str_getImageCompression + "&amp;Crop=" + num_crop; 518 return str_output; 519 } 520 } 521 522 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); //CUSTOM CODE 523 } 524 525 @if(loopProduct.Any() && isAValidSearch) 526 { 527 string groupLink = GetString("Ecom:Group:Field.LandingPageLink.Value.Clean"); 528 string searchPageID = item["SearchResults"].ToString(); 529 string detailPageID = item["ProductDetail"].ToString(); 530 string detailPunchoutPageID = item["Punchout_ProductDetail"] != null ? item["Punchout_ProductDetail"].ToString() : ""; 531 string liveSearchPage = item["LiveSearchPage"] != null ? item["LiveSearchPage"].ToString() : ""; 532 string liveSearchPagePunchout = item["Punchout_LiveSearchPage"] != null ? item["Punchout_LiveSearchPage"].ToString() : ""; 533 string addToCart = item["AddToCart"] != null ? item["AddToCart"].ToString() : ""; 534 bool cartDisabled = Convert.ToBoolean(item["DisableAddToCart"].ToString()); 535 string orderContext = item["OrderContext"] != null ? item["OrderContext"].ToString() : ""; 536 bool isConnectionAvailable = GetBoolean("Item.Area.DisableCheckout.Value") || !TemplatesHelper.IsWebServiceConnectionAvailable() ? false : true; 537 string inactiveButtonClass = isConnectionAvailable ? "addToCart" : "addToCart inactive"; 538 string str_liveSearchFormat = System.Web.HttpContext.Current.Request.Params["Format"] ?? ""; 539 string str_liveSearchReactivity = System.Web.HttpContext.Current.Request.Params["Reactivity"] ?? ""; 540 string str_liveSearchCellType = System.Web.HttpContext.Current.Request.Params["CellType"] ?? ""; 541 string str_liveSearchRegulatoryStatus = System.Web.HttpContext.Current.Request.Params["RegulatoryStatus"] ?? ""; 542 string str_liveSearchProductType = System.Web.HttpContext.Current.Request.Params["ProductType"] ?? ""; 543 string str_liveSearchApplications = System.Web.HttpContext.Current.Request.Params["Applications"] ?? ""; 544 string str_liveSearchCompanyOld = System.Web.HttpContext.Current.Request.Params["CompanyOld"] ?? ""; 545 546 string sortByNameSelected = str_sortBy == sortByName ? "sortActive" : ""; 547 string sortByCloneSelected = (str_sortBy == sortByClone || str_sortBy == "" ) ? "sortActive" : ""; 548 string sortByApplicationsSelected = str_sortBy == sortByApplication ? "sortActive" : ""; 549 string sortByRegulatoryStatusSelected = str_sortBy == sortByRegulatoryStatus ? "sortActive" : ""; 550 551 string colGroup = (!cartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 552 553 var prodLoop = loopProduct.Where(x => !string.IsNullOrWhiteSpace(x.GetString("Ecom:Product.Number"))).GroupBy(x => x.GetString("Ecom:Product.ID")).ToList(); 554 var prodLoopCount = prodLoop.Count; 555 556 557 // -------------------- 558 559 string str_imagesFolder = "/Files/Files/BioLegend/Products/"; 560 string navEnvironment = item["NavEnvironment"] != null ? item["NavEnvironment"].ToString() : ""; 561 string str_pagingHref = ""; 562 bool bol_userLogged = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 563 string siteCurrency = Dynamicweb.Frontend.PageView.Current().Area.EcomCurrencyId; 564 string userCurrency = bol_userLogged ? Dynamicweb.Security.UserManagement.User.GetCurrentUser().Currency : siteCurrency; 565 566 Dictionary<string, string> productTypes = new Dictionary<string, string>(); 567 productTypes.Add("AncillaryProducts", "Ancillary"); 568 productTypes.Add("BuffersSolutionsChemicals", "Ancillary"); 569 productTypes.Add("CellBiologyAntibodies", "PrimaryAntibodies"); 570 productTypes.Add("CellSeparation", "MojoSort"); 571 productTypes.Add("CytokineChemokineAntibodies", "PrimaryAntibodies"); 572 productTypes.Add("ELISAMAXLEGENDMAX", "ELISA"); 573 productTypes.Add("EpitopeTagProducts", "PrimaryAntibodies"); 574 productTypes.Add("HumanImmunologyAntibodies", "PrimaryAntibodies"); 575 productTypes.Add("IsotypeControls", "IsotypeControls"); 576 productTypes.Add("LEGENDplex", "LEGENDplex"); 577 productTypes.Add("LEGENDScreen", "LEGENDScreen"); 578 productTypes.Add("MarmosetImmunologyAntibodies", "PrimaryAntibodies"); 579 productTypes.Add("MouseImmunologyAntibodies", "PrimaryAntibodies"); 580 productTypes.Add("NeuroscienceProducts", "PrimaryAntibodies"); 581 productTypes.Add("RatImmunologyAntibodies", "PrimaryAntibodies"); 582 productTypes.Add("RecombinantProteins", "Recombinant"); 583 productTypes.Add("SecondaryReagents", "SecondaryReagents"); 584 productTypes.Add("VirusImmunologyAntibodies", "PrimaryAntibodies"); 585 productTypes.Add("EnzymeAssays", "EnzymeAssays"); 586 productTypes.Add("FlexT", "FlexT"); 587 productTypes.Add("NonAntibodyChemicalProbes", "NonAntibodyChemicalProbes"); 588 int pageCal = 0; 589 string previousElement = ""; 590 string longLang = (string)GetGlobalValue("Global:Area.LongLang"); 591 var loop_productList3 = GetLoop("Ecom:ProductList.Pages3"); 592 int itemsCount = 0; 593 594 // Helpers to verify variants at the same product in a different page 595 @helper ShowTextAboutMoreOptionsInPreviousOrNextPages(List<LoopItem> loopProduct, bool isToPageBefore = false) 596 { 597 if(loopProduct.Any()) { 598 string countVariantsWithSameProdId = string.Empty; 599 string countTotalOfVariantsForProd = string.Empty; 600 string translateText = string.Empty; 601 string positionClass = "moreVariantsBefore"; 602 int totalPages = GetInteger("Ecom:ProductList.TotalPages"); 603 604 if(isToPageBefore) { 605 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.First().GetString("Ecom:Product.ID")).Count().ToString(); 606 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).First().ToString(); 607 translateText = Translate("SeeMoreSizeOptionsForThisProductOnThePreviousPage","See more size options for this product on the previous page."); 608 609 } 610 else { 611 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.Last().GetString("Ecom:Product.ID")).Count().ToString(); 612 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).Last().ToString(); 613 translateText = Translate("SeeMoreSizeOptionsForThisProductOnTheNextPage","See more size options for this product on the next page."); 614 positionClass = "moreVariantsNext"; 615 } 616 617 if(countVariantsWithSameProdId != countTotalOfVariantsForProd && totalPages > 1) { 618 <div class="@positionClass col-xs-12">@translateText</div> 619 } 620 621 } 622 } 623 624 625 626 if(!String.IsNullOrWhiteSpace(groupLink)) 627 { 628 BioLegend.Shared.WebUtility.Redirect(groupLink); 629 } 630 else if(prodLoopCount == 1 && GetInteger("Ecom:ProductList.CurrentPage") == 1 && !string.IsNullOrWhiteSpace(str_keywordsParam) && isASimpleSearch) 631 { 632 string frienldyHref = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(String.Format("Default.aspx?ID={0}&ProductID={1}",detailPageID,prodLoop[0].Key.ToString())); 633 BioLegend.Shared.WebUtility.Redirect(frienldyHref); 634 } 635 else 636 { 637 638 <div class='col-xs-12 noPadding'> 639 <div class="pull-left noPadding" id="moreInfo"> 640 <button class='btn-primary viewOption default @(string.IsNullOrWhiteSpace(listView) ? "active" : "")'>@Translate("listView","List View")</button> 641 <button class='btn-primary viewOption @(!string.IsNullOrWhiteSpace(listView) ? "active" : "")'>@Translate("detailView","Detail View")</button> 642 @if(!string.IsNullOrWhiteSpace(str_keywordsParam)){ 643 <button class='btn-primary' id="searchForContent" onClick="searchForContent();" data-searchpageID="@contentSearchPage">@Translate("contentPagesBTNText","Find Content Pages")</button> 644 } 645 </div> 646 <div class="noPadding"><hr id="searchButtonDivider" /></div> 647 </div> 648 649 bool bol_noResults = false; 650 var requestParams = System.Web.HttpContext.Current.Request.Params; 651 string str_groupID = !string.IsNullOrEmpty(requestParams["GroupID"]) ? requestParams["GroupID"].ToString() : ""; 652 string str_price = !string.IsNullOrEmpty(requestParams["Price"]) ? requestParams["Price"] : "" ; 653 string str_clone = !string.IsNullOrEmpty(requestParams["Clone"]) ? requestParams["Clone"] : "" ; 654 string str_keywords = !string.IsNullOrEmpty(requestParams["Keywords"]) ? requestParams["Keywords"] : "" ; 655 string DateReleasedMin = !string.IsNullOrEmpty(requestParams["DateReleasedMin"]) ? requestParams["DateReleasedMin"] : "" ; 656 string DateReleasedMax = !string.IsNullOrEmpty(requestParams["DateReleasedMax"]) ? requestParams["DateReleasedMax"] : "" ; 657 string view = !string.IsNullOrEmpty(requestParams["view"]) ? requestParams["view"] : "" ; 658 var lst_parameters = GetLoop("Query.Parameters"); 659 var loopFacetGroups = GetLoop("FacetGroups"); 660 661 /* Workaround due a DW bug */ 662 Dictionary<string, string> applicationsData = GetFilterData("BLFD_1"); 663 Dictionary<string, string> formatsData = GetFilterData("BLFDF_1"); 664 665 /* END Workaround */ 666 667 if(loopFacetGroups.Any()) 668 { 669 <div class="col-xs-2 noPadding"> 670 671 <div class="headerBox filtersHead col-xs-12 noPadding"> 672 <span class='title'>@Translate("filterYourResults", "Filter your results")</span> 673 </div> 674 675 <form id="filtersForm" action="/Default.aspx" class="col-xs-12 noPaddingLeft productSearchFilters"> 676 <input type="hidden" name="ID" value="@Pageview.Page.ID" /> 677 <input type="hidden" name="SortBy" value="@str_sortBy" /> 678 <input type="hidden" name="PageSize" value="@str_pageSize" /> 679 680 @hiddenField("Keywords", str_keywords) 681 @hiddenField("Clone", str_clone) 682 @if(string.IsNullOrEmpty(requestParams["p1"])){ 683 for(var k = 1; k < 12; k++){ 684 @hiddenField("k" + k, !string.IsNullOrEmpty(requestParams["k" + k]) ? requestParams["k" + k] : "") 685 } 686 } 687 else { 688 for(var p = 1; p < 12; p++){ 689 @hiddenField("p" + p, !string.IsNullOrEmpty(requestParams["p" + p]) ? requestParams["p" + p] : "") 690 } 691 } 692 @hiddenField("sortOrder", str_sortOrder) 693 @hiddenField("GroupID", str_paramGroupID) 694 @hiddenField("GeneID", str_GeneIDParam) 695 @hiddenField("Specificity", str_SpecificityParam) 696 @hiddenField("DateReleasedMin", DateReleasedMin) 697 @hiddenField("DateReleasedMax", DateReleasedMax) 698 699 <input type="hidden" name="view" value="@view" /> 700 701 @if(item["ExploreNewProducts"].ToString() == Pageview.Page.ID.ToString()){ 702 string currentMonth = DateTime.Today.ToString("MM"); 703 string monthParameter = requestParams["month"] != null ? requestParams["month"].ToString() : ""; 704 705 <fieldset> 706 <label>@Translate("Month", "Month")</label> 707 <div class="filtersContainer"> 708 <label class="radioBoxContainer" for="@currentMonth"><input class="month" data-min='@String.Format("{0}-{1}-01", DateTime.Today.Year, DateTime.Today.Month)' data-max='@String.Format("{0}-{1}-{2}", DateTime.Today.Year, DateTime.Today.Month, DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month))' @( monthParameter == currentMonth ? "checked='checked'" : "") type="radio" value="@currentMonth" id="@currentMonth" name="month"> <span>@DateTime.Today.ToString("MMMM")</span></label> 709 </div> 710 @for(var i=1; i < 6; i++ ){ 711 string month = DateTime.Today.AddMonths(-i).ToString("MMMM"); 712 string monthNumeric = DateTime.Today.AddMonths(-i).ToString("MM"); 713 <div class="filtersContainer"> 714 <label class="radioBoxContainer" for="@month"> 715 <input class="month" data-min='@String.Format("{0}-{1}-01", DateTime.Today.AddMonths(-i).Year, DateTime.Today.AddMonths(-i).Month)' data-max='@String.Format("{0}-{1}-{2}", DateTime.Today.AddMonths(-i).Year, DateTime.Today.AddMonths(-i).Month, DateTime.DaysInMonth(DateTime.Today.AddMonths(-i).Year, DateTime.Today.AddMonths(-i).Month))' @( monthParameter == monthNumeric ? "checked='checked'" : "") type="radio" value="@monthNumeric" id="@month" name="month"> 716 <span>@month</span> 717 </label> 718 </div> 719 } 720 </fieldset> 721 } 722 723 @foreach (LoopItem g in loopFacetGroups) { 724 foreach (LoopItem i in g.GetLoop("Facets")) { 725 string str_parameterType = lst_parameters.Where(x => x.GetString("Parameter.Name") == i.GetString("Facet.QueryParameter")).FirstOrDefault().GetString("Parameter.Type"); 726 string str_templateOutput = "string"; 727 728 if(str_parameterType.Contains("[]")){ 729 switch (i.GetString("Facet.Name")) 730 { 731 case "fieldName": 732 str_templateOutput = "multiselect"; 733 break; 734 default: 735 str_templateOutput = "checkboxes"; 736 break; 737 } 738 } 739 else if(str_parameterType.Contains("Boolean")){ 740 switch (i.GetString("Facet.Name")) 741 { 742 case "fieldName": 743 str_templateOutput = "select"; 744 break; 745 case "fieldName2": 746 str_templateOutput = "radio"; 747 break; 748 default: 749 str_templateOutput = "checkbox"; 750 break; 751 } 752 } 753 else if(!String.IsNullOrWhiteSpace(i.GetString("Facet.OptionCount"))) { 754 switch (i.GetString("Facet.Name")) 755 { 756 case "fieldName": 757 str_templateOutput = "select"; 758 break; 759 case "fieldName2": 760 str_templateOutput = "radios"; 761 break; 762 case "fieldName3": 763 str_templateOutput = "multiselect"; 764 break; 765 case "fieldName4": 766 str_templateOutput = "text"; 767 break; 768 default: 769 str_templateOutput = "checkboxes"; 770 break; 771 } 772 773 } 774 else { 775 switch (i.GetString("Facet.Name")) 776 { 777 case "fieldName": 778 str_templateOutput = "autocomplete"; 779 break; 780 default: 781 str_templateOutput = "text"; 782 break; 783 } 784 } 785 @field(i, str_parameterType, str_templateOutput, bol_noResults, applicationsData, formatsData) 786 } 787 } 788 </form> 789 </div> 790 791 @helper hiddenField(string name, string value){ 792 if(value != "") { 793 <input type="hidden" name="@name" value="@value" /> 794 } 795 } 796 797 @helper field(LoopItem i , string str_parameterType, string str_templateOutput, bool bol_noResults, Dictionary<string, string> applicationsData, Dictionary<string, string> formatsData ) { 798 string str_parameter = i.GetString("Facet.QueryParameter"); 799 string str_name = i.GetString("Facet.Name"); 800 var facetOptions = i.GetLoop("FacetOptions"); 801 802 if(bol_noResults){ 803 facetOptions = facetOptions.OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label")).ToList(); 804 } 805 else{ 806 facetOptions = facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderBy(o => o.GetString("FacetOption.Label")).ToList(); 807 } 808 809 switch (str_templateOutput) 810 { 811 case "multiselect": 812 if(facetOptions.Any()) { 813 <fieldset> 814 <legend>@str_name</legend> 815 <select data-selected-text-format="count" data-live-search="true" data-size="8" name="@str_parameter" multiple> 816 @foreach(LoopItem option in facetOptions.OrderByDescending(o => o.GetInteger("FacetOption.Label"))) 817 { 818 bool bol_checked = option.GetBoolean("FacetOption.Selected"); 819 string str_value = option.GetString("FacetOption.Value"); 820 821 <option selected="@bol_checked" value="@str_value">@option.GetString("FacetOption.Label")</option> 822 } 823 </select> 824 </fieldset> 825 } 826 827 break; 828 case "checkboxes": 829 string extraClass = ( i.GetString("Facet.QueryParameter").Equals("ExcitationLaser") || i.GetString("Facet.QueryParameter").Equals("Isotype") ) ? "noCapitalize" : ""; 830 string inputID = i.GetString("Facet.QueryParameter") + "Search"; 831 string inputDivID = i.GetString("Facet.QueryParameter") + "Div"; 832 if(facetOptions.Any()) { 833 int count = 0; 834 <fieldset data-type="@str_parameterType"> 835 @if(facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).Count() > 0) { 836 <legend class="filterTitle seeMoreProducts" data-parameter='@i.GetString("Facet.QueryParameter")'>@str_name</legend> 837 } 838 else{ 839 <legend class="filterTitle">@str_name</legend> 840 } 841 842 <div class="filtersContainer @extraClass hide" id="@inputDivID"> 843 @if(facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).Count() > 9) { 844 <div class="searchFilterContainer"> 845 <span class="fa fa-search"></span> 846 <input class="searchFilterSearchBar" id="@inputID" onkeyup="filterSearchFilterOptions('@inputID','@inputDivID');" > 847 </div> 848 } 849 @foreach(LoopItem option in facetOptions) 850 { 851 bool bol_checked = option.GetBoolean("FacetOption.Selected"); 852 string str_value = option.GetString("FacetOption.Value"); 853 if(bol_checked){ 854 Dictionary<string, string> breadcrumbSourceTemp = new Dictionary<string, string>(); 855 string thisFilter = @i.GetString("Facet.QueryParameter") + str_value; 856 breadcrumbSourceTemp.Add("val",str_value); 857 breadcrumbSourceTemp.Add("label",@option.GetString("FacetOption.Label")); 858 breadcrumbSourceTemp.Add("filter",@i.GetString("Facet.QueryParameter")); 859 breadcrumbSource.Add(thisFilter,breadcrumbSourceTemp); 860 } 861 count++; 862 //string str_class = count > 5 ? "hide" : ""; 863 864 <label class="checkBoxContainer"><input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> 865 <span> 866 @if(str_name == "Applications" && applicationsData.ContainsKey(str_value) ){ 867 @applicationsData[str_value] 868 } 869 else if (str_name == "Format" && formatsData.ContainsKey(str_value) ){ 870 @formatsData[str_value] 871 } 872 else { 873 @option.GetString("FacetOption.Label") 874 } 875 @if(option.GetInteger("FacetOption.Count") > 0) { 876 @String.Format("({0})", option.GetString("FacetOption.Count")); 877 } 878 </span> 879 </label> 880 } 881 </div> 882 </fieldset> 883 } 884 885 break; 886 case "select": 887 888 break; 889 case "checkbox": 890 891 if(facetOptions.Any()) { 892 <fieldset data-type="@str_parameterType"> 893 @foreach(LoopItem option in facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label"))) 894 { 895 bool bol_checked = option.GetBoolean("FacetOption.Selected"); 896 string str_value = option.GetString("FacetOption.Value") == "True" ? "True" : ""; 897 898 if(str_value == "True") { 899 <legend class="filterTitle">@str_name</legend> 900 <div class="filtersContainer"> 901 <label class="checkBoxContainer"><input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> <span>@str_name (@option.GetString("FacetOption.Count"))</span></label> 902 </div> 903 } 904 } 905 </fieldset> 906 } 907 908 break; 909 case "radio": 910 911 break; 912 case "radios": 913 914 break; 915 case "autocomplete": 916 917 break; 918 default: 919 <fieldset data-type="@str_parameterType"> 920 <legend class="filterTitle">@str_name</legend> 921 <div class="filtersContainer"> 922 <input type="text" name="@str_parameter" value="" /> 923 </div> 924 </fieldset> 925 break; 926 } 927 } 928 929 } 930 931 @functions{ 932 public Dictionary<string, Dictionary<string, string>> breadcrumbSource = new Dictionary<string, Dictionary<string, string>>(); 933 public string GetApplicationsLabel(string applicationValues, Dictionary<string, string> applicationsData){ 934 applicationValues = applicationValues.Replace("\"","").Replace(",",", "); 935 /* 936 string[] applicationsList = applicationValues.Split(','); 937 applicationValues = ""; 938 foreach(var app in applicationsList){ 939 if(applicationsData.ContainsKey(app)) { 940 applicationValues += !String.IsNullOrEmpty(applicationValues) ? ", " : ""; 941 applicationValues += applicationsData[app]; 942 } 943 } 944 */ 945 return applicationValues; 946 } 947 948 public Dictionary<string, string> GetFilterData(string fieldID) 949 { 950 //HttpContext.Current.Cache.Remove("applicationsDataCache_" + fieldID); 951 var applicationCache = HttpContext.Current.Cache["applicationsDataCache_" + fieldID]; 952 Dictionary<string, string> applicationsData = applicationCache as Dictionary<string, string> ?? new Dictionary<string, string>(); 953 if(applicationCache == null) 954 { 955 using(var connection = Dynamicweb.Data.Database.CreateConnection()) 956 { 957 using(var command = connection.CreateCommand()) 958 { 959 command.CommandText = "SELECT FieldOptionValue,FieldOptionName FROM EcomFieldOption WHERE FieldOptionFieldID=''+@fieldID+'' ORDER BY FieldOptionValue"; 960 command.Parameters.Add(new System.Data.SqlClient.SqlParameter() 961 { 962 ParameterName = "fieldID", 963 SqlDbType = System.Data.SqlDbType.NVarChar, 964 Value = fieldID 965 }); 966 using(var reader = command.ExecuteReader()) 967 { 968 if(reader != null) 969 { 970 while (reader.Read()) 971 { 972 applicationsData.Add(reader["FieldOptionValue"].ToString(), reader["FieldOptionName"].ToString()); 973 } 974 } 975 } 976 } 977 } 978 HttpContext.Current.Cache.Insert("applicationsDataCache_" + fieldID, applicationsData, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration); 979 } 980 return applicationsData; 981 } 982 } 983 984 <div class='col-xs-10 productArea noPaddingRight @(listView == "detailedView" ? "detailedView" : "" )'> 985 986 @{ 987 string groupDescription = GetString("Ecom:Group.Description"); 988 int loopProductCount = loopProduct.Count; 989 int totalProductCount = GetInteger("Ecom:ProductList.PageProdCnt"); 990 int startLoopProductCount = (loopProductCount * (GetInteger("Ecom:ProductList.CurrentPage") - 1)) + 1; 991 int endLoopProductCount = loopProductCount * GetInteger("Ecom:ProductList.CurrentPage"); 992 993 if(loopProductCount < GetInteger("Ecom:ProductList.PageSize")){ 994 startLoopProductCount = (GetInteger("Ecom:ProductList.PageSize") * (GetInteger("Ecom:ProductList.CurrentPage") - 1)) + 1; 995 endLoopProductCount = totalProductCount; 996 } 997 } 998 999 @if(!String.IsNullOrWhiteSpace(groupDescription)) { 1000 <div id="groupDescription" class="col-xs-12 noPadding"> 1001 @groupDescription 1002 </div> 1003 } 1004 1005 <span class="productListResume col-xs-3 noPadding"> 1006 @Translate("productListCount","{{numberProducts}} of {{countAllProducts}} items").Replace("{{numberProducts}}", String.Format("{0}-{1}", startLoopProductCount, endLoopProductCount)).Replace("{{countAllProducts}}", totalProductCount.ToString()) 1007 </span> 1008 1009 <form id="orderProdList" class="col-xs-3 noPadding" action="/Default.aspx" name="ExtUserForm_Main" method="GET"> 1010 <input type="hidden" name="ID" value='@Pageview.Page.ID'> 1011 @if(!string.IsNullOrWhiteSpace(str_paramGroupID)) 1012 { 1013 <input type="hidden" name="GroupID" value='@str_paramGroupID'> 1014 } 1015 1016 @if(!string.IsNullOrWhiteSpace(str_keywordsParam)) 1017 { 1018 <input type="hidden" name="Keywords" value='@str_keywordsParam'> 1019 } 1020 1021 @if(!string.IsNullOrWhiteSpace(str_GeneIDParam)) 1022 { 1023 <input type="hidden" name="GeneID" value='@str_GeneIDParam'> 1024 } 1025 1026 @if(!string.IsNullOrWhiteSpace(str_SpecificityParam)) 1027 { 1028 <input type="hidden" name="Specificity" value='@str_SpecificityParam'> 1029 } 1030 1031 <fieldset class="col-xs-12 noPadding" data-groupdID="@str_paramGroupID"> 1032 <label>@Translate("Sort by"):</label> 1033 <select id="sortSelect" name="SortBy"> 1034 <option selected='@(str_sortBy == "")' value="@sortByMatch">@Translate("Match","Best Match")</option> 1035 <option selected='@(str_sortBy == sortByName)' value="@sortByName">@Translate("Name")</option> 1036 <option selected='@(str_sortBy == sortByClone)' value="@sortByClone">@Translate("Clone","Clone")</option> 1037 <option selected='@(str_sortBy == sortByApplication )' value="@sortByApplication">@Translate("Applications","Applications")</option> 1038 <option selected='@(str_sortBy == sortByRegulatoryStatus)' value="@sortByRegulatoryStatus">@Translate("RegulatoryStatus","Regulatory Status")</option> 1039 </select> 1040 </fieldset> 1041 1042 </form> 1043 1044 @{ 1045 string str_nextPage = GetString("Ecom:ProductList.NextPage"); 1046 int num_totalPages = GetInteger("Ecom:ProductList.TotalPages"); 1047 int num_curPage = System.Web.HttpContext.Current.Request.Params["PageNum"] != null ? Convert.ToInt32(System.Web.HttpContext.Current.Request.Params["PageNum"].ToString()) : 1; 1048 string prevPageClean = GetString("Ecom:ProductList.PrevPage.Clean"); 1049 string nextPageClean = GetString("Ecom:ProductList.NextPage.Clean"); 1050 } 1051 1052 @if(num_totalPages > 1) 1053 { 1054 string getGlobalRequest = GetGlobalValue("Global:Request.Url"); 1055 1056 <ul class="pagination col-xs-5 pull-right"> 1057 @if(!string.IsNullOrWhiteSpace(prevPageClean)) 1058 { 1059 <li class="previous"><a href='@prevPageClean'><i class="fa fa-angle-left"></i> @Translate("Previous")</a></li> 1060 } 1061 1062 @if(num_curPage > 2 && num_totalPages > 3){ 1063 for(int i=1;i <= 1;i++){ 1064 string str_active = num_curPage == i ? "class=\"active\"" : ""; 1065 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum="+num_curPage, "PageNum=" + i ) : getGlobalRequest + "&PageNum=" + i; 1066 <li @str_active><a href="@str_pagingHref">@i</a></li> 1067 } 1068 if(num_totalPages > 4 && num_curPage != 3 ) { 1069 <li class="etc"><span>...</span></li> 1070 } 1071 } 1072 @foreach (LoopItem i in loop_productList3) 1073 { 1074 if(i.GetBoolean("Ecom:ProductList.Pages3.Page.IsCurrent")) 1075 { 1076 <li class="active"><a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a></li> 1077 } 1078 else 1079 { 1080 <li><a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a></li> 1081 } 1082 } 1083 @if(num_curPage < num_totalPages-1 && num_totalPages > 3){ 1084 if(num_totalPages > 4) { 1085 <li class="etc"><span>...</span></li> 1086 } 1087 for(int i=num_totalPages;i <= num_totalPages;i++){ 1088 string str_active = num_curPage == i ? "class=\"active\"" : ""; 1089 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum="+num_curPage, "PageNum="+i) : getGlobalRequest + "&PageNum=" + i; 1090 <li @str_active><a href="@str_pagingHref">@i</a></li> 1091 } 1092 } 1093 @if(!string.IsNullOrWhiteSpace(nextPageClean)) 1094 { 1095 <li class="next"><a href='@nextPageClean'>@Translate("Next") <i class="fa fa-angle-right"></i></a></li> 1096 } 1097 </ul> 1098 } 1099 1100 @helper Truncate(string str_input,int num_length) 1101 { 1102 if(str_input.Length <= num_length){ 1103 @str_input 1104 }else{ 1105 @str_input.Substring(0,num_length)<text>...</text> 1106 } 1107 } 1108 1109 <ul id="productsHolder" class="productList col-xs-12 noPadding"> 1110 1111 <li class="col-xs-12 noPadding"> 1112 <div class="col-xs-3 @sortByNameSelected"> 1113 @Translate("Product","Product") 1114 </div> 1115 1116 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-2") noPadding @sortByCloneSelected'> 1117 @Translate("Clone","Clone") 1118 </div> 1119 1120 <div class="col-xs-1 noPadding @sortByApplicationsSelected"> 1121 @Translate("Appl","Appl.") 1122 </div> 1123 1124 <div class="col-xs-1 @sortByRegulatoryStatusSelected"> 1125 @Translate("Reg","Reg") 1126 </div> 1127 1128 <div class='@(!cartDisabled ? "col-xs-5" : "col-xs-5") noPadding'> 1129 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1130 @Translate("categoryNumberShort","Cat#") 1131 </div> 1132 1133 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1134 @Translate("size","Size") 1135 </div> 1136 1137 @if(!cartDisabled) 1138 { 1139 <div class="col-xs-2 noPadding"> 1140 @Translate("price","Price") 1141 </div> 1142 1143 <div class="col-xs-1 noPadding"> 1144 @Translate("quantityHeader","Quantity") 1145 </div> 1146 } 1147 1148 </div> 1149 1150 </li> 1151 1152 @foreach (var group in prodLoop){ 1153 itemsCount++; 1154 1155 <li class="col-xs-12" > 1156 @if(itemsCount == 1) { 1157 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 1158 } 1159 @foreach (var product in group) 1160 { 1161 1162 string str_productName = product.GetString("Ecom:Product.Name"); 1163 string str_productID = product.GetString("Ecom:Product.ID"); 1164 var str_link = "/Default.aspx?id=" + GetPageIdByNavigationTag("ProductDetail") + "&ProductId=" + str_productID; 1165 //string str_link = product.GetString("Ecom:Product.Link.Clean"); 1166 bool excludeAB = product.GetBoolean("Ecom:Product:Field.ExcludeAB.Value"); 1167 string productType = product.GetString("Ecom:Product:Field.CMProductType.Value"); 1168 string productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 1169 string regulatoryStatus = product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"); 1170 string productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty , RegexOptions.Singleline).Trim(); 1171 string productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 1172 1173 string str_starClass = ""; 1174 string str_halfStar = ""; 1175 1176 string str_productImage = product.GetString("Ecom:Product.ImageSmall.Clean"); 1177 string str_productImageMedium = product.GetString("Ecom:Product.ImageMedium.Clean"); 1178 string str_productImageLarge = product.GetString("Ecom:Product.ImageLarge.Clean"); 1179 string str_productImage4 = product.GetString("Ecom:Product:Field.Image4Path.Value.Clean"); 1180 1181 string str_productGetImage = GetImage(str_productImage, 140, 0, 0, 0, 0, 0,"jpg",90); 1182 string str_productGetImageMedium = GetImage(str_productImageMedium, 140, 0, 0, 0, 0, 0,"jpg",90); 1183 string str_productGetImageLarge = GetImage(str_productImageLarge, 140, 0, 0, 0, 0, 0,"jpg",90); 1184 string str_productGetImage4 = GetImage(str_productImage4, 140, 0, 0, 0, 0, 0,"jpg",90); 1185 1186 string str_image1Description = product.GetString("Ecom:Product:Field.Image1Description.Value"); 1187 string str_image2Description = product.GetString("Ecom:Product:Field.Image2Description.Value"); 1188 string str_image3Description = product.GetString("Ecom:Product:Field.Image3Description.Value"); 1189 string str_image4Description = product.GetString("Ecom:Product:Field.Image4Description.Value"); 1190 1191 string str_image1Title = product.GetString("Ecom:Product:Field.Image1Title.Value"); 1192 string str_image2Title = product.GetString("Ecom:Product:Field.Image2Title.Value"); 1193 string str_image3Title = product.GetString("Ecom:Product:Field.Image3Title.Value"); 1194 string str_image4Title = product.GetString("Ecom:Product:Field.Image4Title.Value"); 1195 1196 string str_productImage5 = product.GetString("Ecom:Product:Field.Image5Path.Value.Clean"); 1197 string str_productGetImage5 = GetImage(str_productImage5, 140, 0, 0, 0, 0, 0,"jpg",90); 1198 string str_image5Description = product.GetString("Ecom:Product:Field.Image5Description.Value"); 1199 string str_image5Title = product.GetString("Ecom:Product:Field.Image5Title.Value"); 1200 1201 string str_productImage6 = product.GetString("Ecom:Product:Field.Image6Path.Value.Clean"); 1202 string str_productGetImage6 = GetImage(str_productImage6, 140, 0, 0, 0, 0, 0,"jpg",90); 1203 string str_image6Description = product.GetString("Ecom:Product:Field.Image6Description.Value"); 1204 string str_image6Title = product.GetString("Ecom:Product:Field.Image6Title.Value"); 1205 1206 string str_productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 1207 1208 string stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 1209 string stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 1210 string stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 1211 string stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 1212 1213 bool isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 1214 string DCSoon = product.GetString("Ecom:Product:Field.DCSoon.Value"); 1215 1216 bool blockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 1217 string blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 1218 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 1219 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 1220 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 1221 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 1222 1223 bool requestQuote = product.GetBoolean("Ecom:Product:Field.RequestQuote.Value"); 1224 1225 List<Tuple<string,string,string>> lst_images = new List<Tuple<string,string,string>>(); 1226 1227 if(!String.IsNullOrEmpty(str_productImage)) { lst_images.Add(new Tuple<string, string, string>(str_productImage,str_image1Title,str_image1Description)); } 1228 if(!String.IsNullOrEmpty(str_productImageMedium)) { lst_images.Add(new Tuple<string, string, string>(str_productImageMedium,str_image2Title,str_image2Description)); } 1229 if(!String.IsNullOrEmpty(str_productImageLarge)) { lst_images.Add(new Tuple<string, string, string>(str_productImageLarge,str_image3Title,str_image3Description)); } 1230 if(!String.IsNullOrEmpty(str_productImage4)) { lst_images.Add(new Tuple<string, string ,string>(str_productImage4,str_image4Title,str_image4Description)); } 1231 if(!String.IsNullOrEmpty(str_productImage5)) { lst_images.Add(new Tuple<string, string ,string>(str_productImage5,str_image5Title,str_image5Description)); } 1232 if(!String.IsNullOrEmpty(str_productImage6)) { lst_images.Add(new Tuple<string, string ,string>(str_productImage6,str_image6Title,str_image6Description)); } 1233 1234 string str_productVariantID = product.GetString("Ecom:Product.VariantID"); 1235 string urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 1236 string productFieldType = ""; 1237 if (productTypes.ContainsKey(productType)) 1238 { 1239 productFieldType = productTypes[productType]; 1240 } 1241 1242 int productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1243 string productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 1244 int productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1245 1246 @functions { 1247 public string CalculateProductName(string prodName, string prodType, string prodFormat, bool excludeAntibody) 1248 { 1249 string cleanName = prodName; 1250 if(prodType.Equals("PrimaryAntibodies") && !prodName.Contains(" Antibody") && !prodName.Contains("Buffer") && !prodName.Contains("Annexin") && !prodName.Contains("Solution") && !prodName.Contains("Diluent") && !prodName.Contains("Substrate Reagent") && !prodName.Contains("ecombinant") && !prodName.Contains("Panel") && !prodName.Contains("Elisa Max") && !prodName.Contains("Cocktail") && !prodName.Contains("Isotype Control") && !prodName.Contains("Avidin") && !prodName.Contains("Normal Serum Block") && !prodName.Contains("Detection Kit") && !prodName.Contains("Affinity") && !prodName.Contains("ELISA Kit") && !prodName.Contains("Phase-Flow") && !prodName.Contains("Treg Flow") && !prodFormat.Equals("Peptide") && (!excludeAntibody)){ 1251 cleanName += " Antibody"; 1252 } 1253 1254 if(prodType.Equals("SecondaryReagents") && !prodName.Contains(" Antibody") && !prodName.Contains("Streptavidin") && !prodName.Contains("Avidin") && (!excludeAntibody)){ 1255 cleanName += " Antibody"; 1256 } 1257 1258 if(prodType.Equals("IsotypeControls") && !prodName.Contains(" Antibody") && !prodName.Contains("Lineage Cocktail") && (!excludeAntibody)){ 1259 cleanName += " Antibody"; 1260 } 1261 1262 return cleanName; 1263 } 1264 } 1265 str_productName = CalculateProductName(str_productName,productFieldType,str_productFormat,excludeAB); 1266 1267 @helper renderCloneFieldForSearch(string clone, string spID, string pCat, string pReact, string searchType) 1268 { 1269 string cloneText = ""; 1270 if(!String.IsNullOrEmpty(clone)){ 1271 1272 string thisClone = ""; 1273 if(clone.Contains(";")){ 1274 string[] clones = (clone).Replace(" ", "").Split(';'); 1275 foreach (var x in clones) 1276 { 1277 string cloneHTML = System.Web.HttpUtility.HtmlDecode(x); 1278 string cloneTag = "; "; 1279 thisClone += "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + x + "</a>" + cloneTag; 1280 } 1281 } 1282 else{ 1283 string cloneHTML = System.Web.HttpUtility.HtmlDecode(clone); 1284 if(pCat.Equals("RECOM_PRO")){ 1285 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 1286 1287 } 1288 else{ 1289 if(searchType == "Detail"){ 1290 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 1291 } 1292 else{ 1293 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i> " + clone + "</a>"; 1294 } 1295 } 1296 1297 } 1298 1299 cloneText += thisClone; 1300 1301 1302 1303 } 1304 else if(!String.IsNullOrWhiteSpace(pReact) && !pCat.Equals("RECOM_PRO") && !searchType.Equals("Detail")) 1305 { 1306 cloneText += "<a href=\"javascript:void(0);\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i></a>"; 1307 } 1308 1309 <text>@cloneText</text> 1310 1311 } 1312 1313 @helper renderCloneFieldForSearch_v2(string clone, string spID, string pCat, string pReact, string searchType) 1314 { 1315 string cloneText = ""; 1316 if(!string.IsNullOrEmpty(clone)) { 1317 string thisClone = ""; 1318 if(clone.Contains(";")){ 1319 string[] clones = (clone).Replace(" ", "").Split(';'); 1320 foreach (var x in clones) 1321 { 1322 string cloneTag = "; "; 1323 thisClone += $"<a href=\"javascript:updateClone('{x}');\">{x}</a>" + cloneTag; 1324 } 1325 } 1326 else { 1327 if(pCat.Equals("RECOM_PRO") 1328 || searchType == "Detail") 1329 { 1330 thisClone = $"<a href=\"javascript:updateClone('{clone}');\">{clone}</a>"; 1331 } 1332 else { 1333 thisClone = "<a href=\"javascript:updateClone('" + clone + "');\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i> " + clone + "</a>"; 1334 } 1335 } 1336 1337 cloneText += thisClone; 1338 } 1339 else if(!string.IsNullOrWhiteSpace(pReact) && !pCat.Equals("RECOM_PRO") && !searchType.Equals("Detail")) 1340 { 1341 cloneText += "<a href=\"javascript:void(0);\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i></a>"; 1342 } 1343 1344 <text>@cloneText</text> 1345 } 1346 1347 1348 1349 <div class="row detailed"> 1350 @if(previousElement != str_productID) 1351 { 1352 <h2 class="col-xs-12"> 1353 <a itemprop="name" href="@str_link"> 1354 @str_productName 1355 </a> 1356 </h2> 1357 } 1358 1359 @if(previousElement != str_productID) 1360 { 1361 <div class="col-xs-7 noPadding"> 1362 <dl class="col-xs-12 noPadding"> 1363 @if(!string.IsNullOrWhiteSpace(productClone)) 1364 { 1365 <dt class="col-xs-6"> 1366 <b>@Translate("Clone","Clone")</b> 1367 </dt> 1368 <dd class="col-xs-6"> 1369 @renderCloneFieldForSearch(productClone,searchPageID,productCategory,productReactivity,"Detail") 1370 </dd> 1371 } 1372 1373 @if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.Specificity.Value"))) 1374 { 1375 <dt class="col-xs-6"> 1376 <b>@product.GetString("Ecom:Product:Field.Specificity.Name")</b> 1377 </dt> 1378 <dd class="col-xs-6"> 1379 @product.GetString("Ecom:Product:Field.Specificity.Value") 1380 </dd> 1381 } 1382 1383 @if(!string.IsNullOrWhiteSpace(productReactivity)) 1384 { 1385 <dt class="col-xs-6"> 1386 <b>@product.GetString("Ecom:Product:Field.Reactivity.Name")</b> 1387 </dt> 1388 <dd class="col-xs-6"> 1389 @productReactivity 1390 </dd> 1391 } 1392 1393 @if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.AppAbrv.Value"))) 1394 { 1395 <dt class="col-xs-6"> 1396 <b>@product.GetString("Ecom:Product:Field.Applications.Name")</b> 1397 </dt> 1398 <dd class="col-xs-6"> 1399 <a href="@LocalizeLinksHTML("dwcountry/abbreviations")" target="_blank" title='@Translate("ViewAbbreviationDescriptions","View abbreviation descriptions")'> 1400 @GetApplicationsLabel(product.GetString("Ecom:Product:Field.AppAbrv.Value"), applicationsData) 1401 </a> 1402 </dd> 1403 } 1404 1405 @if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"))) 1406 { 1407 <dt class="col-xs-6"> 1408 <b>@product.GetString("Ecom:Product:Field.RegulatoryStatus.Name")</b> 1409 </dt> 1410 <dd class="col-xs-6"> 1411 @product.GetString("Ecom:Product:Field.RegulatoryStatus.Value") 1412 </dd> 1413 } 1414 1415 @{ 1416 string pattern = @"\<[^>]*\>"; 1417 Regex rgx = new Regex(pattern); 1418 string otherNamesValue = rgx.Replace(product.GetString("Ecom:Product:Field.OtherNames.Value"), String.Empty); 1419 } 1420 @if (!String.IsNullOrWhiteSpace(otherNamesValue)) 1421 { 1422 <dt class="col-xs-6"> 1423 <b>@product.GetString("Ecom:Product:Field.OtherNames.Name")</b> 1424 </dt> 1425 <dd class="col-xs-6"> 1426 @product.GetString("Ecom:Product:Field.OtherNames.Value") 1427 </dd> 1428 } 1429 1430 @if(product.GetInteger("Ecom:Product.Rating") > 0) 1431 { 1432 <dt class="col-xs-6"> 1433 <b>@Translate("rating","Rating")</b> 1434 </dt> 1435 <dd class="col-xs-6"> 1436 <ul class="rating"> 1437 @for(int s=5;s>0;s--){ 1438 if(s == Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))){ 1439 str_starClass = "class='star'"; 1440 str_halfStar = !(product.GetDouble("Ecom:Product.Rating") - Math.Round(product.GetDouble("Ecom:Product.Rating")) == 0) ? "fa-star-half" : "fa-star" ; 1441 }else if(s > Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))){ 1442 str_halfStar = "fa-star"; 1443 }else 1444 { 1445 str_starClass = ""; 1446 str_halfStar = "fa-star"; 1447 } 1448 1449 <li data-star="@s" @str_starClass><i class="fa @str_halfStar"></i></li> 1450 } 1451 </ul> 1452 </dd> 1453 } 1454 1455 </dl> 1456 </div> 1457 } 1458 1459 <div class="col-xs-5 noPadding"> 1460 @if(previousElement != str_productID) 1461 { 1462 1463 string catNoLen = "col-xs-2"; 1464 if(longLang.Equals("ja-JP")){ 1465 catNoLen = "col-xs-4"; 1466 } 1467 else if(cartDisabled){ 1468 catNoLen = "col-xs-4"; 1469 } 1470 else{ 1471 catNoLen = "col-xs-2"; 1472 } 1473 1474 <ul> 1475 <li> 1476 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1477 1478 <input type="hidden" name="redirect" value="false"/> 1479 <input type="hidden" name="cartcmd" value="add"/> 1480 <input type="hidden" name="productid" value="@str_productID"/> 1481 <input type="hidden" name="variantID" value="@str_productVariantID" /> 1482 @if(!string.IsNullOrWhiteSpace(orderContext)) 1483 { 1484 <input type="hidden" name="OrderContext" value="@orderContext" /> 1485 } 1486 1487 <div class="@catNoLen noPadding paddingT40"> 1488 @if(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")){ 1489 <text>&nbsp;</text> 1490 } 1491 else { 1492 if (!isComingSoon) 1493 { 1494 @product.GetString("Ecom:Product.Number") 1495 } 1496 else 1497 { 1498 @Translate("comingSoon", "Coming Soon") 1499 } 1500 } 1501 </div> 1502 1503 <div class="col-xs-2 noPadding"> 1504 <span class="title"><b>@Translate("size","Size")</b></span> 1505 @product.GetString("Ecom:Product.VariantText") 1506 </div> 1507 1508 <div class="col-xs-2 noPadding"> 1509 <span class="title" data-lang="@longLang" data-format="@str_productFormat" data-variant="@str_productVariantID" ><b>@Translate("price","Price")</b></span> 1510 @if(longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1511 { 1512 @Translate("PleaseContactUs","Please Contact Us") 1513 } 1514 else if(longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")){ 1515 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"))</span> 1516 } 1517 else if(requestQuote){ 1518 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1519 } 1520 else if(longLang.Equals("ja-JP") && blockAddToCart){ 1521 <div><p class="coming-soon">@blockAddToCartText</p></div> 1522 } 1523 else if(str_productID.Equals("10801") && !longLang.Equals("en-US")) 1524 { 1525 @Translate("addToCartForPrice","Add to cart for price.") 1526 } 1527 else if(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")){} 1528 else if(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")){} 1529 else 1530 { 1531 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"))</span> 1532 } 1533 </div> 1534 1535 @if(!cartDisabled && !(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) && !(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD") )) 1536 { 1537 <div class="col-xs-2 noPaddingRight"> 1538 <span class="title"><b>@Translate("quantityVariant","Quantity")</b></span> 1539 @if (!productVariantStatus.Equals(3) && !isComingSoon && !blockAddToCart) 1540 { 1541 <input data-reservedStock='@product.GetString("Ecom:Product.AvailableAmount")' data-productStatus="@productStatus" data-stockControl='@stockControl.ToLower()' data-stocktranslate='@Translate("currentStock","The current stock is")' data-stock='@( navEnvironment.Equals("US") ? stockUS : stockUK)' type="text" name="quantity" value="1" /> 1542 } 1543 </div> 1544 1545 <div class="col-xs-4 addCartButtonArea"> 1546 @if(blockAddToCart) { 1547 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"><i class="fa fa-times-circle"></i></button> 1548 } else { 1549 if(str_productName.Contains("Capture Bead") || (str_productName.Contains("LEGENDplex") && (str_productName.Contains("Standard") || str_productName.Contains("Detection Antibodies") || str_productName.Contains("Detection Abs") || str_productName.Contains("Buffer Set")))) 1550 { 1551 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch","Mix & Match")"><i class="fa fa-shopping-cart"></i></button> 1552 } 1553 else if(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")){ 1554 1555 } 1556 else if(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")){ 1557 1558 } 1559 else{ 1560 if (isComingSoon) 1561 { 1562 @:&nbsp; 1563 } 1564 else if(userCurrency != siteCurrency){ 1565 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch","Your currency does not match the websites currency. Please navigate to the proper page."))"> 1566 <button type="submit" disabled><i class="fa fa-shopping-cart"></i></button> 1567 </span> 1568 } 1569 else if(string.IsNullOrWhiteSpace(productSource)){ 1570 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable","This product is not currently available."))"> 1571 <button type="submit" disabled><i class="fa fa-shopping-cart"></i></button> 1572 </span> 1573 } 1574 else 1575 { 1576 <button type="submit"><i class="fa fa-shopping-cart"></i></button> 1577 } 1578 } 1579 } 1580 </div> 1581 } 1582 </form> 1583 </li> 1584 @RenderSnippet("catalogVariants"+@str_productID) 1585 </ul> 1586 @SnippetStart("catalogVariants"+@str_productID) @SnippetEnd("catalogVariants"+@str_productID) 1587 1588 if(lst_images.Any()) 1589 { 1590 <div class="productDataImage col-xs-12 noPadding"> 1591 <h3>Product Data</h3> 1592 <ul class="col-xs-12 noPadding"> 1593 @if(!string.IsNullOrWhiteSpace(str_productImage)) 1594 { 1595 <li> 1596 <figure> 1597 <img class="img-responsive" src="@str_productGetImage" alt="@str_image1Title" title="@str_image1Title" /> 1598 </figure> 1599 </li> 1600 } 1601 1602 @if(!string.IsNullOrWhiteSpace(str_productImageMedium)) 1603 { 1604 <li> 1605 <figure> 1606 <img class="img-responsive" src="@str_productGetImageMedium" alt="@str_image2Title" title="@str_image2Title" /> 1607 </figure> 1608 </li> 1609 } 1610 1611 @if(!string.IsNullOrWhiteSpace(str_productImageLarge)) 1612 { 1613 <li> 1614 <figure> 1615 <img class="img-responsive" src="@str_productGetImageLarge" alt="@str_image3Title" title="@str_image3Title" /> 1616 </figure> 1617 </li> 1618 } 1619 1620 @if(!string.IsNullOrWhiteSpace(str_productImage4)) 1621 { 1622 <li> 1623 <figure> 1624 <img class="img-responsive" src="@str_productGetImage4" alt="@str_image4Title" title="@str_image4Title" /> 1625 </figure> 1626 </li> 1627 } 1628 1629 @if(!string.IsNullOrWhiteSpace(str_productImage5)) 1630 { 1631 <li> 1632 <figure> 1633 <img class="img-responsive" src="@str_productGetImage5" alt="@str_image5Title" title="@str_image5Title" /> 1634 </figure> 1635 </li> 1636 } 1637 1638 @if(!string.IsNullOrWhiteSpace(str_productImage6)) 1639 { 1640 <li> 1641 <figure> 1642 <img class="img-responsive" src="@str_productGetImage6" alt="@str_image6Title" title="@str_image6Title" /> 1643 </figure> 1644 </li> 1645 } 1646 1647 </ul> 1648 </div> 1649 } 1650 } 1651 else{ 1652 1653 @SnippetStart("catalogVariants"+@str_productID) 1654 string catNoLen = "col-xs-2"; 1655 if(longLang.Equals("ja-JP")){ 1656 catNoLen = "col-xs-4"; 1657 } 1658 else if(cartDisabled){ 1659 catNoLen = "col-xs-4"; 1660 } 1661 else{ 1662 catNoLen = "col-xs-2"; 1663 } 1664 1665 <li> 1666 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1667 1668 <input type="hidden" name="redirect" value="false"/> 1669 <input type="hidden" name="cartcmd" value="add"/> 1670 <input type="hidden" name="productid" value="@str_productID"/> 1671 <input type="hidden" name="variantID" value="@str_productVariantID" /> 1672 @if(!string.IsNullOrWhiteSpace(orderContext)) 1673 { 1674 <input type="hidden" name="OrderContext" value="@orderContext" /> 1675 } 1676 1677 <div class="@catNoLen noPadding"> 1678 @if (!isComingSoon) 1679 { 1680 @product.GetString("Ecom:Product.Number") 1681 } 1682 else 1683 { 1684 @Translate("comingSoon", "Coming Soon") 1685 } 1686 </div> 1687 1688 <div class="col-xs-2 noPadding"> 1689 @* str_productVariantName *@ 1690 @product.GetString("Ecom:Product.VariantText") 1691 </div> 1692 1693 <div class="col-xs-2 noPadding"> 1694 @if(longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1695 { 1696 @Translate("PleaseContactUs","Please Contact Us") 1697 } 1698 else if(longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")){ 1699 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"))</span> 1700 } 1701 else if(requestQuote){ 1702 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1703 } 1704 else if(longLang.Equals("ja-JP") && blockAddToCart){ 1705 <div><p class="coming-soon">@blockAddToCartText</p></div> 1706 } 1707 else if(str_productID.Equals("10801") && !longLang.Equals("en-US")) 1708 { 1709 @Translate("addToCartForPrice","Add to cart for price.") 1710 } 1711 else{ 1712 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"))</span> 1713 } 1714 </div> 1715 1716 @if(!cartDisabled) 1717 { 1718 <div class="col-xs-2 noPaddingRight"> 1719 @if (!productVariantStatus.Equals(3) && !isComingSoon && string.IsNullOrEmpty(DCSoon) && !blockAddToCart) 1720 { 1721 <input data-reservedStock='@product.GetString("Ecom:Product.AvailableAmount")' data-productStatus="@productStatus" data-stockControl='@stockControl.ToLower()' data-stocktranslate='@Translate("currentStock","The current stock is")' data-stock='@( navEnvironment.Equals("US") ? stockUS : stockUK)' type="text" name="quantity" value="1" /> 1722 } 1723 </div> 1724 1725 <div class="col-xs-4"> 1726 @if(blockAddToCart) { 1727 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"><i class="fa fa-times-circle"></i></button> 1728 } else { 1729 if(str_productName.Contains("Capture Bead") || (str_productName.Contains("LEGENDplex") && (str_productName.Contains("Standard") || str_productName.Contains("Detection Antibodies") || str_productName.Contains("Detection Abs") || str_productName.Contains("Buffer Set")))) 1730 { 1731 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch","Mix & Match")"><i class="fa fa-shopping-cart"></i></button> 1732 } 1733 else if(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")){ 1734 1735 } 1736 else if(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")){ 1737 1738 } 1739 else{ 1740 if (isComingSoon) 1741 { 1742 @:&nbsp; 1743 } 1744 else if(userCurrency != siteCurrency){ 1745 <span class="inputSubmit" data-toggle="tooltip" title="Invalid currency"> 1746 <button type="submit" disabled><i class="fa fa-shopping-cart"></i></button> 1747 </span> 1748 } 1749 else if(string.IsNullOrWhiteSpace(productSource)){ 1750 <span class="inputSubmit" data-toggle="tooltip" title="This product is not currently available."> 1751 <button type="submit" disabled><i class="fa fa-shopping-cart"></i></button> 1752 </span> 1753 } 1754 else if(bol_userLogged) 1755 { 1756 <button type="submit"><i class="fa fa-shopping-cart"></i></button> 1757 } 1758 else 1759 { 1760 <button type="submit" data-guestWarningPart2='@Translate("guestLimitedFeatures","shopping cart items can only be printed, downloaded or emailed.")' data-guestWarning='@Translate("guestMayContinue","You may continue as a Guest with limited features")' data-continueAsGuest='@Translate("continueAsGuest", "Continue as a Guest")' data-error='@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.")' class="addToCart promptLogin"><i class="fa fa-shopping-cart"></i></button> 1761 } 1762 } 1763 } 1764 </div> 1765 } 1766 </form> 1767 </li> 1768 1769 @SnippetEnd("catalogVariants"+@str_productID) 1770 1771 } 1772 </div> 1773 </div> 1774 1775 previousElement = group.Key; 1776 if(itemsCount == prodLoop.Count()) { 1777 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 1778 } 1779 } 1780 </li> 1781 } 1782 </ul> 1783 1784 1785 @{ 1786 int totalproductCount = GetInteger("Ecom:ProductList.PageProdCnt"); 1787 string tooManyResults = Translate("tooManyResults","Your search returned too many results. Please refine your search"); 1788 } 1789 <div class="pageBottom col-xs-3 noPadding"> 1790 <form id="bottom_pageSizeProdList" class="" action="/Default.aspx" name="ExtUserForm_Main" method="GET"> 1791 @if(!string.IsNullOrEmpty(requestParams["adv1"])){ 1792 <div class="advFields"> 1793 @for(var adv = 1; adv < 12; adv++){ 1794 @hiddenField("adv" + adv, !string.IsNullOrEmpty(requestParams["adv" + adv]) ? requestParams["adv" + adv] : "") 1795 } 1796 </div> 1797 } 1798 <fieldset> 1799 <label>@Translate("Results Per Page"):</label> 1800 <select name="PageSize"> 1801 <option selected="@(str_pageSize == "25" || str_pageSize == "")" value="25">25</option> 1802 <option selected="@(str_pageSize == "50")" value="50">50</option> 1803 <option selected="@(str_pageSize == "100")" value="100">100</option> 1804 <option selected="@(str_pageSize == "200" || str_pageSize == "1")" value="200">200</option> 1805 </select> 1806 </fieldset> 1807 </form> 1808 </div> 1809 1810 @if(num_totalPages > 1) 1811 { 1812 string getGlobalRequest = GetGlobalValue("Global:Request.Url"); 1813 1814 <ul class="pagination pageBottom pull-right col-xs-5"> 1815 @if(!string.IsNullOrWhiteSpace(prevPageClean)) 1816 { 1817 <li class="previous"><a href='@prevPageClean'><i class="fa fa-angle-left"></i> @Translate("Previous")</a></li> 1818 } 1819 1820 @if(num_curPage > 2 && num_totalPages > 3){ 1821 for(int i=1;i <= 1;i++){ 1822 string str_active = num_curPage == i ? "class=\"active\"" : ""; 1823 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum="+num_curPage, "PageNum=" + i ) : getGlobalRequest + "&PageNum=" + i; 1824 <li @str_active><a href="@str_pagingHref">@i</a></li> 1825 } 1826 if(num_totalPages > 4 && num_curPage != 3 ) { 1827 <li class="etc"><span>...</span></li> 1828 } 1829 } 1830 1831 @foreach (LoopItem i in loop_productList3) 1832 { 1833 if(i.GetBoolean("Ecom:ProductList.Pages3.Page.IsCurrent")) 1834 { 1835 <li class="active"><a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a></li> 1836 } 1837 else 1838 { 1839 <li><a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a></li> 1840 } 1841 } 1842 @if(num_curPage < num_totalPages-1 && num_totalPages > 3){ 1843 if(num_totalPages > 4) { 1844 <li class="etc"><span>...</span></li> 1845 } 1846 for(int i=num_totalPages;i <= num_totalPages;i++){ 1847 string str_active = num_curPage == i ? "class=\"active\"" : ""; 1848 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum="+num_curPage, "PageNum="+i) : getGlobalRequest + "&PageNum=" + i; 1849 <li @str_active><a href="@str_pagingHref">@i</a></li> 1850 } 1851 } 1852 @if(!string.IsNullOrWhiteSpace(nextPageClean)) 1853 { 1854 <li class="next"><a href='@nextPageClean'>@Translate("Next") <i class="fa fa-angle-right"></i></a></li> 1855 } 1856 </ul> 1857 } 1858 1859 </div> 1860 1861 @functions { 1862 public static string StripHtml(string source) 1863 { 1864 return Regex.Replace(source, "<.*?>", string.Empty); 1865 } 1866 } 1867 1868 @SnippetStart("jsOnLoad") 1869 @: onLoadProductList(); 1870 @SnippetEnd("jsOnLoad") 1871 1872 } 1873 } 1874 else{ 1875 var countProductDiscountinued = 0; 1876 var productDetailPage = item["ProductDetail"].ToString(); 1877 string liveSearchPage = item["LiveSearchPage"].ToString(); 1878 string advancedSearchLink = LocalizeLinks("/dwcountry/advanced-search"); 1879 1880 // If product is discountinued send to PDP 1881 if(!string.IsNullOrWhiteSpace(str_keywordsParam)) 1882 { 1883 string productDiscountinued = GetDiscountinuedProductId(str_keywordsParam); 1884 if(!string.IsNullOrEmpty(productDiscountinued)) 1885 { 1886 string urlRedirect = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID="+@productDetailPage+"&ProductID="+productDiscountinued); 1887 BioLegend.Shared.WebUtility.Redirect(urlRedirect); 1888 } 1889 1890 } 1891 1892 <div id="listContainer"> 1893 @if(HttpContext.Current.Request.Params["p1"] != null || String.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["Keywords"])){ 1894 <h2>@Translate("noProductsFoundProductSearch","There are no products that match your term.")</h2> 1895 <div>@Translate("modifyYourSearch") <a href="@advancedSearchLink">@Translate("Advanced Search")</a> @Translate("modifyYourSearchB")</div> 1896 <div>@LocalizeLinks(Translate("contactCustomSolutionsTeamSearch"))<br /><hr /></div> 1897 1898 <div id="contentResults"></div> 1899 @SnippetStart("jsOnLoad") 1900 @: onLoadContentSearchItems('@System.Web.HttpContext.Current.Request.Params["Keywords"]'); 1901 @SnippetEnd("jsOnLoad") 1902 1903 } 1904 else { 1905 @SnippetStart("jsOnLoad") 1906 @: onLoadPartialSearch("@SearchForPartialTerms(Pageview.Page.ID)", '@Translate("performePartialSearch","Performing partial match search..")'); 1907 @SnippetEnd("jsOnLoad") 1908 1909 } 1910 </div> 1911 1912 @functions { 1913 public static string SearchForPartialTerms(int pageID) { 1914 string allQuery = HttpContext.Current.Request.QueryString.ToString(); 1915 1916 for(var i = 1; i <= 12; i++){ 1917 if(!allQuery.Contains("k"+i+"=")){ 1918 break; 1919 } 1920 allQuery = allQuery.Replace(("k"+i+"="), ("p"+i+"=")); 1921 } 1922 1923 allQuery = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?" + allQuery); 1924 1925 return allQuery; 1926 } 1927 1928 public static string GetDiscountinuedProductId(string str_keywordsParam) 1929 { 1930 string productId = string.Empty; 1931 1932 using (var connection = Dynamicweb.Data.Database.CreateConnection()) 1933 { 1934 using (var command = connection.CreateCommand()) 1935 { 1936 command.CommandText = "SELECT ProductID FROM EcomProducts WHERE ProductNumber = ''+@str_keywordsParam+'' and ProductStatus = '1'"; 1937 command.Parameters.Add(new System.Data.SqlClient.SqlParameter() 1938 { 1939 ParameterName = "str_keywordsParam", 1940 SqlDbType = System.Data.SqlDbType.NVarChar, 1941 Value = str_keywordsParam 1942 }); 1943 1944 using (var reader = command.ExecuteReader()) 1945 { 1946 if (reader != null) 1947 { 1948 while (reader.Read()) 1949 { 1950 productId = reader["ProductID"].ToString(); 1951 } 1952 } 1953 } 1954 } 1955 } 1956 1957 return productId; 1958 } 1959 } 1960 } 1961
ProductsHere

Login/Register
Remember me
Forgot your password? Reset Password
Request an Account