Search Results

Error executing template "Designs/BioLegend/eCom/Productlist/productList_v2.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_7bf3ce517afb4c1b9a36ef7e7e0064e5.<>c__DisplayClass9_0.<RenderSelectedFacetOptionUrl>b__0(TextWriter __razor_helper_writer) in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_v2.cshtml:line 237
   at RazorEngine.Templating.TemplateWriter.ToString()
   at RazorEngine.Templating.TemplateBase.WriteAttributeTo(TextWriter writer, String name, PositionTagged`1 prefix, PositionTagged`1 suffix, AttributeValue[] values)
   at CompiledRazorTemplates.Dynamic.RazorEngine_7bf3ce517afb4c1b9a36ef7e7e0064e5.<>c__DisplayClass8_0.<RenderSelectedFacetOption>b__0(TextWriter __razor_helper_writer) in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_v2.cshtml:line 223
   at CompiledRazorTemplates.Dynamic.RazorEngine_7bf3ce517afb4c1b9a36ef7e7e0064e5.<RenderSelectedFilters>b__7_0(TextWriter __razor_helper_writer) in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_v2.cshtml:line 205
   at CompiledRazorTemplates.Dynamic.RazorEngine_7bf3ce517afb4c1b9a36ef7e7e0064e5.Execute() in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_v2.cshtml:line 2325
   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 System.Collections.Generic 4 @using Dynamicweb.Rendering; 5 @using System.Linq; 6 @using System.Web 7 8 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 9 @using System 10 @using System.Collections.Generic 11 @using System.Linq 12 @using System.Net.Http 13 @using Dynamicweb 14 15 @helper RenderProductListViewSelector() 16 { 17 //var listView = Context.Current.Request.Cookies["dataList"] != null ? Context.Current.Request.Cookies["dataList"].Value : ""; 18 //listView = Context.Current.Request.Params["altView"] != null ? (Context.Current.Request.Params["altView"] == "detail" ? "detailedView" : "") : listView; 19 var listView = HttpContext.Current.Request.Cookies["dataList"] != null ? HttpContext.Current.Request.Cookies["dataList"].Value : "list"; 20 21 var str_keywordsParam = Context.Current.Request.Params["Keywords"] ?? ""; 22 var contentSearchPage = Pageview.Area.Item["ContentSearchPage"]; 23 24 <div class='col-xs-12 noPadding'> 25 <div class="pull-left noPadding" id="moreInfo"> 26 <a class='btn-primary default @(listView.Equals("list") ? "active" : "")' href="javascript:changeView('list');">@Translate("listView", "List View")</a> 27 <a class='btn-primary @(listView.Equals("detail") ? "active" : "")' href="javascript:changeView('detail');">@Translate("detailView", "Detail View")</a> 28 @if (!string.IsNullOrWhiteSpace(str_keywordsParam)) 29 { 30 <a class='btn-primary' id="searchForContent" onClick="searchForContent();" data-searchpageID="@contentSearchPage">@Translate("contentPagesBTNText", "Find Content Pages")</a> 31 } 32 </div> 33 <div class="noPadding"> 34 <hr id="searchButtonDivider"/> 35 </div> 36 </div> 37 } 38 39 @helper RenderDidYouMean() 40 { 41 var pageId = Pageview.Page.ID.ToString(); 42 var firstSuggestion = GetString("QueryResult.SpellCheck"); 43 @*var parameterToSpellCheck = Services.Paragraphs.GetParagraph(Pageview.CurrentParagraph.ID).ModuleProperties.GetValue("ParameterToSpellCheck"); 44 var freeTextSearchParameter = string.IsNullOrWhiteSpace(parameterToSpellCheck) ? parameterToSpellCheck : "Keywords";*@ 45 var freeTextSearchParameter = "Keywords"; 46 47 if (!string.IsNullOrWhiteSpace(firstSuggestion)) 48 { 49 <div class="row"> 50 <div class="col-md-12"> 51 Did you mean: 52 @foreach (var suggestion in GetLoop("SpellCheckerSuggestions")) 53 { 54 var suggestionTerm = suggestion.GetString("Suggestion"); 55 <a href="Default.aspx?ID=@pageId&@freeTextSearchParameter=@suggestionTerm" style="margin-right:5px; font-size: 12px !important">@suggestionTerm</a> 56 } 57 </div> 58 </div> 59 } 60 } 61 62 @helper RenderProductGroupDescription() 63 { 64 var groupDescription = GetString("Ecom:Group.Description"); 65 if (!string.IsNullOrWhiteSpace(groupDescription)) 66 { 67 <div id="groupDescription" class="col-xs-12 noPadding"> 68 @groupDescription 69 </div> 70 } 71 } 72 73 @helper RenderSearchResultsNumbers(List<LoopItem> loopProduct) 74 { 75 var loopProductCount = loopProduct.Count; 76 var totalProductCount = GetInteger("Ecom:ProductList.PageProdCnt"); 77 var startLoopProductCount = (loopProductCount * (GetInteger("Ecom:ProductList.CurrentPage") - 1)) + 1; 78 var endLoopProductCount = loopProductCount * GetInteger("Ecom:ProductList.CurrentPage"); 79 80 if (loopProductCount < GetInteger("Ecom:ProductList.PageSize")) 81 { 82 startLoopProductCount = (GetInteger("Ecom:ProductList.PageSize") * (GetInteger("Ecom:ProductList.CurrentPage") - 1)) + 1; 83 endLoopProductCount = totalProductCount; 84 } 85 86 <span class="productListResume col-xs-3 noPadding"> 87 @Translate("productListCount", "{{numberProducts}} of {{countAllProducts}} items").Replace("{{numberProducts}}", String.Format("{0}-{1}", startLoopProductCount, endLoopProductCount)).Replace("{{countAllProducts}}", totalProductCount.ToString()) 88 </span> 89 } 90 91 @helper RenderResultPerPageOption() 92 { 93 var str_pageSize = Context.Current.Request.Params["PageSize"] ?? "25"; 94 95 <div class="pageBottom col-xs-3 noPadding"> 96 <form id="bottom_pageSizeProdList" class="" action="/Default.aspx" name="ExtUserForm_Main" method="GET"> 97 <fieldset> 98 <label>@Translate("Results Per Page"):</label> 99 <select name="PageSize"> 100 @RenderResultsPerPageOption("25","25", true) 101 @RenderResultsPerPageOption("50","50") 102 @RenderResultsPerPageOption("100","100") 103 @RenderResultsPerPageOption("200","200") 104 </select> 105 </fieldset> 106 </form> 107 </div> 108 } 109 110 @helper RenderResultsPerPageOption(string sorByLabel, string sortByValue, bool isDefault = false) 111 { 112 var str_pageSize = Context.Current.Request.Params["PageSize"] ?? "25"; 113 var isSelected = ((str_pageSize == sortByValue) || (isDefault && str_pageSize == "")) ? "selected=\"selected\"" : ""; 114 115 <option @isSelected value="@sortByValue">@sorByLabel</option> 116 } 117 118 @helper RenderPagination(string cssClass = "") 119 { 120 var num_totalPages = GetInteger("Ecom:ProductList.TotalPages"); 121 var num_curPage = Context.Current.Request.Params["PageNum"] != null ? Convert.ToInt32(Context.Current.Request.Params["PageNum"]) : 1; 122 var prevPageClean = GetString("Ecom:ProductList.PrevPage.Clean"); 123 var nextPageClean = GetString("Ecom:ProductList.NextPage.Clean"); 124 var str_pagingHref = ""; 125 126 if (num_totalPages > 1) 127 { 128 var loop_productList3 = GetLoop("Ecom:ProductList.Pages3"); 129 var getGlobalRequest = GetGlobalValue("Global:Request.Url"); 130 131 <ul class="pagination @cssClass"> 132 @if (!string.IsNullOrWhiteSpace(prevPageClean)) 133 { 134 <li class="previous"> 135 <a href='@prevPageClean'> 136 <i class="fa fa-angle-left"></i> @Translate("Previous") 137 </a> 138 </li> 139 } 140 141 @if (num_curPage > 2 && num_totalPages > 3) 142 { 143 for (var i = 1; i <= 1; i++) 144 { 145 var str_active = num_curPage == i ? "class=\"active\"" : ""; 146 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum=" + num_curPage, "PageNum=" + i) : getGlobalRequest + "&PageNum=" + i; 147 <li @str_active> 148 <a href="@str_pagingHref">@i</a> 149 </li> 150 } 151 if (num_totalPages > 4 && num_curPage != 3) 152 { 153 <li class="etc"> 154 <span>...</span> 155 </li> 156 } 157 } 158 @foreach (var i in loop_productList3) 159 { 160 if (i.GetBoolean("Ecom:ProductList.Pages3.Page.IsCurrent")) 161 { 162 <li class="active"> 163 <a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a> 164 </li> 165 } 166 else 167 { 168 <li> 169 <a href="@i.GetString("Ecom:ProductList.Pages3.Page.UrlHtmlEncoded")">@i.GetString("Ecom:ProductList.Pages3.Page.Number")</a> 170 </li> 171 } 172 } 173 @if (num_curPage < num_totalPages - 1 && num_totalPages > 3) 174 { 175 if (num_totalPages > 4) 176 { 177 <li class="etc"> 178 <span>...</span> 179 </li> 180 } 181 for (var i = num_totalPages; i <= num_totalPages; i++) 182 { 183 var str_active = num_curPage == i ? "class=\"active\"" : ""; 184 str_pagingHref = getGlobalRequest.Contains("PageNum") ? getGlobalRequest.Replace("PageNum=" + num_curPage, "PageNum=" + i) : getGlobalRequest + "&PageNum=" + i; 185 <li @str_active> 186 <a href="@str_pagingHref">@i</a> 187 </li> 188 } 189 } 190 @if (!string.IsNullOrWhiteSpace(nextPageClean)) 191 { 192 <li class="next"> 193 <a href='@nextPageClean'> 194 @Translate("Next") <i class="fa fa-angle-right"></i> 195 </a> 196 </li> 197 } 198 </ul> 199 } 200 } 201 202 @helper RenderSelectedFilters() 203 { 204 <div class="col-xs-12"> 205 @RenderSelectedFacetOption("Keywords") 206 207 @foreach (var group in GetLoop("FacetGroups")) 208 { 209 foreach (var facet in group.GetLoop("Facets")) 210 { 211 @RenderSelectedFacetOption(facet.GetString("Facet.QueryParameter"), facet) 212 } 213 } 214 </div> 215 } 216 217 @helper RenderSelectedFacetOption(string parameterName, LoopItem facet = null) 218 { 219 var parameterValue = Context.Current.Request.Params[parameterName] ?? ""; 220 221 if (!string.IsNullOrEmpty(parameterValue)) 222 { 223 @RenderSelectedFacetOptionName(parameterValue, facet) 224 <a href="@RenderSelectedFacetOptionUrl(parameterName)"> 225 <i class="fa fa-times-circle"></i> 226 </a> 227 <text>/</text> 228 } 229 } 230 231 @helper RenderSelectedFacetOptionUrl(string parameterName) 232 { 233 var keywordLessUrl = "/Default.aspx?"; 234 var currentUrlQueryString = Dynamicweb.Context.Current.Request.QueryString; 235 236 foreach (string key in currentUrlQueryString) { 237 if (!key.Equals(parameterName, StringComparison.InvariantCultureIgnoreCase)) 238 { 239 var value = currentUrlQueryString[key]; 240 keywordLessUrl += key + "=" + value + "&"; 241 } 242 } 243 244 @keywordLessUrl.TrimEnd('&'); 245 } 246 247 @helper RenderSelectedFacetOptionName(string parameterValue, LoopItem facet = null) 248 { 249 var facetOptionName = parameterValue; 250 251 if (facet != null) 252 { 253 facetOptionName = string.Empty; 254 foreach (var value in parameterValue.Split(',')) 255 { 256 var facetOption = facet.GetLoop("FacetOptions").FirstOrDefault(x => x.GetString("FacetOption.Value").Equals(value, StringComparison.InvariantCultureIgnoreCase)); 257 if (facetOption != null) 258 { 259 var label = facetOption.GetString("FacetOption.Label"); 260 facetOptionName += (string.IsNullOrEmpty(facetOptionName) ? string.Empty : ", ") + label; 261 } 262 } 263 } 264 265 @facetOptionName 266 } 267 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 268 @using System 269 @using System.Collections.Generic 270 @using System.Linq 271 @using Dynamicweb 272 273 @functions 274 { 275 public Dictionary<string, Dictionary<string, string>> BreadcrumbSource = new Dictionary<string, Dictionary<string, string>>(); 276 277 public bool paramIsSet(string thisParameter){ 278 var requestParams = Context.Current.Request.Params; 279 var paramIsSet = !string.IsNullOrEmpty(requestParams[thisParameter]) ? true : false; 280 return paramIsSet; 281 } 282 } 283 284 @helper RenderFacets() 285 { 286 var str_pageSize = Context.Current.Request.Params["PageSize"] ?? "25"; 287 var str_sortBy = Context.Current.Request.Params["SortBy"] ?? ""; 288 //str_sortBy = str_sortBy.Replace("%2C", ","); 289 290 var loopFacetGroups = GetLoop("FacetGroups"); 291 292 if (loopFacetGroups.Any()) 293 { 294 var requestParams = Context.Current.Request.Params; 295 var str_keywords = !string.IsNullOrEmpty(requestParams["Keywords"]) ? requestParams["Keywords"] : ""; 296 var str_sortOrder = Context.Current.Request.Params["SortOrder"] ?? ""; 297 var str_paramGroupID = Context.Current.Request.Params["groupid"] ?? ""; 298 var str_GeneIDParam = Context.Current.Request.Params["GeneID"] ?? ""; 299 var DateReleasedMin = !string.IsNullOrEmpty(requestParams["DateReleasedMin"]) ? requestParams["DateReleasedMin"] : ""; 300 var DateReleasedMax = !string.IsNullOrEmpty(requestParams["DateReleasedMax"]) ? requestParams["DateReleasedMax"] : ""; 301 var view = !string.IsNullOrEmpty(requestParams["altView"]) ? requestParams["altView"] : ""; 302 var lst_parameters = GetLoop("Query.Parameters"); 303 var bol_noResults = false; 304 305 <div class="col-xs-2 noPadding"> 306 307 <div class="headerBox filtersHead col-xs-12 noPadding"> 308 <span class="title">@Translate("filterYourResults", "Filter your results")</span> 309 </div> 310 311 <form id="filtersForm" action="/Default.aspx" class="col-xs-12 noPaddingLeft productSearchFilters"> 312 <input type="hidden" name="ID" value="@Pageview.Page.ID"/> 313 <input type="hidden" name="PageSize" value="@str_pageSize"/> 314 <input type="hidden" name="SortBy" value="@str_sortBy"/> 315 316 @RenderHiddenField("Keywords", str_keywords) 317 @RenderHiddenField("sortOrder", str_sortOrder) 318 @RenderHiddenField("GroupID", str_paramGroupID) 319 @RenderHiddenField("GeneID", str_GeneIDParam) 320 @RenderHiddenField("DateReleasedMin", DateReleasedMin) 321 @RenderHiddenField("DateReleasedMax", DateReleasedMax) 322 323 <input type="hidden" name="altView" value="@view"/> 324 325 @if (Pageview.Area.Item["ExploreNewProducts"].ToString() == Pageview.Page.ID.ToString()) 326 { 327 var currentMonth = DateTime.Today.ToString("MM"); 328 var monthParameter = requestParams["month"] != null ? requestParams["month"] : ""; 329 330 <fieldset> 331 <label>@Translate("Month", "Month")</label> 332 <div class="filtersContainer"> 333 <label class="radioBoxContainer" for="@currentMonth"> 334 <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> 335 </label> 336 </div> 337 @for (var i = 1; i < 6; i++) 338 { 339 var month = DateTime.Today.AddMonths(-i).ToString("MMMM"); 340 var monthNumeric = DateTime.Today.AddMonths(-i).ToString("MM"); 341 <div class="filtersContainer"> 342 <label class="radioBoxContainer" for="@month"> 343 <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"> 344 <span>@month</span> 345 </label> 346 </div> 347 } 348 </fieldset> 349 } 350 351 @foreach (var facetGroup in loopFacetGroups) 352 { 353 foreach (var facet in facetGroup.GetLoop("Facets")) 354 { 355 var str_parameterType = lst_parameters.Where(x => x.GetString("Parameter.Name") == facet.GetString("Facet.QueryParameter")).FirstOrDefault().GetString("Parameter.Type"); 356 if (facet.GetString("Facet.RenderType") == "Checkboxes") 357 { 358 @RenderCheckboxesFacet(facet) 359 } 360 361 else if (str_parameterType.Contains("[]")) 362 { 363 @RenderCheckboxesFacet(facet) 364 } 365 else if (str_parameterType.Contains("Boolean")) 366 { 367 @RenderCheckboxFacet(facet, str_parameterType, bol_noResults) 368 } 369 else if (!string.IsNullOrWhiteSpace(facet.GetString("Facet.OptionCount"))) 370 { 371 @RenderCheckboxesFacet(facet) 372 } 373 else 374 { 375 @RenderFacet(facet, str_parameterType, "text", bol_noResults) 376 } 377 } 378 } 379 </form> 380 </div> 381 } 382 } 383 384 @helper RenderHiddenField(string name, string value) 385 { 386 if (value != "") 387 { 388 <input type="hidden" name="@name" value="@value"/> 389 } 390 } 391 392 @helper RenderCheckboxesFacet(LoopItem facet) 393 { 394 var str_parameter = facet.GetString("Facet.QueryParameter"); 395 var str_name = facet.GetString("Facet.Name"); 396 var facetOptions = facet.GetLoop("FacetOptions"); 397 398 var extraClass = facet.GetString("Facet.QueryParameter").Equals("ExcitationLaser") || facet.GetString("Facet.QueryParameter").Equals("Isotype") ? "noCapitalize" : ""; 399 var inputID = facet.GetString("Facet.QueryParameter") + "Search"; 400 var inputDivID = facet.GetString("Facet.QueryParameter") + "Div"; 401 var facetType = facet.GetString("Facet.Type"); 402 403 var thisParamIsSet = paramIsSet(str_parameter); 404 var hiddenClass= "hide"; 405 var fieldsetIsActive = ""; 406 if(thisParamIsSet){ 407 hiddenClass= ""; 408 fieldsetIsActive = "class=\"active\""; 409 } 410 411 if (facetOptions.Any()) 412 { 413 <fieldset @fieldsetIsActive data-type="@facet.GetString("Facet.QueryParameter.Type")"> 414 <legend class="filterTitle">@str_name</legend> 415 416 <div class="filtersContainer @extraClass @hiddenClass" id="@inputDivID"> 417 @if (facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).Count() > 9) 418 { 419 <div class="searchFilterContainer"> 420 <span class="fa fa-search"></span> 421 <input class="searchFilterSearchBar" id="@inputID" onkeyup="filterSearchFilterOptions('@inputID','@inputDivID');"> 422 </div> 423 } 424 @foreach (var option in facetOptions) 425 { 426 var bol_checked = option.GetBoolean("FacetOption.Selected"); 427 var str_value = option.GetString("FacetOption.Value"); 428 429 <label class="checkBoxContainer"> 430 <input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> 431 <span> 432 @option.GetString("FacetOption.Label") 433 @if (facetType != "Term" && option.GetInteger("FacetOption.Count") > 0) 434 { 435 var counter = string.Format("({0})", option.GetString("FacetOption.Count")); 436 @counter 437 } 438 </span> 439 </label> 440 } 441 </div> 442 </fieldset> 443 } 444 } 445 446 @helper RenderCheckboxFacet(LoopItem i, string str_parameterType, bool bol_noResults) 447 { 448 var str_parameter = i.GetString("Facet.QueryParameter"); 449 var str_name = i.GetString("Facet.Name"); 450 var facetOptions = i.GetLoop("FacetOptions"); 451 452 if (bol_noResults) 453 { 454 facetOptions = facetOptions.OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label")).ToList(); 455 } 456 else 457 { 458 facetOptions = facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderBy(o => o.GetString("FacetOption.Label")).ToList(); 459 } 460 461 <fieldset data-type="@str_parameterType"> 462 @foreach (var option in facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label"))) 463 { 464 var bol_checked = option.GetBoolean("FacetOption.Selected"); 465 var str_value = option.GetString("FacetOption.Value") == "True" ? "True" : ""; 466 467 if (str_value == "True") 468 { 469 <legend class="filterTitle">@str_name</legend> 470 <div class="filtersContainer"> 471 <label class="checkBoxContainer"> 472 <input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> <span>@str_name (@option.GetString("FacetOption.Count"))</span> 473 </label> 474 </div> 475 } 476 } 477 </fieldset> 478 } 479 480 @helper RenderFacet(LoopItem i, string str_parameterType, string str_templateOutput, bool bol_noResults) 481 { 482 var str_parameter = i.GetString("Facet.QueryParameter"); 483 var str_name = i.GetString("Facet.Name"); 484 var facetOptions = i.GetLoop("FacetOptions"); 485 486 if (bol_noResults) 487 { 488 facetOptions = facetOptions.OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label")).ToList(); 489 } 490 else 491 { 492 facetOptions = facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderBy(o => o.GetString("FacetOption.Label")).ToList(); 493 } 494 495 switch (str_templateOutput) 496 { 497 case "multiselect": 498 if (facetOptions.Any()) 499 { 500 <fieldset> 501 <legend>@str_name</legend> 502 <select data-selected-text-format="count" data-live-search="true" data-size="8" name="@str_parameter" multiple> 503 @foreach (var option in facetOptions.OrderByDescending(o => o.GetInteger("FacetOption.Label"))) 504 { 505 var bol_checked = option.GetBoolean("FacetOption.Selected"); 506 var str_value = option.GetString("FacetOption.Value"); 507 508 <option selected="@bol_checked" value="@str_value">@option.GetString("FacetOption.Label")</option> 509 } 510 </select> 511 </fieldset> 512 } 513 514 break; 515 case "checkboxes": 516 var extraClass = i.GetString("Facet.QueryParameter").Equals("ExcitationLaser") || i.GetString("Facet.QueryParameter").Equals("Isotype") ? "noCapitalize" : ""; 517 var inputID = i.GetString("Facet.QueryParameter") + "Search"; 518 var inputDivID = i.GetString("Facet.QueryParameter") + "Div"; 519 var facetType = i.GetString("Facet.Type"); 520 521 if (facetOptions.Any()) 522 { 523 <fieldset data-type="@str_parameterType"> 524 <legend class="filterTitle">@str_name</legend> 525 526 <div class="filtersContainer @extraClass hide" id="@inputDivID"> 527 @if (facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).Count() > 9) 528 { 529 <div class="searchFilterContainer"> 530 <span class="fa fa-search"></span> 531 <input class="searchFilterSearchBar" id="@inputID" onkeyup="filterSearchFilterOptions('@inputID','@inputDivID');"> 532 </div> 533 } 534 @foreach (var option in facetOptions) 535 { 536 var bol_checked = option.GetBoolean("FacetOption.Selected"); 537 var str_value = option.GetString("FacetOption.Value"); 538 if (bol_checked) 539 { 540 var breadcrumbSourceTemp = new Dictionary<string, string>(); 541 var thisFilter = i.GetString("Facet.QueryParameter") + str_value; 542 breadcrumbSourceTemp.Add("val", str_value); 543 breadcrumbSourceTemp.Add("label", option.GetString("FacetOption.Label")); 544 breadcrumbSourceTemp.Add("filter", i.GetString("Facet.QueryParameter")); 545 BreadcrumbSource.Add(thisFilter, breadcrumbSourceTemp); 546 } 547 548 <label class="checkBoxContainer"> 549 <input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> 550 <span> 551 @option.GetString("FacetOption.Label") 552 @if (facetType != "Term" && option.GetInteger("FacetOption.Count") > 0) 553 { 554 var counter = string.Format("({0})", option.GetString("FacetOption.Count")); 555 @counter 556 } 557 </span> 558 </label> 559 } 560 </div> 561 </fieldset> 562 } 563 564 break; 565 case "select": 566 567 break; 568 case "checkbox": 569 570 if (facetOptions.Any()) 571 { 572 <fieldset data-type="@str_parameterType"> 573 @foreach (var option in facetOptions.Where(f => f.GetInteger("FacetOption.Count") != 0).OrderByDescending(o => o.GetInteger("FacetOption.Count")).ThenBy(or => or.GetString("FacetOption.Label"))) 574 { 575 var bol_checked = option.GetBoolean("FacetOption.Selected"); 576 var str_value = option.GetString("FacetOption.Value") == "True" ? "True" : ""; 577 578 if (str_value == "True") 579 { 580 <legend class="filterTitle">@str_name</legend> 581 <div class="filtersContainer"> 582 <label class="checkBoxContainer"> 583 <input checked="@bol_checked" type="checkbox" value="@str_value" name="@str_parameter"> <span>@str_name (@option.GetString("FacetOption.Count"))</span> 584 </label> 585 </div> 586 } 587 } 588 </fieldset> 589 } 590 591 break; 592 case "radio": 593 594 break; 595 case "radios": 596 597 break; 598 case "autocomplete": 599 600 break; 601 default: 602 <fieldset data-type="@str_parameterType"> 603 <legend class="filterTitle">@str_name</legend> 604 <div class="filtersContainer"> 605 <input type="text" name="@str_parameter" value=""/> 606 </div> 607 </fieldset> 608 break; 609 } 610 } 611 612 @helper RenderSortBy() 613 { 614 var str_paramGroupID = Context.Current.Request.Params["groupid"] ?? ""; 615 var str_keywordsParam = Context.Current.Request.Params["Keywords"] ?? ""; 616 var str_GeneIDParam = Context.Current.Request.Params["GeneID"] ?? ""; 617 var str_SpecificityParam = Context.Current.Request.Params["Specificity"] ?? ""; 618 619 const string sortByMatch = "-_score,Clone_Sort,Name_sortable,Price"; 620 const string sortByName = "Name_sortable,Price"; 621 const string sortByClone = "Clone_Sort,Name_sortable,Price"; 622 const string sortByApplication = "CustomField_AppAbrv,Name_sortable,Price"; 623 const string sortByRegulatoryStatus = "CustomField_RegulatoryStatus,Name_sortable,Price"; 624 625 <form id="orderProdList" class="col-xs-3 noPadding" action="/Default.aspx" name="ExtUserForm_Main" method="GET"> 626 @RenderHiddenField("ID", Pageview.Page.ID.ToString()) 627 @RenderHiddenField("GroupID", str_paramGroupID) 628 @RenderHiddenField("Keywords", str_keywordsParam) 629 @RenderHiddenField("GeneID", str_GeneIDParam) 630 @RenderHiddenField("Specificity", str_SpecificityParam) 631 632 <fieldset class="col-xs-12 noPadding" data-groupdID="@str_paramGroupID"> 633 <label>@Translate("Sort by"):</label> 634 <select id="sortSelect" name="SortBy"> 635 @RenderSortByOption(Translate("Match", "Best Match"), sortByMatch, true) 636 @RenderSortByOption(Translate("Name"), sortByName) 637 @RenderSortByOption(@Translate("Clone", "Clone"), sortByClone) 638 @RenderSortByOption(@Translate("Applications", "Applications"), sortByApplication) 639 @RenderSortByOption(@Translate("RegulatoryStatus", "Regulatory Status"), sortByRegulatoryStatus) 640 </select> 641 </fieldset> 642 643 </form> 644 } 645 646 @helper RenderSortByOption(string sorByLabel, string sortByValue, bool isDefault = false) 647 { 648 var str_sortBy = Context.Current.Request.Params["SortBy"] ?? ""; 649 var isSelected = ((str_sortBy == sortByValue) || (isDefault && str_sortBy == "")) ? "selected=\"selected\"" : ""; 650 651 <option @isSelected value="@sortByValue">@sorByLabel</option> 652 } 653 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 654 @using System 655 @using System.Collections 656 @using System.Collections.Generic 657 @using System.Linq 658 @using System.Text.RegularExpressions 659 @using System.Web 660 @using Dynamicweb.Core 661 @using Dynamicweb.Frontend 662 @using Dynamicweb.Security.UserManagement 663 664 @functions{ 665 666 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) 667 { 668 PageView obj_currentPageview = Dynamicweb.Frontend.PageView.Current(); 669 string str_currDevice = obj_currentPageview.Device.ToString(); 670 string str_alternativeImage = obj_currentPageview.Area.Item["NoImage"] != null ? obj_currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/Lorenz/images/alternativeImage.jpg"; 671 672 string str_width = ""; 673 string str_height = ""; 674 int num_getImageWidth = num_width != 0 ? num_width : 0; 675 int num_getImageHeight = num_height != 0 ? num_height : 0; 676 string str_getImageFormat = str_format != "jpg" ? "&amp;Format=" + str_format : ""; 677 string str_getImageCompression = num_compression != 75 ? "&amp;Compression=" + num_compression : ""; 678 679 var cdnImageHandleDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Image_Handler", "Image_Handler_Domain"); //CUSTOM CODE 680 681 if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 682 { 683 num_getImageWidth = num_widthTablet != 0 ? num_widthTablet : num_getImageWidth; 684 num_getImageHeight = num_heightTablet != 0 ? num_heightTablet : num_getImageHeight; 685 } 686 else if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 687 { 688 num_getImageWidth = num_widthMobile != 0 ? num_widthMobile : num_getImageWidth; 689 num_getImageHeight = num_heightMobile != 0 ? num_heightMobile : num_getImageHeight; 690 } 691 692 if (num_getImageWidth != 0) 693 { 694 str_width = "&amp;Width=" + num_getImageWidth; 695 } 696 if (num_getImageHeight != 0) 697 { 698 str_height = "&amp;Height=" + num_getImageHeight; 699 } 700 701 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; 702 return str_output; 703 } 704 705 public Dictionary<string, string> GetProductTypes() 706 { 707 var productTypes = new Dictionary<string, string>(); 708 productTypes.Add("AncillaryProducts", "Ancillary"); 709 productTypes.Add("BuffersSolutionsChemicals", "Ancillary"); 710 productTypes.Add("CellBiologyAntibodies", "PrimaryAntibodies"); 711 productTypes.Add("CellSeparation", "MojoSort"); 712 productTypes.Add("CytokineChemokineAntibodies", "PrimaryAntibodies"); 713 productTypes.Add("ELISAMAXLEGENDMAX", "ELISA"); 714 productTypes.Add("EpitopeTagProducts", "PrimaryAntibodies"); 715 productTypes.Add("HumanImmunologyAntibodies", "PrimaryAntibodies"); 716 productTypes.Add("IsotypeControls", "IsotypeControls"); 717 productTypes.Add("LEGENDplex", "LEGENDplex"); 718 productTypes.Add("LEGENDScreen", "LEGENDScreen"); 719 productTypes.Add("MarmosetImmunologyAntibodies", "PrimaryAntibodies"); 720 productTypes.Add("MouseImmunologyAntibodies", "PrimaryAntibodies"); 721 productTypes.Add("NeuroscienceProducts", "PrimaryAntibodies"); 722 productTypes.Add("RatImmunologyAntibodies", "PrimaryAntibodies"); 723 productTypes.Add("RecombinantProteins", "Recombinant"); 724 productTypes.Add("SecondaryReagents", "SecondaryReagents"); 725 productTypes.Add("VirusImmunologyAntibodies", "PrimaryAntibodies"); 726 productTypes.Add("EnzymeAssays", "EnzymeAssays"); 727 productTypes.Add("FlexT", "FlexT"); 728 productTypes.Add("NonAntibodyChemicalProbes", "NonAntibodyChemicalProbes"); 729 730 return productTypes; 731 } 732 733 public string CalculateProductName(string prodName, string prodType, string prodFormat, bool excludeAntibody) 734 { 735 var cleanName = prodName; 736 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)) 737 { 738 cleanName += " Antibody"; 739 } 740 741 if (prodType.Equals("SecondaryReagents") && !prodName.Contains(" Antibody") && !prodName.Contains("Streptavidin") && !prodName.Contains("Avidin") && (!excludeAntibody)) 742 { 743 cleanName += " Antibody"; 744 } 745 746 if (prodType.Equals("IsotypeControls") && !prodName.Contains(" Antibody") && !prodName.Contains("Lineage Cocktail") && (!excludeAntibody)) 747 { 748 cleanName += " Antibody"; 749 } 750 751 return cleanName; 752 } 753 754 public static string RoundPrice(double price, bool isPriceInterestPointValue = true, bool roundPrice = true, bool showDecimals = false) 755 { 756 var priceDouble = price; 757 if (isPriceInterestPointValue) 758 { 759 priceDouble = price * 0.01; 760 } 761 var isCurrencyJp = Dynamicweb.Ecommerce.Common.Context.Currency.CultureInfo == "ja-JP"; 762 /*var roundPriceDouble = Math.Round(priceDouble, 0, MidpointRounding.AwayFromZero);*/ 763 var roundPriceDouble = Math.Ceiling(priceDouble); 764 var roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString() : priceDouble.ToString()); 765 if(showDecimals == true){ 766 roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString("#.##") : priceDouble.ToString("0.00")); 767 } 768 769 var priceWithSymbol = string.Empty; 770 var currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 771 var positivePattern = Dynamicweb.Ecommerce.Common.Context.Currency.PositivePattern; 772 var symbolPlace = Dynamicweb.Ecommerce.Common.Context.Currency.SymbolPlace; 773 774 if (positivePattern == 3) 775 { 776 priceWithSymbol = String.Format("{0} {1}", currencySymbol, roundedPrice); 777 } 778 else if (positivePattern == 1) 779 { 780 priceWithSymbol = String.Format("{0} {1}", roundedPrice, currencySymbol); 781 } 782 else if (symbolPlace == 0 || positivePattern == 2) 783 { 784 priceWithSymbol = String.Format("{0}{1}", currencySymbol, roundedPrice); 785 } 786 else 787 { 788 priceWithSymbol = String.Format("{0}{1}", roundedPrice, currencySymbol); 789 } 790 791 return priceWithSymbol; 792 } 793 794 public int GetPageIdFromSettings() 795 { 796 var pageId = GetModuleSettingsValue("ShowOnParagraph"); 797 if (pageId.IndexOf('#') > -1) 798 { 799 pageId = pageId.Substring(0, pageId.IndexOf('#')); 800 801 } 802 if (pageId.IndexOf("ID=", StringComparison.Ordinal) > -1) 803 { 804 pageId = pageId.Substring(pageId.IndexOf("ID=", StringComparison.Ordinal) + 3); 805 } 806 807 return Convert.ToInt32(pageId); 808 } 809 810 public string GetModuleSettingsValue(string property) 811 { 812 var moduleProperty = Pageview.CurrentParagraph.ModuleProperties.Values.Cast<DictionaryEntry>().FirstOrDefault(p => p.Key.ToString() == property); 813 return moduleProperty.Value.ToString(); 814 } 815 816 public int GetPunchoutPageIdForDetailsPage() 817 { 818 var punchoutDetailPageId = GetPageIdFromSettings(); 819 return punchoutDetailPageId != 0 ? punchoutDetailPageId : Pageview.Page.ID; 820 } 821 822 public string PreviousElement = ""; 823 } 824 825 @helper RenderDetailView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) 826 { 827 var itemsCount = 0; 828 foreach (var group in prodLoop) 829 { 830 itemsCount++; 831 @RenderDetailViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 832 } 833 } 834 835 @helper RenderListView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) { 836 @RenderProductListHeader() 837 var itemsCount = 0; 838 foreach (var group in prodLoop) 839 { 840 itemsCount++; 841 @RenderListViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 842 } 843 } 844 845 @helper RenderPunchoutListView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) { 846 @RenderProductListHeader() 847 var itemsCount = 0; 848 foreach (var group in prodLoop) 849 { 850 itemsCount++; 851 @RenderPunchoutListViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 852 } 853 } 854 855 @helper RenderProductListHeader() 856 { 857 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 858 859 var str_sortBy = HttpContext.Current.Request.Params["SortBy"] ?? ""; 860 const string sortByName = "Name_sortable,Price"; 861 const string sortByClone = "Clone_Sort,Name_sortable,Price"; 862 const string sortByApplication = "AppAbrvString,Name_sortable,Price"; 863 const string sortByRegulatoryStatus = "CustomField_RegulatoryStatus,Name_sortable,Price"; 864 865 var sortByNameSelected = str_sortBy == sortByName ? "sortActive" : ""; 866 var sortByCloneSelected = (str_sortBy == sortByClone || str_sortBy == "") ? "sortActive" : ""; 867 var sortByApplicationsSelected = str_sortBy == sortByApplication ? "sortActive" : ""; 868 var sortByRegulatoryStatusSelected = str_sortBy == sortByRegulatoryStatus ? "sortActive" : ""; 869 870 <li class="col-xs-12 noPadding"> 871 <div class="col-xs-3 @sortByNameSelected"> 872 @Translate("Product", "Product") 873 </div> 874 875 <div class="col-xs-2 noPadding @sortByCloneSelected"> 876 @Translate("Clone", "Clone") 877 </div> 878 879 <div class="col-xs-1 noPadding @sortByApplicationsSelected"> 880 @Translate("Appl", "Appl.") 881 </div> 882 883 <div class="col-xs-1 @sortByRegulatoryStatusSelected"> 884 @Translate("Reg", "Reg") 885 </div> 886 887 <div class='@(!cartDisabled ? "col-xs-5" : "col-xs-5") noPadding'> 888 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 889 @Translate("categoryNumberShort", "Cat#") 890 </div> 891 892 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 893 @Translate("size", "Size") 894 </div> 895 896 @if (!cartDisabled) 897 { 898 <div class="col-xs-2 noPadding"> 899 @Translate("price", "Price") 900 </div> 901 902 <div class="col-xs-1 noPadding"> 903 @Translate("quantityHeader", "Quantity") 904 </div> 905 } 906 907 </div> 908 909 </li> 910 } 911 912 @helper RenderPunchoutListViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 913 { 914 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 915 var isCartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 916 var searchPageId = Pageview.Area.Item["Punchout_SearchResultPage"].ToString(); 917 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 918 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 919 var isExtranetUserLoggedIn = User.IsExtranetUserLoggedIn(); 920 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 921 var userCurrency = isExtranetUserLoggedIn ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 922 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 923 var isJapaneseSite = longLang.Equals("ja-JP"); 924 925 var colGroup = (!isCartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 926 927 <li class="col-xs-12"> 928 @if (itemsCount == 1) 929 { 930 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 931 } 932 <ul> 933 @foreach (var product in group) 934 { 935 var productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 936 var productId = product.GetString("Ecom:Product.ID"); 937 var productLink = product.GetString("Ecom:Product.Link.Clean"); 938 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 939 var regulatoryStatus = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.RegulatoryStatus.Value")) ? product.GetString("Ecom:Product:Field.RegulatoryStatus.Value") : "--"; 940 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 941 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 942 943 var productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 944 945 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 946 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 947 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 948 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 949 950 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 951 952 var shouldBlockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 953 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 954 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 955 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 956 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 957 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 958 bool requestQuote = product.GetBoolean("Ecom:Product:Field.RequestQuote.Value"); 959 var notifyMe = product.GetString("Ecom:Product:Field.NotifyMe.Value"); 960 961 var productVariantId = product.GetString("Ecom:Product.VariantID"); 962 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 963 964 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 965 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 966 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 967 968 <li class="row list" data-variantID="@productVariantId"> 969 @if (PreviousElement != productId) 970 { 971 <h2 class="col-xs-3"> 972 <a itemprop="name" href="@productLink"> 973 @productName 974 </a> 975 </h2> 976 977 <div class="col-xs-2 noPaddingLeft"> 978 @RenderCloneFieldForSearch(productClone, searchPageId, productCategory, productReactivity, "List") 979 </div> 980 981 <div class="col-xs-1 noPadding wordWrap"> 982 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 983 </div> 984 985 <div class="col-xs-1">@regulatoryStatus</div> 986 } 987 988 <div class='col-xs-5 noPadding @(PreviousElement == productId ? colGroup : "")'> 989 990 @if(!string.IsNullOrWhiteSpace(notifyMe)){ 991 <span style="float:right; margin-right:50px;"><a target="_blank" href="@LocalizeLinksHTML(notifyMe)">Notify Me When Available</a></span> 992 } 993 else{ 994 995 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 996 <input type="hidden" name="redirect" value="@(!isExtranetUserLoggedIn)"/> 997 <input type="hidden" name="cartcmd" value="add"/> 998 <input type="hidden" name="productid" value="@productId"/> 999 <input type="hidden" name="variantID" value="@productVariantId"/> 1000 @if (!string.IsNullOrWhiteSpace(orderContext)) 1001 { 1002 <input type="hidden" name="OrderContext" value="@orderContext"/> 1003 } 1004 1005 @* WebId Section *@ 1006 @if (isJapaneseSite && (regulatoryStatus.Equals("IVD") || productId.Equals("11573"))) 1007 { 1008 <div class='@(!isCartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1009 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1010 </div> 1011 } 1012 else if (!isComingSoon) 1013 { 1014 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1015 @product.GetString("Ecom:Product.Number") 1016 </div> 1017 } 1018 else 1019 { 1020 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1021 @Translate("comingSoon", "Coming Soon") 1022 </div> 1023 } 1024 1025 @* Catalog number Section *@ 1026 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1027 @product.GetString("Ecom:Product.VariantText") 1028 </div> 1029 1030 @* Price Section *@ 1031 <div class='@(!isCartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1032 @if (isJapaneseSite && productFormat.Contains("GOINVIVO") && !productVariantId.Equals("5mg")) 1033 { 1034 @Translate("PleaseContactUs", "Please Contact Us") 1035 } 1036 else if (isJapaneseSite && shouldBlockAddToCart) 1037 { 1038 <div> 1039 <p class="coming-soon">@blockAddToCartText</p> 1040 </div> 1041 } 1042 else if (isJapaneseSite && @product.GetString("Ecom:Product.Number").Equals("423555")) 1043 { 1044 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, false, true)</span> 1045 } 1046 else if (requestQuote) 1047 { 1048 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1049 } 1050 else if (productId.Equals("10801") && !longLang.Equals("en-US")) 1051 { 1052 @Translate("addToCartForPrice", "Add to cart for price.") 1053 } 1054 else 1055 { 1056 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1057 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, false, true)</span> 1058 } 1059 </div> 1060 1061 @* Add to cart Section *@ 1062 @if (!isCartDisabled && !(productName.Contains("Flex-T") && productName.Contains("Custom"))) 1063 { 1064 <div class="col-xs-1 noPadding"> 1065 @if (!productVariantStatus.Equals(3) && !isComingSoon && !shouldBlockAddToCart) 1066 { 1067 <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" size="3" class="productQTYRequestBox"/> 1068 } 1069 </div> 1070 1071 <div class="col-xs-1"> 1072 @if (shouldBlockAddToCart) 1073 { 1074 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1075 <i class="fa fa-times-circle"></i> 1076 </button> 1077 } 1078 else if (productName.Contains("Capture Bead") || (productName.Contains("LEGENDplex") && (productName.Contains("Standard") || productName.Contains("Detection Antibodies") || productName.Contains("Detection Abs") || productName.Contains("Buffer Set")))) 1079 { 1080 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1081 <i class="fa fa-shopping-cart"></i> 1082 </button> 1083 } 1084 else if (isComingSoon) 1085 { 1086 @:&nbsp; 1087 } 1088 else if (userCurrency != siteCurrency) 1089 { 1090 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1091 <button type="submit" disabled> 1092 <i class="fa fa-shopping-cart"></i> 1093 </button> 1094 </span> 1095 } 1096 else if (string.IsNullOrWhiteSpace(productSource)) 1097 { 1098 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1099 <button type="submit" disabled> 1100 <i class="fa fa-shopping-cart"></i> 1101 </button> 1102 </span> 1103 } 1104 else 1105 { 1106 <button type="submit"> 1107 <i class="fa fa-shopping-cart"></i> 1108 </button> 1109 } 1110 </div> 1111 } 1112 </form> 1113 } 1114 </div> 1115 </li> 1116 1117 PreviousElement = group.Key; 1118 } 1119 </ul> 1120 @if (itemsCount == prodLoopCount) 1121 { 1122 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 1123 } 1124 </li> 1125 } 1126 1127 @helper RenderListViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 1128 { 1129 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 1130 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 1131 var searchPageID = Pageview.Area.Item["SearchResults"].ToString(); 1132 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 1133 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 1134 var bol_userLogged = User.IsExtranetUserLoggedIn(); 1135 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 1136 var userCurrency = bol_userLogged ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 1137 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 1138 1139 var colGroup = (!cartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 1140 var productTypes = GetProductTypes(); 1141 1142 <li class="col-xs-12"> 1143 @if (itemsCount == 1) 1144 { 1145 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 1146 } 1147 <ul> 1148 @foreach (var product in group) 1149 { 1150 //var str_productName = product.GetString("Ecom:Product.Name"); 1151 var str_productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 1152 var str_productID = product.GetString("Ecom:Product.ID"); 1153 var str_link = "/Default.aspx?id=" + GetPageIdByNavigationTag("ProductDetail") + "&ProductId=" + str_productID; 1154 var excludeAB = product.GetBoolean("Ecom:Product:Field.ExcludeAB.Value"); 1155 var productType = product.GetString("Ecom:Product:Field.CMProductType.Value"); 1156 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 1157 var regulatoryStatus = product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"); 1158 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 1159 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 1160 1161 1162 var str_productImage = product.GetString("Ecom:Product.ImageSmall.Clean"); 1163 var str_productImageMedium = product.GetString("Ecom:Product.ImageMedium.Clean"); 1164 var str_productImageLarge = product.GetString("Ecom:Product.ImageLarge.Clean"); 1165 var str_productImage4 = product.GetString("Ecom:Product:Field.Image4Path.Value.Clean"); 1166 1167 var str_image1Description = product.GetString("Ecom:Product:Field.Image1Description.Value"); 1168 var str_image2Description = product.GetString("Ecom:Product:Field.Image2Description.Value"); 1169 var str_image3Description = product.GetString("Ecom:Product:Field.Image3Description.Value"); 1170 var str_image4Description = product.GetString("Ecom:Product:Field.Image4Description.Value"); 1171 1172 var str_image1Title = product.GetString("Ecom:Product:Field.Image1Title.Value"); 1173 var str_image2Title = product.GetString("Ecom:Product:Field.Image2Title.Value"); 1174 var str_image3Title = product.GetString("Ecom:Product:Field.Image3Title.Value"); 1175 var str_image4Title = product.GetString("Ecom:Product:Field.Image4Title.Value"); 1176 1177 var str_productImage5 = product.GetString("Ecom:Product:Field.Image5Path.Value.Clean"); 1178 var str_image5Description = product.GetString("Ecom:Product:Field.Image5Description.Value"); 1179 var str_image5Title = product.GetString("Ecom:Product:Field.Image5Title.Value"); 1180 1181 var str_productImage6 = product.GetString("Ecom:Product:Field.Image6Path.Value.Clean"); 1182 var str_image6Description = product.GetString("Ecom:Product:Field.Image6Description.Value"); 1183 var str_image6Title = product.GetString("Ecom:Product:Field.Image6Title.Value"); 1184 1185 var str_productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 1186 1187 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 1188 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 1189 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 1190 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 1191 1192 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 1193 1194 var blockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 1195 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 1196 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 1197 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 1198 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 1199 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 1200 bool requestQuote = product.GetBoolean("Ecom:Product:Field.RequestQuote.Value"); 1201 var notifyMe = product.GetString("Ecom:Product:Field.NotifyMe.Value"); 1202 1203 var lst_images = new List<Tuple<string, string, string>>(); 1204 1205 if (!String.IsNullOrEmpty(str_productImage)) 1206 { 1207 lst_images.Add(new Tuple<string, string, string>(str_productImage, str_image1Title, str_image1Description)); 1208 } 1209 if (!String.IsNullOrEmpty(str_productImageMedium)) 1210 { 1211 lst_images.Add(new Tuple<string, string, string>(str_productImageMedium, str_image2Title, str_image2Description)); 1212 } 1213 if (!String.IsNullOrEmpty(str_productImageLarge)) 1214 { 1215 lst_images.Add(new Tuple<string, string, string>(str_productImageLarge, str_image3Title, str_image3Description)); 1216 } 1217 if (!String.IsNullOrEmpty(str_productImage4)) 1218 { 1219 lst_images.Add(new Tuple<string, string, string>(str_productImage4, str_image4Title, str_image4Description)); 1220 } 1221 if (!String.IsNullOrEmpty(str_productImage5)) 1222 { 1223 lst_images.Add(new Tuple<string, string, string>(str_productImage5, str_image5Title, str_image5Description)); 1224 } 1225 if (!String.IsNullOrEmpty(str_productImage6)) 1226 { 1227 lst_images.Add(new Tuple<string, string, string>(str_productImage6, str_image6Title, str_image6Description)); 1228 } 1229 1230 var str_productVariantID = product.GetString("Ecom:Product.VariantID"); 1231 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 1232 var productFieldType = ""; 1233 if (productTypes.ContainsKey(productType)) 1234 { 1235 productFieldType = productTypes[productType]; 1236 } 1237 1238 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1239 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 1240 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1241 1242 //str_productName = CalculateProductName(str_productName, productFieldType, str_productFormat, excludeAB); 1243 1244 <li class="row list" data-variantID="@str_productVariantID"> 1245 @if (PreviousElement != str_productID) 1246 { 1247 <h2 class="col-xs-3"> 1248 <a itemprop="name" href="@str_link"> 1249 @str_productName 1250 </a> 1251 </h2> 1252 1253 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-2") noPaddingLeft'> 1254 @RenderCloneFieldForSearch(productClone, searchPageID, productCategory, productReactivity, "List") 1255 </div> 1256 1257 <div class="col-xs-1 noPadding wordWrap"> 1258 <a href="@LocalizeLinksHTML("dwcountry/abbreviations")" target="_blank" title='@Translate("ViewAbbreviationDescriptions", "View abbreviation descriptions")'> 1259 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 1260 </a> 1261 </div> 1262 1263 <div class="col-xs-1"> 1264 @if (!String.IsNullOrWhiteSpace(regulatoryStatus)) 1265 { 1266 @regulatoryStatus 1267 } 1268 else 1269 { 1270 <text>--</text> 1271 } 1272 </div> 1273 } 1274 1275 <div class='@(!cartDisabled ? "col-xs-5" : "col-xs-5") noPadding @(PreviousElement == str_productID ? colGroup : "")'> 1276 1277 @if(!string.IsNullOrWhiteSpace(notifyMe)){ 1278 <span style="float:right; margin-right:50px;"><a href="@LocalizeLinksHTML(notifyMe)">Notify Me When Available</a></span> 1279 } 1280 else{ 1281 1282 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1283 @if (bol_userLogged) 1284 { 1285 <input type="hidden" name="redirect" value="false"/> 1286 } 1287 <input type="hidden" name="cartcmd" value="add"/> 1288 <input type="hidden" name="productid" value="@str_productID"/> 1289 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1290 @if (!string.IsNullOrWhiteSpace(orderContext)) 1291 { 1292 <input type="hidden" name="OrderContext" value="@orderContext"/> 1293 } 1294 1295 @if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1296 { 1297 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1298 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1299 </div> 1300 } 1301 else 1302 { 1303 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1304 @if (!isComingSoon) 1305 { 1306 @product.GetString("Ecom:Product.Number") 1307 } 1308 else 1309 { 1310 @Translate("comingSoon", "Coming Soon") 1311 } 1312 </div> 1313 } 1314 1315 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1316 @product.GetString("Ecom:Product.VariantText") 1317 </div> 1318 1319 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1320 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GOINVIVO") && !str_productVariantID.Equals("5mg")) 1321 { 1322 @Translate("PleaseContactUs", "Please Contact Us") 1323 } 1324 else if (longLang.Equals("ja-JP") && blockAddToCart) 1325 { 1326 <div> 1327 <p class="coming-soon">@blockAddToCartText</p> 1328 </div> 1329 } 1330 else if (longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")) 1331 { 1332 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1333 } 1334 else if (requestQuote) 1335 { 1336 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1337 } 1338 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1339 { 1340 @Translate("addToCartForPrice", "Add to cart for price.") 1341 } 1342 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1343 { 1344 } 1345 else if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1346 { 1347 } 1348 else 1349 { 1350 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1351 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1352 } 1353 </div> 1354 1355 @if (!cartDisabled && !(str_productName.Contains("Flex-T") && str_productName.Contains("Custom"))) 1356 { 1357 <div class="col-xs-1 noPadding"> 1358 @if (!productVariantStatus.Equals(3) && !isComingSoon && !blockAddToCart) 1359 { 1360 <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" size="3" class="productQTYRequestBox"/> 1361 } 1362 </div> 1363 1364 <div class="col-xs-1"> 1365 @if (blockAddToCart) 1366 { 1367 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1368 <i class="fa fa-times-circle"></i> 1369 </button> 1370 } 1371 else 1372 { 1373 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")))) 1374 { 1375 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1376 <i class="fa fa-shopping-cart"></i> 1377 </button> 1378 } 1379 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1380 { 1381 } 1382 else if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1383 { 1384 } 1385 else 1386 { 1387 if (isComingSoon) 1388 { 1389 @:&nbsp; 1390 } 1391 else if (userCurrency != siteCurrency) 1392 { 1393 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1394 <button type="submit" disabled> 1395 <i class="fa fa-shopping-cart"></i> 1396 </button> 1397 </span> 1398 } 1399 else if (string.IsNullOrWhiteSpace(productSource)) 1400 { 1401 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1402 <button type="submit" disabled> 1403 <i class="fa fa-shopping-cart"></i> 1404 </button> 1405 </span> 1406 } 1407 else 1408 { 1409 <button type="submit"> 1410 <i class="fa fa-shopping-cart"></i> 1411 </button> 1412 } 1413 } 1414 } 1415 </div> 1416 } 1417 </form> 1418 } 1419 </div> 1420 </li> 1421 1422 PreviousElement = group.Key; 1423 } 1424 </ul> 1425 @if (itemsCount == prodLoopCount) 1426 { 1427 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 1428 } 1429 </li> 1430 } 1431 1432 @helper RenderDetailViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 1433 { 1434 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 1435 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 1436 var searchPageID = Pageview.Area.Item["SearchResults"].ToString(); 1437 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 1438 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 1439 var bol_userLogged = User.IsExtranetUserLoggedIn(); 1440 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 1441 var userCurrency = bol_userLogged ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 1442 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 1443 1444 var cdnStaticDomain = BioLegend.Web.Helpers.CdnFunctions.GetCdnByType("Static_Content", "Static_Content_Domain"); //CUSTOM CODE 1445 1446 var colGroup = (!cartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 1447 var productTypes = GetProductTypes(); 1448 1449 <li class="col-xs-12"> 1450 @if (itemsCount == 1) 1451 { 1452 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 1453 } 1454 <ul> 1455 @foreach (var product in group) 1456 { 1457 var str_starClass = ""; 1458 var str_halfStar = ""; 1459 1460 var str_productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 1461 var str_productID = product.GetString("Ecom:Product.ID"); 1462 var str_link = "/Default.aspx?id=" + GetPageIdByNavigationTag("ProductDetail") + "&ProductId=" + str_productID; 1463 var excludeAB = product.GetBoolean("Ecom:Product:Field.ExcludeAB.Value"); 1464 var productType = product.GetString("Ecom:Product:Field.CMProductType.Value"); 1465 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 1466 var regulatoryStatus = product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"); 1467 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 1468 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 1469 1470 var str_productImage = product.GetString("Ecom:Product.ImageSmall.Clean"); 1471 var str_productImageMedium = product.GetString("Ecom:Product.ImageMedium.Clean"); 1472 var str_productImageLarge = product.GetString("Ecom:Product.ImageLarge.Clean"); 1473 var str_productImage4 = product.GetString("Ecom:Product:Field.Image4Path.Value.Clean"); 1474 1475 var str_image1Description = product.GetString("Ecom:Product:Field.Image1Description.Value"); 1476 var str_image2Description = product.GetString("Ecom:Product:Field.Image2Description.Value"); 1477 var str_image3Description = product.GetString("Ecom:Product:Field.Image3Description.Value"); 1478 var str_image4Description = product.GetString("Ecom:Product:Field.Image4Description.Value"); 1479 1480 var str_image1Title = product.GetString("Ecom:Product:Field.Image1Title.Value"); 1481 var str_image2Title = product.GetString("Ecom:Product:Field.Image2Title.Value"); 1482 var str_image3Title = product.GetString("Ecom:Product:Field.Image3Title.Value"); 1483 var str_image4Title = product.GetString("Ecom:Product:Field.Image4Title.Value"); 1484 1485 var str_productImage5 = product.GetString("Ecom:Product:Field.Image5Path.Value.Clean"); 1486 var str_image5Description = product.GetString("Ecom:Product:Field.Image5Description.Value"); 1487 var str_image5Title = product.GetString("Ecom:Product:Field.Image5Title.Value"); 1488 1489 var str_productImage6 = product.GetString("Ecom:Product:Field.Image6Path.Value.Clean"); 1490 var str_image6Description = product.GetString("Ecom:Product:Field.Image6Description.Value"); 1491 var str_image6Title = product.GetString("Ecom:Product:Field.Image6Title.Value"); 1492 1493 var str_productGetImage = GetImage(str_productImage, 140, 0, 0, 0, 0, 0, "jpg", 90); 1494 var str_productGetImageMedium = GetImage(str_productImageMedium, 140, 0, 0, 0, 0, 0, "jpg", 90); 1495 var str_productGetImageLarge = GetImage(str_productImageLarge, 140, 0, 0, 0, 0, 0, "jpg", 90); 1496 var str_productGetImage4 = GetImage(str_productImage4, 140, 0, 0, 0, 0, 0, "jpg", 90); 1497 var str_productGetImage5 = GetImage(str_productImage5, 140, 0, 0, 0, 0, 0, "jpg", 90); 1498 var str_productGetImage6 = GetImage(str_productImage6, 140, 0, 0, 0, 0, 0, "jpg", 90); 1499 1500 var str_productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 1501 1502 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 1503 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 1504 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 1505 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 1506 1507 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 1508 var DCSoon = product.GetString("Ecom:Product:Field.DCSoon.Value"); 1509 var notifyMe = product.GetString("Ecom:Product:Field.NotifyMe.Value"); 1510 1511 var blockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 1512 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 1513 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 1514 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 1515 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 1516 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 1517 1518 var lst_images = new List<Tuple<string, string, string>>(); 1519 1520 if (!String.IsNullOrEmpty(str_productImage)) 1521 { 1522 lst_images.Add(new Tuple<string, string, string>(str_productImage, str_image1Title, str_image1Description)); 1523 } 1524 if (!String.IsNullOrEmpty(str_productImageMedium)) 1525 { 1526 lst_images.Add(new Tuple<string, string, string>(str_productImageMedium, str_image2Title, str_image2Description)); 1527 } 1528 if (!String.IsNullOrEmpty(str_productImageLarge)) 1529 { 1530 lst_images.Add(new Tuple<string, string, string>(str_productImageLarge, str_image3Title, str_image3Description)); 1531 } 1532 if (!String.IsNullOrEmpty(str_productImage4)) 1533 { 1534 lst_images.Add(new Tuple<string, string, string>(str_productImage4, str_image4Title, str_image4Description)); 1535 } 1536 if (!String.IsNullOrEmpty(str_productImage5)) 1537 { 1538 lst_images.Add(new Tuple<string, string, string>(str_productImage5, str_image5Title, str_image5Description)); 1539 } 1540 if (!String.IsNullOrEmpty(str_productImage6)) 1541 { 1542 lst_images.Add(new Tuple<string, string, string>(str_productImage6, str_image6Title, str_image6Description)); 1543 } 1544 1545 var str_productVariantID = product.GetString("Ecom:Product.VariantID"); 1546 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 1547 var productFieldType = ""; 1548 if (productTypes.ContainsKey(productType)) 1549 { 1550 productFieldType = productTypes[productType]; 1551 } 1552 1553 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1554 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 1555 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1556 1557 var requestQuote = GetBoolean("Ecom:Product:Field.RequestQuote"); 1558 1559 1560 //str_productName = CalculateProductName(str_productName, productFieldType, str_productFormat, excludeAB); 1561 1562 <div class="row detailed"> 1563 @if (PreviousElement != str_productID) 1564 { 1565 <h2 class="col-xs-12"> 1566 <a itemprop="name" href="@str_link"> 1567 @str_productName 1568 </a> 1569 </h2> 1570 } 1571 1572 @if (PreviousElement != str_productID) 1573 { 1574 <div class="col-xs-7 noPadding"> 1575 <dl class="col-xs-12 noPadding"> 1576 @if (!string.IsNullOrWhiteSpace(productClone)) 1577 { 1578 <dt class="col-xs-6"> 1579 <b>@Translate("Clone", "Clone")</b> 1580 </dt> 1581 <dd class="col-xs-6"> 1582 @RenderCloneFieldForSearch(productClone, searchPageID, productCategory, productReactivity, "Detail") 1583 </dd> 1584 } 1585 1586 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.Specificity.Value"))) 1587 { 1588 <dt class="col-xs-6"> 1589 <b>@product.GetString("Ecom:Product:Field.Specificity.Name")</b> 1590 </dt> 1591 <dd class="col-xs-6"> 1592 @product.GetString("Ecom:Product:Field.Specificity.Value") 1593 </dd> 1594 } 1595 1596 @if (!string.IsNullOrWhiteSpace(productReactivity)) 1597 { 1598 <dt class="col-xs-6"> 1599 <b>@product.GetString("Ecom:Product:Field.Reactivity.Name")</b> 1600 </dt> 1601 <dd class="col-xs-6"> 1602 @productReactivity 1603 </dd> 1604 } 1605 1606 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.AppAbrv.Value"))) 1607 { 1608 <dt class="col-xs-6"> 1609 <b>@product.GetString("Ecom:Product:Field.Applications.Name")</b> 1610 </dt> 1611 <dd class="col-xs-6"> 1612 <a href="@LocalizeLinksHTML("dwcountry/abbreviations")" target="_blank" title='@Translate("ViewAbbreviationDescriptions", "View abbreviation descriptions")'> 1613 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 1614 </a> 1615 </dd> 1616 } 1617 1618 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"))) 1619 { 1620 <dt class="col-xs-6"> 1621 <b>@product.GetString("Ecom:Product:Field.RegulatoryStatus.Name")</b> 1622 </dt> 1623 <dd class="col-xs-6"> 1624 @product.GetString("Ecom:Product:Field.RegulatoryStatus.Value") 1625 </dd> 1626 } 1627 1628 @{ 1629 string pattern = @"\<[^>]*\>"; 1630 Regex rgx = new Regex(pattern); 1631 string otherNamesValue = rgx.Replace(product.GetString("Ecom:Product:Field.OtherNames.Value"), String.Empty); 1632 } 1633 @if (!String.IsNullOrWhiteSpace(otherNamesValue)) 1634 { 1635 <dt class="col-xs-6"> 1636 <b>@product.GetString("Ecom:Product:Field.OtherNames.Name")</b> 1637 </dt> 1638 <dd class="col-xs-6"> 1639 @product.GetString("Ecom:Product:Field.OtherNames.Value") 1640 </dd> 1641 } 1642 1643 @if (product.GetInteger("Ecom:Product.Rating") > 0) 1644 { 1645 <dt class="col-xs-6"> 1646 <b>@Translate("rating", "Rating")</b> 1647 </dt> 1648 <dd class="col-xs-6"> 1649 <ul class="rating"> 1650 @for (int s = 5; s > 0; s--) 1651 { 1652 if (s == Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))) 1653 { 1654 str_starClass = "class='star'"; 1655 str_halfStar = !(product.GetDouble("Ecom:Product.Rating") - Math.Round(product.GetDouble("Ecom:Product.Rating")) == 0) ? "fa-star-half" : "fa-star"; 1656 } 1657 else if (s > Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))) 1658 { 1659 str_halfStar = "fa-star"; 1660 } 1661 else 1662 { 1663 str_starClass = ""; 1664 str_halfStar = "fa-star"; 1665 } 1666 1667 <li data-star="@s" @str_starClass> 1668 <i class="fa @str_halfStar"></i> 1669 </li> 1670 } 1671 </ul> 1672 </dd> 1673 } 1674 1675 </dl> 1676 </div> 1677 } 1678 1679 <div class="col-xs-5 noPadding"> 1680 @if (PreviousElement != str_productID) 1681 { 1682 string catNoLen = "col-xs-2"; 1683 if (longLang.Equals("ja-JP")) 1684 { 1685 catNoLen = "col-xs-4"; 1686 } 1687 else if (cartDisabled) 1688 { 1689 catNoLen = "col-xs-4"; 1690 } 1691 else 1692 { 1693 catNoLen = "col-xs-2"; 1694 } 1695 1696 if(!string.IsNullOrWhiteSpace(notifyMe)){ 1697 1698 <div style="padding-bottom:25px;"><a href="@LocalizeLinksHTML(notifyMe)" class="btn btn-primary" style="color:#FFF; text-decoration:none;">Notify Me When Available</a></div> 1699 1700 } 1701 else{ 1702 1703 <ul> 1704 <li> 1705 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1706 1707 <input type="hidden" name="redirect" value="false"/> 1708 <input type="hidden" name="cartcmd" value="add"/> 1709 <input type="hidden" name="productid" value="@str_productID"/> 1710 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1711 @if (!string.IsNullOrWhiteSpace(orderContext)) 1712 { 1713 <input type="hidden" name="OrderContext" value="@orderContext"/> 1714 } 1715 1716 <div class="@catNoLen noPadding paddingT40"> 1717 @if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1718 { 1719 <text>&nbsp;</text> 1720 } 1721 else 1722 { 1723 if (!isComingSoon) 1724 { 1725 @product.GetString("Ecom:Product.Number") 1726 } 1727 else 1728 { 1729 @Translate("comingSoon", "Coming Soon") 1730 } 1731 } 1732 </div> 1733 1734 <div class="col-xs-2 noPadding"> 1735 <span class="title"> 1736 <b>@Translate("size", "Size")</b> 1737 </span> 1738 @product.GetString("Ecom:Product.VariantText") 1739 </div> 1740 1741 <div class="col-xs-2 noPadding"> 1742 <span class="title" data-lang="@longLang" data-format="@str_productFormat" data-variant="@str_productVariantID"> 1743 <b>@Translate("price", "Price")</b> 1744 </span> 1745 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1746 { 1747 @Translate("PleaseContactUs", "Please Contact Us") 1748 } 1749 else if (longLang.Equals("ja-JP") && blockAddToCart) 1750 { 1751 <div> 1752 <p class="coming-soon">@blockAddToCartText</p> 1753 </div> 1754 } 1755 else if (longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")) 1756 { 1757 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1758 } 1759 else if (requestQuote) 1760 { 1761 <div> 1762 <a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a> 1763 </div> 1764 } 1765 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1766 { 1767 @Translate("addToCartForPrice", "Add to cart for price.") 1768 } 1769 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1770 { 1771 } 1772 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1773 { 1774 } 1775 else 1776 { 1777 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1778 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1779 } 1780 </div> 1781 1782 @if (!cartDisabled && !(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) && !(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD"))) 1783 { 1784 <div class="col-xs-2 noPaddingRight"> 1785 <span class="title"> 1786 <b>@Translate("quantityVariant", "Quantity")</b> 1787 </span> 1788 @if (!productVariantStatus.Equals(3) && !isComingSoon && !blockAddToCart) 1789 { 1790 <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"/> 1791 } 1792 </div> 1793 1794 <div class="col-xs-4 addCartButtonArea"> 1795 @if (blockAddToCart) 1796 { 1797 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1798 <i class="fa fa-times-circle"></i> 1799 </button> 1800 } 1801 else 1802 { 1803 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")))) 1804 { 1805 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1806 <i class="fa fa-shopping-cart"></i> 1807 </button> 1808 } 1809 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1810 { 1811 } 1812 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1813 { 1814 } 1815 else 1816 { 1817 if (isComingSoon) 1818 { 1819 @:&nbsp; 1820 } 1821 else if (userCurrency != siteCurrency) 1822 { 1823 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1824 <button type="submit" disabled> 1825 <i class="fa fa-shopping-cart"></i> 1826 </button> 1827 </span> 1828 } 1829 else if (string.IsNullOrWhiteSpace(productSource)) 1830 { 1831 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1832 <button type="submit" disabled> 1833 <i class="fa fa-shopping-cart"></i> 1834 </button> 1835 </span> 1836 } 1837 else 1838 { 1839 <button type="submit"> 1840 <i class="fa fa-shopping-cart"></i> 1841 </button> 1842 } 1843 } 1844 } 1845 </div> 1846 } 1847 </form> 1848 </li> 1849 @RenderSnippet("catalogVariants" + @str_productID) 1850 </ul> 1851 } 1852 @SnippetStart("catalogVariants" + @str_productID) 1853 @SnippetEnd("catalogVariants" + @str_productID) 1854 1855 if (lst_images.Any()) 1856 { 1857 <div class="productDataImage col-xs-12 noPadding"> 1858 <h3>Product Data</h3> 1859 <ul class="col-xs-12 noPadding"> 1860 @if (!string.IsNullOrWhiteSpace(str_productImage)) 1861 { 1862 <li> 1863 <figure> 1864 <img class="img-responsive" src="@str_productGetImage" alt="@str_image1Title" title="@str_image1Title"/> 1865 </figure> 1866 </li> 1867 } 1868 1869 @if (!string.IsNullOrWhiteSpace(str_productImageMedium)) 1870 { 1871 <li> 1872 <figure> 1873 <img class="img-responsive" src="@str_productGetImageMedium" alt="@str_image2Title" title="@str_image2Title"/> 1874 </figure> 1875 </li> 1876 } 1877 1878 @if (!string.IsNullOrWhiteSpace(str_productImageLarge)) 1879 { 1880 <li> 1881 <figure> 1882 <img class="img-responsive" src="@str_productGetImageLarge" alt="@str_image3Title" title="@str_image3Title"/> 1883 </figure> 1884 </li> 1885 } 1886 1887 @if (!string.IsNullOrWhiteSpace(str_productImage4)) 1888 { 1889 <li> 1890 <figure> 1891 <img class="img-responsive" src="@str_productGetImage4" alt="@str_image4Title" title="@str_image4Title"/> 1892 </figure> 1893 </li> 1894 } 1895 1896 @if (!string.IsNullOrWhiteSpace(str_productImage5)) 1897 { 1898 <li> 1899 <figure> 1900 <img class="img-responsive" src="@str_productGetImage5" alt="@str_image5Title" title="@str_image5Title"/> 1901 </figure> 1902 </li> 1903 } 1904 1905 @if (!string.IsNullOrWhiteSpace(str_productImage6)) 1906 { 1907 <li> 1908 <figure> 1909 <img class="img-responsive" src="@str_productGetImage6" alt="@str_image6Title" title="@str_image6Title"/> 1910 </figure> 1911 </li> 1912 } 1913 1914 </ul> 1915 </div> 1916 } 1917 } 1918 else 1919 { 1920 @SnippetStart("catalogVariants" + @str_productID) 1921 string catNoLen = "col-xs-2"; 1922 if (longLang.Equals("ja-JP")) 1923 { 1924 catNoLen = "col-xs-4"; 1925 } 1926 else if (cartDisabled) 1927 { 1928 catNoLen = "col-xs-4"; 1929 } 1930 else 1931 { 1932 catNoLen = "col-xs-2"; 1933 } 1934 1935 <li> 1936 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1937 1938 <input type="hidden" name="redirect" value="false"/> 1939 <input type="hidden" name="cartcmd" value="add"/> 1940 <input type="hidden" name="productid" value="@str_productID"/> 1941 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1942 @if (!string.IsNullOrWhiteSpace(orderContext)) 1943 { 1944 <input type="hidden" name="OrderContext" value="@orderContext"/> 1945 } 1946 1947 <div class="@catNoLen noPadding"> 1948 @if (!isComingSoon) 1949 { 1950 @product.GetString("Ecom:Product.Number") 1951 } 1952 else 1953 { 1954 @Translate("comingSoon", "Coming Soon") 1955 } 1956 </div> 1957 1958 <div class="col-xs-2 noPadding"> 1959 @* str_productVariantName *@ 1960 @product.GetString("Ecom:Product.VariantText") 1961 </div> 1962 1963 <div class="col-xs-2 noPadding"> 1964 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1965 { 1966 @Translate("PleaseContactUs", "Please Contact Us") 1967 } 1968 else if (requestQuote) 1969 { 1970 <div> 1971 <a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a> 1972 </div> 1973 } 1974 else if (longLang.Equals("ja-JP") && blockAddToCart) 1975 { 1976 <div> 1977 <p class="coming-soon">@blockAddToCartText</p> 1978 </div> 1979 } 1980 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1981 { 1982 @Translate("addToCartForPrice", "Add to cart for price.") 1983 } 1984 else 1985 { 1986 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1987 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1988 } 1989 </div> 1990 1991 @if (!cartDisabled) 1992 { 1993 <div class="col-xs-2 noPaddingRight"> 1994 @if (!productVariantStatus.Equals(3) && !isComingSoon && string.IsNullOrEmpty(DCSoon) && !blockAddToCart) 1995 { 1996 <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"/> 1997 } 1998 </div> 1999 2000 <div class="col-xs-4"> 2001 @if (blockAddToCart) 2002 { 2003 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 2004 <i class="fa fa-times-circle"></i> 2005 </button> 2006 } 2007 else 2008 { 2009 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")))) 2010 { 2011 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 2012 <i class="fa fa-shopping-cart"></i> 2013 </button> 2014 } 2015 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 2016 { 2017 } 2018 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 2019 { 2020 } 2021 else 2022 { 2023 if (isComingSoon) 2024 { 2025 @:&nbsp; 2026 } 2027 else if (userCurrency != siteCurrency) 2028 { 2029 <span class="inputSubmit" data-toggle="tooltip" title="Invalid currency"> 2030 <button type="submit" disabled> 2031 <i class="fa fa-shopping-cart"></i> 2032 </button> 2033 </span> 2034 } 2035 else if (string.IsNullOrWhiteSpace(productSource)) 2036 { 2037 <span class="inputSubmit" data-toggle="tooltip" title="This product is not currently available."> 2038 <button type="submit" disabled> 2039 <i class="fa fa-shopping-cart"></i> 2040 </button> 2041 </span> 2042 } 2043 else if (bol_userLogged) 2044 { 2045 <button type="submit"> 2046 <i class="fa fa-shopping-cart"></i> 2047 </button> 2048 } 2049 else 2050 { 2051 <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"> 2052 <i class="fa fa-shopping-cart"></i> 2053 </button> 2054 } 2055 } 2056 } 2057 </div> 2058 } 2059 </form> 2060 </li> 2061 2062 @SnippetEnd("catalogVariants" + @str_productID) 2063 } 2064 </div> 2065 </div> 2066 2067 PreviousElement = group.Key; 2068 } 2069 </ul> 2070 @if (itemsCount == prodLoopCount) 2071 { 2072 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 2073 } 2074 </li> 2075 } 2076 2077 @helper ShowTextAboutMoreOptionsInPreviousOrNextPages(List<LoopItem> loopProduct, bool isToPageBefore = false) 2078 { 2079 if (loopProduct.Any()) 2080 { 2081 var countVariantsWithSameProdId = string.Empty; 2082 var countTotalOfVariantsForProd = string.Empty; 2083 var translateText = string.Empty; 2084 var positionClass = "moreVariantsBefore"; 2085 var totalPages = GetInteger("Ecom:ProductList.TotalPages"); 2086 2087 if (isToPageBefore) 2088 { 2089 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.First().GetString("Ecom:Product.ID")).Count().ToString(); 2090 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).First().ToString(); 2091 translateText = Translate("SeeMoreSizeOptionsForThisProductOnThePreviousPage", "See more size options for this product on the previous page."); 2092 } 2093 else 2094 { 2095 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.Last().GetString("Ecom:Product.ID")).Count().ToString(); 2096 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).Last().ToString(); 2097 translateText = Translate("SeeMoreSizeOptionsForThisProductOnTheNextPage", "See more size options for this product on the next page."); 2098 positionClass = "moreVariantsNext"; 2099 } 2100 2101 if (countVariantsWithSameProdId != countTotalOfVariantsForProd && totalPages > 1) 2102 { 2103 <div class="@positionClass col-xs-12">@translateText</div> 2104 } 2105 } 2106 } 2107 2108 @helper RenderCloneFieldForSearch(string clone, string spID, string pCat, string pReact, string searchType) 2109 { 2110 var cloneText = ""; 2111 if (!string.IsNullOrEmpty(clone)) 2112 { 2113 var thisClone = ""; 2114 if (clone.Contains(";")) 2115 { 2116 var clones = clone.Replace(" ", "").Split(';'); 2117 foreach (var x in clones) 2118 { 2119 var cloneHTML = HttpUtility.HtmlDecode(x); 2120 var cloneTag = "; "; 2121 thisClone += "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + x + "</a>" + cloneTag; 2122 } 2123 } 2124 else 2125 { 2126 var cloneHTML = HttpUtility.HtmlDecode(clone); 2127 if (pCat.Equals("RECOM_PRO")) 2128 { 2129 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 2130 } 2131 else 2132 { 2133 if (searchType == "Detail") 2134 { 2135 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 2136 } 2137 else 2138 { 2139 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i> " + clone + "</a>"; 2140 } 2141 } 2142 } 2143 2144 cloneText += thisClone; 2145 } 2146 else if (!string.IsNullOrWhiteSpace(pReact) && !pCat.Equals("RECOM_PRO") && !searchType.Equals("Detail")) 2147 { 2148 cloneText += "<a href=\"javascript:void(0);\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i></a>"; 2149 } 2150 2151 <text>@cloneText</text> 2152 } 2153 @using System.Collections.Specialized; 2154 @using System.Linq 2155 @functions { 2156 2157 public string LocalizeLinksHTML (string HtmlContent){ 2158 int areaID = Pageview.Area.ID; 2159 var area = Dynamicweb.Services.Areas.GetArea(areaID); 2160 string areaCulture = area.Culture.ToLower(); 2161 if(!string.IsNullOrEmpty(HtmlContent)){ 2162 if(HtmlContent.IndexOf("dwcountry") > -1){ 2163 return HtmlContent.Replace("dwcountry",areaCulture); 2164 } else{ 2165 return HtmlContent; 2166 } 2167 2168 } else { 2169 return HtmlContent; 2170 } 2171 2172 } 2173 2174 public string LocalizeLinks (string HtmlContent){ 2175 int areaID = Pageview.Area.ID; 2176 var area = Dynamicweb.Services.Areas.GetArea(areaID); 2177 string areaCulture = area.Culture.ToLower(); 2178 if(!string.IsNullOrEmpty(HtmlContent)){ 2179 if(HtmlContent.IndexOf("dwcountry") > -1){ 2180 return HtmlContent.Replace("dwcountry",areaCulture); 2181 } else if (HtmlContent.IndexOf("?ID=") > -1) { 2182 //do something 2183 string baseHref = String.Format("https://{0}",GetGlobalValue("Global:Request.Host")); 2184 HtmlContent = HtmlContent.Contains("http") ? HtmlContent : baseHref + "/" + HtmlContent; 2185 var uri = new Uri(HtmlContent,UriKind.RelativeOrAbsolute); 2186 var parsedQuery = HttpUtility.ParseQueryString(uri.Query); 2187 var pageID = parsedQuery.Get("ID"); 2188 2189 string pageVersionID = pageID; 2190 string localizedLink = HtmlContent; 2191 if (!string.IsNullOrEmpty(pageID)){ 2192 var pageService = new Dynamicweb.Content.PageService(); 2193 var linkPage = pageService.GetPagesByAreaID(areaID).FirstOrDefault(x => x.MasterPageId == int.Parse(pageID)); 2194 pageVersionID = linkPage != null ? linkPage.ID.ToString() : pageID ; 2195 2196 localizedLink = ModifyQueryStringValue(HtmlContent,"ID",pageVersionID); 2197 } 2198 //return string.Join(",", parsedQuery.AllKeys); 2199 //return string.Join(HtmlContent,"-",pageVersionID); 2200 return localizedLink; 2201 } else { 2202 return HtmlContent; 2203 } 2204 }else { 2205 return HtmlContent; 2206 } 2207 2208 } 2209 2210 private string ModifyQueryStringValue(string p_query, string p_Name, string p_NewValue) 2211 { 2212 Uri uri = new Uri(p_query,UriKind.RelativeOrAbsolute); 2213 //if(p_query.Contains("http")) 2214 //{ 2215 //uri = new Uri(p_query); 2216 //} else { 2217 //uri = new Uri(p_query, UriKind.Relative); 2218 //} 2219 //uri = new Uri(p_query); 2220 2221 2222 2223 var nameValues = HttpUtility.ParseQueryString(uri.Query); 2224 nameValues.Set(p_Name, p_NewValue); 2225 string url = uri.AbsolutePath + "?" + nameValues.ToString(); 2226 return url; 2227 } 2228 } 2229 2230 @functions { 2231 public bool IsSearchResultsWithSingleResult(List<LoopItem> loopProduct) 2232 { 2233 var prodLoop = loopProduct.Where(x => !string.IsNullOrWhiteSpace(x.GetString("Ecom:Product.Number"))).GroupBy(x => x.GetString("Ecom:Product.ID")).ToList(); 2234 var prodLoopCount = prodLoop.Count; 2235 2236 // Recommended alternative is to check if the current page ID == PageIdByNavigationTag("SearchResults") instead of checking querystring parameters 2237 var str_keywordsParam = Dynamicweb.Context.Current.Request.Params["Keywords"] ?? ""; 2238 2239 return prodLoopCount == 1 && GetInteger("Ecom:ProductList.CurrentPage") == 1 && !string.IsNullOrWhiteSpace(str_keywordsParam); 2240 } 2241 2242 public string GetListViewValue() 2243 { 2244 //var listView = HttpContext.Current.Request.Cookies["dataList"] != null ? HttpContext.Current.Request.Cookies["dataList"].Value : ""; 2245 //listView = HttpContext.Current.Request.Params["altView"] != null ? (HttpContext.Current.Request.Params["altView"] == "detail" ? "detail" : "") : listView; 2246 var listView = HttpContext.Current.Request.Cookies["dataList"] != null ? HttpContext.Current.Request.Cookies["dataList"].Value : "list"; 2247 return listView; 2248 } 2249 2250 #region Redirect methods 2251 public void CheckIfRedirectShouldHappen() 2252 { 2253 if (IsExploreNewProductsPage()) 2254 { 2255 var 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")); 2256 if (Dynamicweb.Context.Current.Request.Params["altView"] == null && !String.IsNullOrEmpty(GetListViewValue())) 2257 { 2258 if(redirect.Contains("?")){ 2259 redirect = redirect + "&altView=detail"; 2260 } 2261 else{ 2262 redirect = redirect + "?altView=detail"; 2263 } 2264 } 2265 BioLegend.Shared.WebUtility.Redirect(Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(redirect)); 2266 } 2267 2268 if (GetLoop("Subgroups").Any()) 2269 { 2270 var redirect = "/" + Pageview.Area.Item["GroupsPage"] + "&GroupID=" + HttpContext.Current.Request.QueryString["GroupID"]; 2271 BioLegend.Shared.WebUtility.Redirect(redirect); 2272 } 2273 2274 if (MustRedirectToDetailView()) 2275 { 2276 var redirectURL = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetGlobalValue("Global:Pageview.Url.Raw").Replace("/Default.aspx", "Default.aspx")); 2277 if(redirectURL.Contains("?")){ 2278 redirectURL = redirectURL + "&altView=detail"; 2279 } 2280 else{ 2281 redirectURL = redirectURL + "?altView=detail"; 2282 } 2283 //redirectURL += "&altView=detail"; 2284 BioLegend.Shared.WebUtility.Redirect(redirectURL); 2285 } 2286 } 2287 2288 public bool IsExploreNewProductsPage() 2289 { 2290 return Pageview.Page.ID.ToString() != (Pageview.Area.Item["LiveSearchPage"] ?? "").ToString() && Pageview.Page.ID.ToString() == (Pageview.Area.Item["ExploreNewProducts"] ?? "").ToString() && (Dynamicweb.Context.Current.Request.QueryString["DateReleasedMin"] == null || Dynamicweb.Context.Current.Request.QueryString["DateReleasedMax"] == null); 2291 } 2292 2293 public bool MustRedirectToDetailView() 2294 { 2295 var currentView = GetListViewValue(); 2296 return Pageview.Page.ID.ToString() != (Pageview.Area.Item["LiveSearchPage"] ?? "").ToString() && Dynamicweb.Context.Current.Request.Params["altView"] == null && !currentView.Equals("list"); 2297 } 2298 #endregion 2299 } 2300 2301 @{ 2302 CheckIfRedirectShouldHappen(); 2303 2304 var loopProduct = GetLoop("Products"); 2305 var prodLoop = loopProduct.Where(x => !string.IsNullOrWhiteSpace(x.GetString("Ecom:Product.Number"))).GroupBy(x => x.GetString("Ecom:Product.ID")).ToList(); 2306 2307 if (IsSearchResultsWithSingleResult(loopProduct)) 2308 { 2309 var detailPageId = Pageview.Area.Item["ProductDetail"].ToString(); 2310 var singleProductResultsUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(String.Format("Default.aspx?ID={0}&ProductID={1}", detailPageId, prodLoop[0].Key)); 2311 2312 BioLegend.Shared.WebUtility.Redirect(singleProductResultsUrl); 2313 } 2314 else 2315 { 2316 var selectedListView = GetListViewValue() == "detail" ? "detailedView" : ""; 2317 @RenderProductListViewSelector() 2318 @RenderFacets() 2319 2320 <div class="col-xs-10 productArea noPaddingRight @(selectedListView)"> 2321 @RenderProductGroupDescription() 2322 @RenderSearchResultsNumbers(loopProduct) 2323 @RenderSortBy() 2324 @RenderPagination("col-xs-5 pull-right") 2325 @RenderSelectedFilters() 2326 @*@RenderDidYouMean()*@ 2327 <ul id="productsHolder" class="productList col-xs-12 noPadding"> 2328 @{ 2329 if (GetListViewValue() == "detail") 2330 { 2331 @RenderDetailView(prodLoop, loopProduct) 2332 } 2333 else 2334 { 2335 @RenderListView(prodLoop, loopProduct) 2336 } 2337 } 2338 </ul> 2339 @RenderResultPerPageOption() 2340 @RenderPagination("pageBottom pull-right col-xs-5") 2341 </div> 2342 2343 @SnippetStart("jsOnLoad") 2344 @: onLoadProductList(); 2345 @SnippetEnd("jsOnLoad") 2346 } 2347 } 2348 2349 @* START HACK 2350 <script> 2351 ////////////////////////////////////// 2352 //TEMP HACK to have v2 free text search to work, without breaking for all other pages 2353 ////////////////////////////////////// 2354 document.addEventListener("DOMContentLoaded", function (event) { 2355 const pageIdField = document.querySelector("input[name=ID]"); 2356 const ProductV2PageId = "37725"; 2357 pageIdField.value = ProductV2PageId; 2358 pageIdField.setAttribute("data-productsearch", ProductV2PageId).value = ProductV2PageId; 2359 }); 2360 </script> 2361 END HACK *@ 2362 2363
ProductsHere

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