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_1e34944dfeae43268fbdf7a4c26ffdac.<>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_1e34944dfeae43268fbdf7a4c26ffdac.<>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_1e34944dfeae43268fbdf7a4c26ffdac.<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_1e34944dfeae43268fbdf7a4c26ffdac.Execute() in f:\Domains\Sites\www.biolegend.com\Files\Templates\Designs\BioLegend\eCom\Productlist\productList_v2.cshtml:line 2295
   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 if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 680 { 681 num_getImageWidth = num_widthTablet != 0 ? num_widthTablet : num_getImageWidth; 682 num_getImageHeight = num_heightTablet != 0 ? num_heightTablet : num_getImageHeight; 683 } 684 else if (str_currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 685 { 686 num_getImageWidth = num_widthMobile != 0 ? num_widthMobile : num_getImageWidth; 687 num_getImageHeight = num_heightMobile != 0 ? num_heightMobile : num_getImageHeight; 688 } 689 690 if (num_getImageWidth != 0) 691 { 692 str_width = "&amp;Width=" + num_getImageWidth; 693 } 694 if (num_getImageHeight != 0) 695 { 696 str_height = "&amp;Height=" + num_getImageHeight; 697 } 698 699 string str_output = "/Admin/Public/GetImage.ashx?Image=" + str_source + str_width + str_height + "&amp;altFmImage_path=" + str_alternativeImage + str_getImageFormat + str_getImageCompression + "&amp;Crop=" + num_crop; 700 return str_output; 701 } 702 703 public Dictionary<string, string> GetProductTypes() 704 { 705 var productTypes = new Dictionary<string, string>(); 706 productTypes.Add("AncillaryProducts", "Ancillary"); 707 productTypes.Add("BuffersSolutionsChemicals", "Ancillary"); 708 productTypes.Add("CellBiologyAntibodies", "PrimaryAntibodies"); 709 productTypes.Add("CellSeparation", "MojoSort"); 710 productTypes.Add("CytokineChemokineAntibodies", "PrimaryAntibodies"); 711 productTypes.Add("ELISAMAXLEGENDMAX", "ELISA"); 712 productTypes.Add("EpitopeTagProducts", "PrimaryAntibodies"); 713 productTypes.Add("HumanImmunologyAntibodies", "PrimaryAntibodies"); 714 productTypes.Add("IsotypeControls", "IsotypeControls"); 715 productTypes.Add("LEGENDplex", "LEGENDplex"); 716 productTypes.Add("LEGENDScreen", "LEGENDScreen"); 717 productTypes.Add("MarmosetImmunologyAntibodies", "PrimaryAntibodies"); 718 productTypes.Add("MouseImmunologyAntibodies", "PrimaryAntibodies"); 719 productTypes.Add("NeuroscienceProducts", "PrimaryAntibodies"); 720 productTypes.Add("RatImmunologyAntibodies", "PrimaryAntibodies"); 721 productTypes.Add("RecombinantProteins", "Recombinant"); 722 productTypes.Add("SecondaryReagents", "SecondaryReagents"); 723 productTypes.Add("VirusImmunologyAntibodies", "PrimaryAntibodies"); 724 productTypes.Add("EnzymeAssays", "EnzymeAssays"); 725 productTypes.Add("FlexT", "FlexT"); 726 productTypes.Add("NonAntibodyChemicalProbes", "NonAntibodyChemicalProbes"); 727 728 return productTypes; 729 } 730 731 public string CalculateProductName(string prodName, string prodType, string prodFormat, bool excludeAntibody) 732 { 733 var cleanName = prodName; 734 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)) 735 { 736 cleanName += " Antibody"; 737 } 738 739 if (prodType.Equals("SecondaryReagents") && !prodName.Contains(" Antibody") && !prodName.Contains("Streptavidin") && !prodName.Contains("Avidin") && (!excludeAntibody)) 740 { 741 cleanName += " Antibody"; 742 } 743 744 if (prodType.Equals("IsotypeControls") && !prodName.Contains(" Antibody") && !prodName.Contains("Lineage Cocktail") && (!excludeAntibody)) 745 { 746 cleanName += " Antibody"; 747 } 748 749 return cleanName; 750 } 751 752 public static string RoundPrice(double price, bool isPriceInterestPointValue = true, bool roundPrice = true, bool showDecimals = false) 753 { 754 var priceDouble = price; 755 if(isPriceInterestPointValue) { 756 priceDouble = price * 0.01; 757 } 758 var isCurrencyJp = Dynamicweb.Ecommerce.Common.Context.Currency.CultureInfo == "ja-JP"; 759 /*var roundPriceDouble = Math.Round(priceDouble, 0, MidpointRounding.AwayFromZero);*/ 760 var roundPriceDouble = Math.Ceiling(priceDouble); 761 var roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString() : priceDouble.ToString()); 762 if(showDecimals == true){ 763 roundedPrice = isCurrencyJp ? price.ToString("#,##") : (roundPrice ? roundPriceDouble.ToString("#.##") : priceDouble.ToString("0.00")); 764 } 765 766 var priceWithSymbol = string.Empty; 767 var currencySymbol = Dynamicweb.Ecommerce.Common.Context.Currency.Symbol; 768 var positivePattern = Dynamicweb.Ecommerce.Common.Context.Currency.PositivePattern; 769 var symbolPlace = Dynamicweb.Ecommerce.Common.Context.Currency.SymbolPlace; 770 771 if (positivePattern == 3) 772 { 773 priceWithSymbol = String.Format("{0} {1}", currencySymbol, roundedPrice); 774 } 775 else if (positivePattern == 1) 776 { 777 priceWithSymbol = String.Format("{0} {1}", roundedPrice, currencySymbol); 778 } 779 else if (symbolPlace == 0 || positivePattern == 2) { 780 priceWithSymbol = String.Format("{0}{1}", currencySymbol, roundedPrice); 781 } 782 else 783 { 784 priceWithSymbol = String.Format("{0}{1}", roundedPrice, currencySymbol); 785 } 786 787 return priceWithSymbol; 788 } 789 790 public int GetPageIdFromSettings() 791 { 792 var pageId = GetModuleSettingsValue("ShowOnParagraph"); 793 if (pageId.IndexOf('#') > -1) 794 { 795 pageId = pageId.Substring(0, pageId.IndexOf('#')); 796 797 } 798 if (pageId.IndexOf("ID=", StringComparison.Ordinal) > -1) 799 { 800 pageId = pageId.Substring(pageId.IndexOf("ID=", StringComparison.Ordinal) + 3); 801 } 802 803 return Convert.ToInt32(pageId); 804 } 805 806 public string GetModuleSettingsValue(string property) 807 { 808 var moduleProperty = Pageview.CurrentParagraph.ModuleProperties.Values.Cast<DictionaryEntry>().FirstOrDefault(p => p.Key.ToString() == property); 809 return moduleProperty.Value.ToString(); 810 } 811 812 public int GetPunchoutPageIdForDetailsPage() 813 { 814 var punchoutDetailPageId = GetPageIdFromSettings(); 815 return punchoutDetailPageId != 0 ? punchoutDetailPageId : Pageview.Page.ID; 816 } 817 818 public string PreviousElement = ""; 819 } 820 821 @helper RenderDetailView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) 822 { 823 var itemsCount = 0; 824 foreach (var group in prodLoop) 825 { 826 itemsCount++; 827 @RenderDetailViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 828 } 829 } 830 831 @helper RenderListView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) { 832 @RenderProductListHeader() 833 var itemsCount = 0; 834 foreach (var group in prodLoop) 835 { 836 itemsCount++; 837 @RenderListViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 838 } 839 } 840 841 @helper RenderPunchoutListView(List<IGrouping<string, LoopItem>> prodLoop, List<LoopItem> loopProduct) { 842 @RenderProductListHeader() 843 var itemsCount = 0; 844 foreach (var group in prodLoop) 845 { 846 itemsCount++; 847 @RenderPunchoutListViewProduct(group, loopProduct, itemsCount, prodLoop.Count) 848 } 849 } 850 851 @helper RenderProductListHeader() 852 { 853 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 854 855 var str_sortBy = HttpContext.Current.Request.Params["SortBy"] ?? ""; 856 const string sortByName = "Name_sortable,Price"; 857 const string sortByClone = "Clone_Sort,Name_sortable,Price"; 858 const string sortByApplication = "AppAbrvString,Name_sortable,Price"; 859 const string sortByRegulatoryStatus = "CustomField_RegulatoryStatus,Name_sortable,Price"; 860 861 var sortByNameSelected = str_sortBy == sortByName ? "sortActive" : ""; 862 var sortByCloneSelected = (str_sortBy == sortByClone || str_sortBy == "") ? "sortActive" : ""; 863 var sortByApplicationsSelected = str_sortBy == sortByApplication ? "sortActive" : ""; 864 var sortByRegulatoryStatusSelected = str_sortBy == sortByRegulatoryStatus ? "sortActive" : ""; 865 866 <li class="col-xs-12 noPadding"> 867 <div class="col-xs-3 @sortByNameSelected"> 868 @Translate("Product", "Product") 869 </div> 870 871 <div class="col-xs-2 noPadding @sortByCloneSelected"> 872 @Translate("Clone", "Clone") 873 </div> 874 875 <div class="col-xs-1 noPadding @sortByApplicationsSelected"> 876 @Translate("Appl", "Appl.") 877 </div> 878 879 <div class="col-xs-1 @sortByRegulatoryStatusSelected"> 880 @Translate("Reg", "Reg") 881 </div> 882 883 <div class='@(!cartDisabled ? "col-xs-5" : "col-xs-5") noPadding'> 884 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 885 @Translate("categoryNumberShort", "Cat#") 886 </div> 887 888 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 889 @Translate("size", "Size") 890 </div> 891 892 @if (!cartDisabled) 893 { 894 <div class="col-xs-2 noPadding"> 895 @Translate("price", "Price") 896 </div> 897 898 <div class="col-xs-1 noPadding"> 899 @Translate("quantityHeader", "Quantity") 900 </div> 901 } 902 903 </div> 904 905 </li> 906 } 907 908 @helper RenderPunchoutListViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 909 { 910 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 911 var isCartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 912 var searchPageId = Pageview.Area.Item["Punchout_SearchResultPage"].ToString(); 913 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 914 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 915 var isExtranetUserLoggedIn = User.IsExtranetUserLoggedIn(); 916 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 917 var userCurrency = isExtranetUserLoggedIn ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 918 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 919 var isJapaneseSite = longLang.Equals("ja-JP"); 920 921 var colGroup = (!isCartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 922 923 <li class="col-xs-12"> 924 @if (itemsCount == 1) 925 { 926 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 927 } 928 <ul> 929 @foreach (var product in group) 930 { 931 var productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 932 var productId = product.GetString("Ecom:Product.ID"); 933 var productLink = product.GetString("Ecom:Product.Link.Clean"); 934 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 935 var regulatoryStatus = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.RegulatoryStatus.Value")) ? product.GetString("Ecom:Product:Field.RegulatoryStatus.Value") : "--"; 936 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 937 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 938 939 var productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 940 941 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 942 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 943 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 944 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 945 946 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 947 948 var shouldBlockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 949 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 950 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 951 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 952 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 953 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 954 bool requestQuote = product.GetBoolean("Ecom:Product:Field.RequestQuote.Value"); 955 956 var productVariantId = product.GetString("Ecom:Product.VariantID"); 957 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 958 959 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 960 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 961 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 962 963 <li class="row list" data-variantID="@productVariantId"> 964 @if (PreviousElement != productId) 965 { 966 <h2 class="col-xs-3"> 967 <a itemprop="name" href="@productLink"> 968 @productName 969 </a> 970 </h2> 971 972 <div class="col-xs-2 noPaddingLeft"> 973 @RenderCloneFieldForSearch(productClone, searchPageId, productCategory, productReactivity, "List") 974 </div> 975 976 <div class="col-xs-1 noPadding wordWrap"> 977 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 978 </div> 979 980 <div class="col-xs-1">@regulatoryStatus</div> 981 } 982 983 <div class='col-xs-5 noPadding @(PreviousElement == productId ? colGroup : "")'> 984 985 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 986 <input type="hidden" name="redirect" value="@(!isExtranetUserLoggedIn)"/> 987 <input type="hidden" name="cartcmd" value="add"/> 988 <input type="hidden" name="productid" value="@productId"/> 989 <input type="hidden" name="variantID" value="@productVariantId"/> 990 @if (!string.IsNullOrWhiteSpace(orderContext)) 991 { 992 <input type="hidden" name="OrderContext" value="@orderContext"/> 993 } 994 995 @* WebId Section *@ 996 @if (isJapaneseSite && (regulatoryStatus.Equals("IVD") || productId.Equals("11573"))) 997 { 998 <div class='@(!isCartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 999 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1000 </div> 1001 } 1002 else if (!isComingSoon) 1003 { 1004 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1005 @product.GetString("Ecom:Product.Number") 1006 </div> 1007 } 1008 else 1009 { 1010 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1011 @Translate("comingSoon", "Coming Soon") 1012 </div> 1013 } 1014 1015 @* Catalog number Section *@ 1016 <div class='@(!isCartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1017 @product.GetString("Ecom:Product.VariantText") 1018 </div> 1019 1020 @* Price Section *@ 1021 <div class='@(!isCartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1022 @if (isJapaneseSite && productFormat.Contains("GOINVIVO") && !productVariantId.Equals("5mg")) 1023 { 1024 @Translate("PleaseContactUs", "Please Contact Us") 1025 } 1026 else if (isJapaneseSite && shouldBlockAddToCart) 1027 { 1028 <div> 1029 <p class="coming-soon">@blockAddToCartText</p> 1030 </div> 1031 } 1032 else if (isJapaneseSite && @product.GetString("Ecom:Product.Number").Equals("423555")) 1033 { 1034 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, false, true)</span> 1035 } 1036 else if (requestQuote) 1037 { 1038 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1039 } 1040 else if (productId.Equals("10801") && !longLang.Equals("en-US")) 1041 { 1042 @Translate("addToCartForPrice", "Add to cart for price.") 1043 } 1044 else 1045 { 1046 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1047 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, false, true)</span> 1048 } 1049 </div> 1050 1051 @* Add to cart Section *@ 1052 @if (!isCartDisabled && !(productName.Contains("Flex-T") && productName.Contains("Custom"))) 1053 { 1054 <div class="col-xs-1 noPadding"> 1055 @if (!productVariantStatus.Equals(3) && !isComingSoon && !shouldBlockAddToCart) 1056 { 1057 <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"/> 1058 } 1059 </div> 1060 1061 <div class="col-xs-1"> 1062 @if (shouldBlockAddToCart) 1063 { 1064 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1065 <i class="fa fa-times-circle"></i> 1066 </button> 1067 } 1068 else if (productName.Contains("Capture Bead") || (productName.Contains("LEGENDplex") && (productName.Contains("Standard") || productName.Contains("Detection Antibodies") || productName.Contains("Detection Abs") || productName.Contains("Buffer Set")))) 1069 { 1070 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1071 <i class="fa fa-shopping-cart"></i> 1072 </button> 1073 } 1074 else if (isComingSoon) 1075 { 1076 @:&nbsp; 1077 } 1078 else if (userCurrency != siteCurrency) 1079 { 1080 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1081 <button type="submit" disabled> 1082 <i class="fa fa-shopping-cart"></i> 1083 </button> 1084 </span> 1085 } 1086 else if (string.IsNullOrWhiteSpace(productSource)) 1087 { 1088 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1089 <button type="submit" disabled> 1090 <i class="fa fa-shopping-cart"></i> 1091 </button> 1092 </span> 1093 } 1094 else 1095 { 1096 <button type="submit"> 1097 <i class="fa fa-shopping-cart"></i> 1098 </button> 1099 } 1100 </div> 1101 } 1102 </form> 1103 </div> 1104 </li> 1105 1106 PreviousElement = group.Key; 1107 } 1108 </ul> 1109 @if (itemsCount == prodLoopCount) 1110 { 1111 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 1112 } 1113 </li> 1114 } 1115 1116 @helper RenderListViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 1117 { 1118 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 1119 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 1120 var searchPageID = Pageview.Area.Item["SearchResults"].ToString(); 1121 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 1122 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 1123 var bol_userLogged = User.IsExtranetUserLoggedIn(); 1124 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 1125 var userCurrency = bol_userLogged ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 1126 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 1127 1128 var colGroup = (!cartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 1129 var productTypes = GetProductTypes(); 1130 1131 <li class="col-xs-12"> 1132 @if (itemsCount == 1) 1133 { 1134 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 1135 } 1136 <ul> 1137 @foreach (var product in group) 1138 { 1139 //var str_productName = product.GetString("Ecom:Product.Name"); 1140 var str_productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 1141 var str_productID = product.GetString("Ecom:Product.ID"); 1142 var str_link = "/Default.aspx?id=" + GetPageIdByNavigationTag("ProductDetail") + "&ProductId=" + str_productID; 1143 var excludeAB = product.GetBoolean("Ecom:Product:Field.ExcludeAB.Value"); 1144 var productType = product.GetString("Ecom:Product:Field.CMProductType.Value"); 1145 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 1146 var regulatoryStatus = product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"); 1147 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 1148 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 1149 1150 1151 var str_productImage = product.GetString("Ecom:Product.ImageSmall.Clean"); 1152 var str_productImageMedium = product.GetString("Ecom:Product.ImageMedium.Clean"); 1153 var str_productImageLarge = product.GetString("Ecom:Product.ImageLarge.Clean"); 1154 var str_productImage4 = product.GetString("Ecom:Product:Field.Image4Path.Value.Clean"); 1155 1156 var str_image1Description = product.GetString("Ecom:Product:Field.Image1Description.Value"); 1157 var str_image2Description = product.GetString("Ecom:Product:Field.Image2Description.Value"); 1158 var str_image3Description = product.GetString("Ecom:Product:Field.Image3Description.Value"); 1159 var str_image4Description = product.GetString("Ecom:Product:Field.Image4Description.Value"); 1160 1161 var str_image1Title = product.GetString("Ecom:Product:Field.Image1Title.Value"); 1162 var str_image2Title = product.GetString("Ecom:Product:Field.Image2Title.Value"); 1163 var str_image3Title = product.GetString("Ecom:Product:Field.Image3Title.Value"); 1164 var str_image4Title = product.GetString("Ecom:Product:Field.Image4Title.Value"); 1165 1166 var str_productImage5 = product.GetString("Ecom:Product:Field.Image5Path.Value.Clean"); 1167 var str_image5Description = product.GetString("Ecom:Product:Field.Image5Description.Value"); 1168 var str_image5Title = product.GetString("Ecom:Product:Field.Image5Title.Value"); 1169 1170 var str_productImage6 = product.GetString("Ecom:Product:Field.Image6Path.Value.Clean"); 1171 var str_image6Description = product.GetString("Ecom:Product:Field.Image6Description.Value"); 1172 var str_image6Title = product.GetString("Ecom:Product:Field.Image6Title.Value"); 1173 1174 var str_productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 1175 1176 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 1177 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 1178 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 1179 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 1180 1181 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 1182 1183 var blockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 1184 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 1185 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 1186 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 1187 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 1188 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 1189 bool requestQuote = product.GetBoolean("Ecom:Product:Field.RequestQuote.Value"); 1190 1191 var lst_images = new List<Tuple<string, string, string>>(); 1192 1193 if (!String.IsNullOrEmpty(str_productImage)) 1194 { 1195 lst_images.Add(new Tuple<string, string, string>(str_productImage, str_image1Title, str_image1Description)); 1196 } 1197 if (!String.IsNullOrEmpty(str_productImageMedium)) 1198 { 1199 lst_images.Add(new Tuple<string, string, string>(str_productImageMedium, str_image2Title, str_image2Description)); 1200 } 1201 if (!String.IsNullOrEmpty(str_productImageLarge)) 1202 { 1203 lst_images.Add(new Tuple<string, string, string>(str_productImageLarge, str_image3Title, str_image3Description)); 1204 } 1205 if (!String.IsNullOrEmpty(str_productImage4)) 1206 { 1207 lst_images.Add(new Tuple<string, string, string>(str_productImage4, str_image4Title, str_image4Description)); 1208 } 1209 if (!String.IsNullOrEmpty(str_productImage5)) 1210 { 1211 lst_images.Add(new Tuple<string, string, string>(str_productImage5, str_image5Title, str_image5Description)); 1212 } 1213 if (!String.IsNullOrEmpty(str_productImage6)) 1214 { 1215 lst_images.Add(new Tuple<string, string, string>(str_productImage6, str_image6Title, str_image6Description)); 1216 } 1217 1218 var str_productVariantID = product.GetString("Ecom:Product.VariantID"); 1219 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 1220 var productFieldType = ""; 1221 if (productTypes.ContainsKey(productType)) 1222 { 1223 productFieldType = productTypes[productType]; 1224 } 1225 1226 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1227 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 1228 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1229 1230 //str_productName = CalculateProductName(str_productName, productFieldType, str_productFormat, excludeAB); 1231 1232 <li class="row list" data-variantID="@str_productVariantID"> 1233 @if (PreviousElement != str_productID) 1234 { 1235 <h2 class="col-xs-3"> 1236 <a itemprop="name" href="@str_link"> 1237 @str_productName 1238 </a> 1239 </h2> 1240 1241 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-2") noPaddingLeft'> 1242 @RenderCloneFieldForSearch(productClone, searchPageID, productCategory, productReactivity, "List") 1243 </div> 1244 1245 <div class="col-xs-1 noPadding wordWrap"> 1246 <a href="@LocalizeLinksHTML("dwcountry/abbreviations")" target="_blank" title='@Translate("ViewAbbreviationDescriptions", "View abbreviation descriptions")'> 1247 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 1248 </a> 1249 </div> 1250 1251 <div class="col-xs-1"> 1252 @if (!String.IsNullOrWhiteSpace(regulatoryStatus)) 1253 { 1254 @regulatoryStatus 1255 } 1256 else 1257 { 1258 <text>--</text> 1259 } 1260 </div> 1261 } 1262 1263 <div class='@(!cartDisabled ? "col-xs-5" : "col-xs-5") noPadding @(PreviousElement == str_productID ? colGroup : "")'> 1264 1265 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1266 @if (bol_userLogged) 1267 { 1268 <input type="hidden" name="redirect" value="false"/> 1269 } 1270 <input type="hidden" name="cartcmd" value="add"/> 1271 <input type="hidden" name="productid" value="@str_productID"/> 1272 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1273 @if (!string.IsNullOrWhiteSpace(orderContext)) 1274 { 1275 <input type="hidden" name="OrderContext" value="@orderContext"/> 1276 } 1277 1278 @if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1279 { 1280 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1281 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1282 </div> 1283 } 1284 else 1285 { 1286 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1287 @if (!isComingSoon) 1288 { 1289 @product.GetString("Ecom:Product.Number") 1290 } 1291 else 1292 { 1293 @Translate("comingSoon", "Coming Soon") 1294 } 1295 </div> 1296 } 1297 1298 <div class='@(!cartDisabled ? "col-xs-3" : "col-xs-4") noPadding'> 1299 @product.GetString("Ecom:Product.VariantText") 1300 </div> 1301 1302 <div class='@(!cartDisabled ? "col-xs-2" : "col-xs-4") noPadding'> 1303 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GOINVIVO") && !str_productVariantID.Equals("5mg")) 1304 { 1305 @Translate("PleaseContactUs", "Please Contact Us") 1306 } 1307 else if (longLang.Equals("ja-JP") && blockAddToCart) 1308 { 1309 <div> 1310 <p class="coming-soon">@blockAddToCartText</p> 1311 </div> 1312 } 1313 else if (longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")) 1314 { 1315 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1316 } 1317 else if (requestQuote) 1318 { 1319 <div><a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a></div> 1320 } 1321 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1322 { 1323 @Translate("addToCartForPrice", "Add to cart for price.") 1324 } 1325 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1326 { 1327 } 1328 else if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1329 { 1330 } 1331 else 1332 { 1333 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1334 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1335 } 1336 </div> 1337 1338 @if (!cartDisabled && !(str_productName.Contains("Flex-T") && str_productName.Contains("Custom"))) 1339 { 1340 <div class="col-xs-1 noPadding"> 1341 @if (!productVariantStatus.Equals(3) && !isComingSoon && !blockAddToCart) 1342 { 1343 <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"/> 1344 } 1345 </div> 1346 1347 <div class="col-xs-1"> 1348 @if (blockAddToCart) 1349 { 1350 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1351 <i class="fa fa-times-circle"></i> 1352 </button> 1353 } 1354 else 1355 { 1356 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")))) 1357 { 1358 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1359 <i class="fa fa-shopping-cart"></i> 1360 </button> 1361 } 1362 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1363 { 1364 } 1365 else if ((longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) || (longLang.Equals("ja-JP") && str_productID.Equals("11573"))) 1366 { 1367 } 1368 else 1369 { 1370 if (isComingSoon) 1371 { 1372 @:&nbsp; 1373 } 1374 else if (userCurrency != siteCurrency) 1375 { 1376 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1377 <button type="submit" disabled> 1378 <i class="fa fa-shopping-cart"></i> 1379 </button> 1380 </span> 1381 } 1382 else if (string.IsNullOrWhiteSpace(productSource)) 1383 { 1384 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1385 <button type="submit" disabled> 1386 <i class="fa fa-shopping-cart"></i> 1387 </button> 1388 </span> 1389 } 1390 else 1391 { 1392 <button type="submit"> 1393 <i class="fa fa-shopping-cart"></i> 1394 </button> 1395 } 1396 } 1397 } 1398 </div> 1399 } 1400 </form> 1401 </div> 1402 </li> 1403 1404 PreviousElement = group.Key; 1405 } 1406 </ul> 1407 @if (itemsCount == prodLoopCount) 1408 { 1409 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 1410 } 1411 </li> 1412 } 1413 1414 @helper RenderDetailViewProduct(IGrouping<string, LoopItem> group, List<LoopItem> loopProduct, int itemsCount, int prodLoopCount) 1415 { 1416 var addToCart = Pageview.Area.Item["AddToCart"] != null ? Pageview.Area.Item["AddToCart"].ToString() : ""; 1417 var cartDisabled = Convert.ToBoolean(Pageview.Area.Item["DisableAddToCart"].ToString()); 1418 var searchPageID = Pageview.Area.Item["SearchResults"].ToString(); 1419 var orderContext = Pageview.Area.Item["OrderContext"] != null ? Pageview.Area.Item["OrderContext"].ToString() : ""; 1420 var navEnvironment = Pageview.Area.Item["NavEnvironment"] != null ? Pageview.Area.Item["NavEnvironment"].ToString() : ""; 1421 var bol_userLogged = User.IsExtranetUserLoggedIn(); 1422 var siteCurrency = PageView.Current().Area.EcomCurrencyId; 1423 var userCurrency = bol_userLogged ? User.GetCurrentUser(PagePermissionLevels.Frontend).Currency : siteCurrency; 1424 var longLang = (string) GetGlobalValue("Global:Area.LongLang"); 1425 1426 var colGroup = (!cartDisabled ? "col-xs-offset-7" : "col-xs-offset-7"); 1427 var productTypes = GetProductTypes(); 1428 1429 <li class="col-xs-12"> 1430 @if (itemsCount == 1) 1431 { 1432 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct, true) 1433 } 1434 <ul> 1435 @foreach (var product in group) 1436 { 1437 var str_starClass = ""; 1438 var str_halfStar = ""; 1439 1440 var str_productName = product.GetString("Ecom:Product:Field.ProductNameNormalized.Value"); 1441 var str_productID = product.GetString("Ecom:Product.ID"); 1442 var str_link = "/Default.aspx?id=" + GetPageIdByNavigationTag("ProductDetail") + "&ProductId=" + str_productID; 1443 var excludeAB = product.GetBoolean("Ecom:Product:Field.ExcludeAB.Value"); 1444 var productType = product.GetString("Ecom:Product:Field.CMProductType.Value"); 1445 var productCategory = product.GetString("Ecom:Product:Field.ProductCategory.Value"); 1446 var regulatoryStatus = product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"); 1447 var productClone = Regex.Replace(product.GetString("Ecom:Product:Field.Clone.Value"), "<!.*?>", String.Empty, RegexOptions.Singleline).Trim(); 1448 var productReactivity = product.GetString("Ecom:Product:Field.Reactivity.Value"); 1449 1450 var str_productImage = product.GetString("Ecom:Product.ImageSmall.Clean"); 1451 var str_productImageMedium = product.GetString("Ecom:Product.ImageMedium.Clean"); 1452 var str_productImageLarge = product.GetString("Ecom:Product.ImageLarge.Clean"); 1453 var str_productImage4 = product.GetString("Ecom:Product:Field.Image4Path.Value.Clean"); 1454 1455 var str_image1Description = product.GetString("Ecom:Product:Field.Image1Description.Value"); 1456 var str_image2Description = product.GetString("Ecom:Product:Field.Image2Description.Value"); 1457 var str_image3Description = product.GetString("Ecom:Product:Field.Image3Description.Value"); 1458 var str_image4Description = product.GetString("Ecom:Product:Field.Image4Description.Value"); 1459 1460 var str_image1Title = product.GetString("Ecom:Product:Field.Image1Title.Value"); 1461 var str_image2Title = product.GetString("Ecom:Product:Field.Image2Title.Value"); 1462 var str_image3Title = product.GetString("Ecom:Product:Field.Image3Title.Value"); 1463 var str_image4Title = product.GetString("Ecom:Product:Field.Image4Title.Value"); 1464 1465 var str_productImage5 = product.GetString("Ecom:Product:Field.Image5Path.Value.Clean"); 1466 var str_image5Description = product.GetString("Ecom:Product:Field.Image5Description.Value"); 1467 var str_image5Title = product.GetString("Ecom:Product:Field.Image5Title.Value"); 1468 1469 var str_productImage6 = product.GetString("Ecom:Product:Field.Image6Path.Value.Clean"); 1470 var str_image6Description = product.GetString("Ecom:Product:Field.Image6Description.Value"); 1471 var str_image6Title = product.GetString("Ecom:Product:Field.Image6Title.Value"); 1472 1473 var str_productGetImage = GetImage(str_productImage, 140, 0, 0, 0, 0, 0, "jpg", 90); 1474 var str_productGetImageMedium = GetImage(str_productImageMedium, 140, 0, 0, 0, 0, 0, "jpg", 90); 1475 var str_productGetImageLarge = GetImage(str_productImageLarge, 140, 0, 0, 0, 0, 0, "jpg", 90); 1476 var str_productGetImage4 = GetImage(str_productImage4, 140, 0, 0, 0, 0, 0, "jpg", 90); 1477 var str_productGetImage5 = GetImage(str_productImage5, 140, 0, 0, 0, 0, 0, "jpg", 90); 1478 var str_productGetImage6 = GetImage(str_productImage6, 140, 0, 0, 0, 0, 0, "jpg", 90); 1479 1480 var str_productFormat = product.GetString("Ecom:Product:Field.Format.Value"); 1481 1482 var stockUS = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUS.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUS.Value.Clean") : "0"; 1483 var stockUK = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockUK.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockUK.Value.Clean") : "0"; 1484 var stockEU = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockEU.Value.Clean")) ? product.GetString("Ecom:Product:Field.StockEU.Value.Clean") : "0"; 1485 var stockControl = product.GetString("Ecom:Product:Field.StockControl.Value.Clean"); 1486 1487 var isComingSoon = product.GetBoolean("Ecom:Product:Field.ComingSoon.Value"); 1488 var DCSoon = product.GetString("Ecom:Product:Field.DCSoon.Value"); 1489 1490 var blockAddToCart = product.GetBoolean("Ecom:Product:Field.BlockAddToCart.Value"); 1491 var blockAddToCartText = product.GetString("Ecom:Product:Field.BlockAddToCartText.Value"); 1492 blockAddToCartText = blockAddToCartText.Replace("'", "&apos;"); 1493 blockAddToCartText = blockAddToCartText.Replace("\r\n", ""); 1494 blockAddToCartText = blockAddToCartText.Replace("\r", ""); 1495 blockAddToCartText = blockAddToCartText.Replace("\n", ""); 1496 1497 var lst_images = new List<Tuple<string, string, string>>(); 1498 1499 if (!String.IsNullOrEmpty(str_productImage)) 1500 { 1501 lst_images.Add(new Tuple<string, string, string>(str_productImage, str_image1Title, str_image1Description)); 1502 } 1503 if (!String.IsNullOrEmpty(str_productImageMedium)) 1504 { 1505 lst_images.Add(new Tuple<string, string, string>(str_productImageMedium, str_image2Title, str_image2Description)); 1506 } 1507 if (!String.IsNullOrEmpty(str_productImageLarge)) 1508 { 1509 lst_images.Add(new Tuple<string, string, string>(str_productImageLarge, str_image3Title, str_image3Description)); 1510 } 1511 if (!String.IsNullOrEmpty(str_productImage4)) 1512 { 1513 lst_images.Add(new Tuple<string, string, string>(str_productImage4, str_image4Title, str_image4Description)); 1514 } 1515 if (!String.IsNullOrEmpty(str_productImage5)) 1516 { 1517 lst_images.Add(new Tuple<string, string, string>(str_productImage5, str_image5Title, str_image5Description)); 1518 } 1519 if (!String.IsNullOrEmpty(str_productImage6)) 1520 { 1521 lst_images.Add(new Tuple<string, string, string>(str_productImage6, str_image6Title, str_image6Description)); 1522 } 1523 1524 var str_productVariantID = product.GetString("Ecom:Product.VariantID"); 1525 var urlAction = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?ID=" + addToCart); 1526 var productFieldType = ""; 1527 if (productTypes.ContainsKey(productType)) 1528 { 1529 productFieldType = productTypes[productType]; 1530 } 1531 1532 var productStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1533 var productSource = product.GetString("Ecom:Product:Field.ProductSource.Value.Clean"); 1534 var productVariantStatus = product.GetInteger("Ecom:Product:Field.ProductStatus.Value.Clean"); 1535 1536 var requestQuote = GetBoolean("Ecom:Product:Field.RequestQuote"); 1537 1538 //str_productName = CalculateProductName(str_productName, productFieldType, str_productFormat, excludeAB); 1539 1540 <div class="row detailed"> 1541 @if (PreviousElement != str_productID) 1542 { 1543 <h2 class="col-xs-12"> 1544 <a itemprop="name" href="@str_link"> 1545 @str_productName 1546 </a> 1547 </h2> 1548 } 1549 1550 @if (PreviousElement != str_productID) 1551 { 1552 <div class="col-xs-7 noPadding"> 1553 <dl class="col-xs-12 noPadding"> 1554 @if (!string.IsNullOrWhiteSpace(productClone)) 1555 { 1556 <dt class="col-xs-6"> 1557 <b>@Translate("Clone", "Clone")</b> 1558 </dt> 1559 <dd class="col-xs-6"> 1560 @RenderCloneFieldForSearch(productClone, searchPageID, productCategory, productReactivity, "Detail") 1561 </dd> 1562 } 1563 1564 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.Specificity.Value"))) 1565 { 1566 <dt class="col-xs-6"> 1567 <b>@product.GetString("Ecom:Product:Field.Specificity.Name")</b> 1568 </dt> 1569 <dd class="col-xs-6"> 1570 @product.GetString("Ecom:Product:Field.Specificity.Value") 1571 </dd> 1572 } 1573 1574 @if (!string.IsNullOrWhiteSpace(productReactivity)) 1575 { 1576 <dt class="col-xs-6"> 1577 <b>@product.GetString("Ecom:Product:Field.Reactivity.Name")</b> 1578 </dt> 1579 <dd class="col-xs-6"> 1580 @productReactivity 1581 </dd> 1582 } 1583 1584 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.AppAbrv.Value"))) 1585 { 1586 <dt class="col-xs-6"> 1587 <b>@product.GetString("Ecom:Product:Field.Applications.Name")</b> 1588 </dt> 1589 <dd class="col-xs-6"> 1590 <a href="@LocalizeLinksHTML("dwcountry/abbreviations")" target="_blank" title='@Translate("ViewAbbreviationDescriptions", "View abbreviation descriptions")'> 1591 @product.GetString("Ecom:Product:Field.AppAbrv.Value") 1592 </a> 1593 </dd> 1594 } 1595 1596 @if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.RegulatoryStatus.Value"))) 1597 { 1598 <dt class="col-xs-6"> 1599 <b>@product.GetString("Ecom:Product:Field.RegulatoryStatus.Name")</b> 1600 </dt> 1601 <dd class="col-xs-6"> 1602 @product.GetString("Ecom:Product:Field.RegulatoryStatus.Value") 1603 </dd> 1604 } 1605 1606 @{ 1607 string pattern = @"\<[^>]*\>"; 1608 Regex rgx = new Regex(pattern); 1609 string otherNamesValue = rgx.Replace(product.GetString("Ecom:Product:Field.OtherNames.Value"), String.Empty); 1610 } 1611 @if (!String.IsNullOrWhiteSpace(otherNamesValue)) 1612 { 1613 <dt class="col-xs-6"> 1614 <b>@product.GetString("Ecom:Product:Field.OtherNames.Name")</b> 1615 </dt> 1616 <dd class="col-xs-6"> 1617 @product.GetString("Ecom:Product:Field.OtherNames.Value") 1618 </dd> 1619 } 1620 1621 @if (product.GetInteger("Ecom:Product.Rating") > 0) 1622 { 1623 <dt class="col-xs-6"> 1624 <b>@Translate("rating", "Rating")</b> 1625 </dt> 1626 <dd class="col-xs-6"> 1627 <ul class="rating"> 1628 @for (int s = 5; s > 0; s--) 1629 { 1630 if (s == Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))) 1631 { 1632 str_starClass = "class='star'"; 1633 str_halfStar = !(product.GetDouble("Ecom:Product.Rating") - Math.Round(product.GetDouble("Ecom:Product.Rating")) == 0) ? "fa-star-half" : "fa-star"; 1634 } 1635 else if (s > Math.Ceiling(product.GetDouble("Ecom:Product.Rating"))) 1636 { 1637 str_halfStar = "fa-star"; 1638 } 1639 else 1640 { 1641 str_starClass = ""; 1642 str_halfStar = "fa-star"; 1643 } 1644 1645 <li data-star="@s" @str_starClass> 1646 <i class="fa @str_halfStar"></i> 1647 </li> 1648 } 1649 </ul> 1650 </dd> 1651 } 1652 1653 </dl> 1654 </div> 1655 } 1656 1657 <div class="col-xs-5 noPadding"> 1658 @if (PreviousElement != str_productID) 1659 { 1660 string catNoLen = "col-xs-2"; 1661 if (longLang.Equals("ja-JP")) 1662 { 1663 catNoLen = "col-xs-4"; 1664 } 1665 else if (cartDisabled) 1666 { 1667 catNoLen = "col-xs-4"; 1668 } 1669 else 1670 { 1671 catNoLen = "col-xs-2"; 1672 } 1673 1674 <ul> 1675 <li> 1676 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1677 1678 <input type="hidden" name="redirect" value="false"/> 1679 <input type="hidden" name="cartcmd" value="add"/> 1680 <input type="hidden" name="productid" value="@str_productID"/> 1681 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1682 @if (!string.IsNullOrWhiteSpace(orderContext)) 1683 { 1684 <input type="hidden" name="OrderContext" value="@orderContext"/> 1685 } 1686 1687 <div class="@catNoLen noPadding paddingT40"> 1688 @if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1689 { 1690 <text>&nbsp;</text> 1691 } 1692 else 1693 { 1694 if (!isComingSoon) 1695 { 1696 @product.GetString("Ecom:Product.Number") 1697 } 1698 else 1699 { 1700 @Translate("comingSoon", "Coming Soon") 1701 } 1702 } 1703 </div> 1704 1705 <div class="col-xs-2 noPadding"> 1706 <span class="title"> 1707 <b>@Translate("size", "Size")</b> 1708 </span> 1709 @product.GetString("Ecom:Product.VariantText") 1710 </div> 1711 1712 <div class="col-xs-2 noPadding"> 1713 <span class="title" data-lang="@longLang" data-format="@str_productFormat" data-variant="@str_productVariantID"> 1714 <b>@Translate("price", "Price")</b> 1715 </span> 1716 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1717 { 1718 @Translate("PleaseContactUs", "Please Contact Us") 1719 } 1720 else if (longLang.Equals("ja-JP") && blockAddToCart) 1721 { 1722 <div> 1723 <p class="coming-soon">@blockAddToCartText</p> 1724 </div> 1725 } 1726 else if (longLang.Equals("ja-JP") && @product.GetString("Ecom:Product.Number").Equals("423555")) 1727 { 1728 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1729 } 1730 else if (requestQuote) 1731 { 1732 <div> 1733 <a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a> 1734 </div> 1735 } 1736 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1737 { 1738 @Translate("addToCartForPrice", "Add to cart for price.") 1739 } 1740 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1741 { 1742 } 1743 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1744 { 1745 } 1746 else 1747 { 1748 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1749 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1750 } 1751 </div> 1752 1753 @if (!cartDisabled && !(str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) && !(longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD"))) 1754 { 1755 <div class="col-xs-2 noPaddingRight"> 1756 <span class="title"> 1757 <b>@Translate("quantityVariant", "Quantity")</b> 1758 </span> 1759 @if (!productVariantStatus.Equals(3) && !isComingSoon && !blockAddToCart) 1760 { 1761 <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"/> 1762 } 1763 </div> 1764 1765 <div class="col-xs-4 addCartButtonArea"> 1766 @if (blockAddToCart) 1767 { 1768 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1769 <i class="fa fa-times-circle"></i> 1770 </button> 1771 } 1772 else 1773 { 1774 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")))) 1775 { 1776 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1777 <i class="fa fa-shopping-cart"></i> 1778 </button> 1779 } 1780 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1781 { 1782 } 1783 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1784 { 1785 } 1786 else 1787 { 1788 if (isComingSoon) 1789 { 1790 @:&nbsp; 1791 } 1792 else if (userCurrency != siteCurrency) 1793 { 1794 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("CurrencyMissmatch", "Your currency does not match the websites currency. Please navigate to the proper page."))"> 1795 <button type="submit" disabled> 1796 <i class="fa fa-shopping-cart"></i> 1797 </button> 1798 </span> 1799 } 1800 else if (string.IsNullOrWhiteSpace(productSource)) 1801 { 1802 <span class="inputSubmit" data-toggle="tooltip" title="@(Translate("ProductNotAvailable", "This product is not currently available."))"> 1803 <button type="submit" disabled> 1804 <i class="fa fa-shopping-cart"></i> 1805 </button> 1806 </span> 1807 } 1808 else 1809 { 1810 <button type="submit"> 1811 <i class="fa fa-shopping-cart"></i> 1812 </button> 1813 } 1814 } 1815 } 1816 </div> 1817 } 1818 </form> 1819 </li> 1820 @RenderSnippet("catalogVariants" + @str_productID) 1821 </ul> 1822 @SnippetStart("catalogVariants" + @str_productID) 1823 @SnippetEnd("catalogVariants" + @str_productID) 1824 1825 if (lst_images.Any()) 1826 { 1827 <div class="productDataImage col-xs-12 noPadding"> 1828 <h3>Product Data</h3> 1829 <ul class="col-xs-12 noPadding"> 1830 @if (!string.IsNullOrWhiteSpace(str_productImage)) 1831 { 1832 <li> 1833 <figure> 1834 <img class="img-responsive" src="@str_productGetImage" alt="@str_image1Title" title="@str_image1Title"/> 1835 </figure> 1836 </li> 1837 } 1838 1839 @if (!string.IsNullOrWhiteSpace(str_productImageMedium)) 1840 { 1841 <li> 1842 <figure> 1843 <img class="img-responsive" src="@str_productGetImageMedium" alt="@str_image2Title" title="@str_image2Title"/> 1844 </figure> 1845 </li> 1846 } 1847 1848 @if (!string.IsNullOrWhiteSpace(str_productImageLarge)) 1849 { 1850 <li> 1851 <figure> 1852 <img class="img-responsive" src="@str_productGetImageLarge" alt="@str_image3Title" title="@str_image3Title"/> 1853 </figure> 1854 </li> 1855 } 1856 1857 @if (!string.IsNullOrWhiteSpace(str_productImage4)) 1858 { 1859 <li> 1860 <figure> 1861 <img class="img-responsive" src="@str_productGetImage4" alt="@str_image4Title" title="@str_image4Title"/> 1862 </figure> 1863 </li> 1864 } 1865 1866 @if (!string.IsNullOrWhiteSpace(str_productImage5)) 1867 { 1868 <li> 1869 <figure> 1870 <img class="img-responsive" src="@str_productGetImage5" alt="@str_image5Title" title="@str_image5Title"/> 1871 </figure> 1872 </li> 1873 } 1874 1875 @if (!string.IsNullOrWhiteSpace(str_productImage6)) 1876 { 1877 <li> 1878 <figure> 1879 <img class="img-responsive" src="@str_productGetImage6" alt="@str_image6Title" title="@str_image6Title"/> 1880 </figure> 1881 </li> 1882 } 1883 1884 </ul> 1885 </div> 1886 } 1887 } 1888 else 1889 { 1890 @SnippetStart("catalogVariants" + @str_productID) 1891 string catNoLen = "col-xs-2"; 1892 if (longLang.Equals("ja-JP")) 1893 { 1894 catNoLen = "col-xs-4"; 1895 } 1896 else if (cartDisabled) 1897 { 1898 catNoLen = "col-xs-4"; 1899 } 1900 else 1901 { 1902 catNoLen = "col-xs-2"; 1903 } 1904 1905 <li> 1906 <form name="addToCart" class="add-to-cart col-xs-12 noPadding" action="@urlAction" method="POST"> 1907 1908 <input type="hidden" name="redirect" value="false"/> 1909 <input type="hidden" name="cartcmd" value="add"/> 1910 <input type="hidden" name="productid" value="@str_productID"/> 1911 <input type="hidden" name="variantID" value="@str_productVariantID"/> 1912 @if (!string.IsNullOrWhiteSpace(orderContext)) 1913 { 1914 <input type="hidden" name="OrderContext" value="@orderContext"/> 1915 } 1916 1917 <div class="@catNoLen noPadding"> 1918 @if (!isComingSoon) 1919 { 1920 @product.GetString("Ecom:Product.Number") 1921 } 1922 else 1923 { 1924 @Translate("comingSoon", "Coming Soon") 1925 } 1926 </div> 1927 1928 <div class="col-xs-2 noPadding"> 1929 @* str_productVariantName *@ 1930 @product.GetString("Ecom:Product.VariantText") 1931 </div> 1932 1933 <div class="col-xs-2 noPadding"> 1934 @if (longLang.Equals("ja-JP") && str_productFormat.Contains("GoInVivo") && !str_productVariantID.Equals("5mg")) 1935 { 1936 @Translate("PleaseContactUs", "Please Contact Us") 1937 } 1938 else if (requestQuote) 1939 { 1940 <div> 1941 <a href="@LocalizeLinksHTML("dwcountry/contact-local-rep")" target="_blank">Get a Quote</a> 1942 </div> 1943 } 1944 else if (longLang.Equals("ja-JP") && blockAddToCart) 1945 { 1946 <div> 1947 <p class="coming-soon">@blockAddToCartText</p> 1948 </div> 1949 } 1950 else if (str_productID.Equals("10801") && !longLang.Equals("en-US")) 1951 { 1952 @Translate("addToCartForPrice", "Add to cart for price.") 1953 } 1954 else 1955 { 1956 @* TODO: Revisit this with Sean Tucker. We may not need this workaround in DW9.9 *@ 1957 <span class="withBreak" itemprop="price">@RoundPrice(product.GetDouble("Ecom:Product.Price.PricePIP"), true, true, false)</span> 1958 } 1959 </div> 1960 1961 @if (!cartDisabled) 1962 { 1963 <div class="col-xs-2 noPaddingRight"> 1964 @if (!productVariantStatus.Equals(3) && !isComingSoon && string.IsNullOrEmpty(DCSoon) && !blockAddToCart) 1965 { 1966 <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"/> 1967 } 1968 </div> 1969 1970 <div class="col-xs-4"> 1971 @if (blockAddToCart) 1972 { 1973 <button onClick="alert('@blockAddToCartText'); return false;" title="@blockAddToCartText"> 1974 <i class="fa fa-times-circle"></i> 1975 </button> 1976 } 1977 else 1978 { 1979 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")))) 1980 { 1981 <button onClick="mixMatchProductRedirect('@longLang'); return false;" title="@Translate("mixAndMatch", "Mix & Match")"> 1982 <i class="fa fa-shopping-cart"></i> 1983 </button> 1984 } 1985 else if (str_productName.Contains("Flex-T") && str_productName.Contains("Custom")) 1986 { 1987 } 1988 else if (longLang.Equals("ja-JP") && regulatoryStatus.Equals("IVD")) 1989 { 1990 } 1991 else 1992 { 1993 if (isComingSoon) 1994 { 1995 @:&nbsp; 1996 } 1997 else if (userCurrency != siteCurrency) 1998 { 1999 <span class="inputSubmit" data-toggle="tooltip" title="Invalid currency"> 2000 <button type="submit" disabled> 2001 <i class="fa fa-shopping-cart"></i> 2002 </button> 2003 </span> 2004 } 2005 else if (string.IsNullOrWhiteSpace(productSource)) 2006 { 2007 <span class="inputSubmit" data-toggle="tooltip" title="This product is not currently available."> 2008 <button type="submit" disabled> 2009 <i class="fa fa-shopping-cart"></i> 2010 </button> 2011 </span> 2012 } 2013 else if (bol_userLogged) 2014 { 2015 <button type="submit"> 2016 <i class="fa fa-shopping-cart"></i> 2017 </button> 2018 } 2019 else 2020 { 2021 <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"> 2022 <i class="fa fa-shopping-cart"></i> 2023 </button> 2024 } 2025 } 2026 } 2027 </div> 2028 } 2029 </form> 2030 </li> 2031 2032 @SnippetEnd("catalogVariants" + @str_productID) 2033 } 2034 </div> 2035 </div> 2036 2037 PreviousElement = group.Key; 2038 } 2039 </ul> 2040 @if (itemsCount == prodLoopCount) 2041 { 2042 @ShowTextAboutMoreOptionsInPreviousOrNextPages(loopProduct) 2043 } 2044 </li> 2045 } 2046 2047 @helper ShowTextAboutMoreOptionsInPreviousOrNextPages(List<LoopItem> loopProduct, bool isToPageBefore = false) 2048 { 2049 if (loopProduct.Any()) 2050 { 2051 var countVariantsWithSameProdId = string.Empty; 2052 var countTotalOfVariantsForProd = string.Empty; 2053 var translateText = string.Empty; 2054 var positionClass = "moreVariantsBefore"; 2055 var totalPages = GetInteger("Ecom:ProductList.TotalPages"); 2056 2057 if (isToPageBefore) 2058 { 2059 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.First().GetString("Ecom:Product.ID")).Count().ToString(); 2060 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).First().ToString(); 2061 translateText = Translate("SeeMoreSizeOptionsForThisProductOnThePreviousPage", "See more size options for this product on the previous page."); 2062 } 2063 else 2064 { 2065 countVariantsWithSameProdId = loopProduct.Where(p => p.GetString("Ecom:Product.ID") == loopProduct.Last().GetString("Ecom:Product.ID")).Count().ToString(); 2066 countTotalOfVariantsForProd = loopProduct.Select(p => p.GetString("Ecom:Product.ActiveVariantCount")).Last().ToString(); 2067 translateText = Translate("SeeMoreSizeOptionsForThisProductOnTheNextPage", "See more size options for this product on the next page."); 2068 positionClass = "moreVariantsNext"; 2069 } 2070 2071 if (countVariantsWithSameProdId != countTotalOfVariantsForProd && totalPages > 1) 2072 { 2073 <div class="@positionClass col-xs-12">@translateText</div> 2074 } 2075 } 2076 } 2077 2078 @helper RenderCloneFieldForSearch(string clone, string spID, string pCat, string pReact, string searchType) 2079 { 2080 var cloneText = ""; 2081 if (!string.IsNullOrEmpty(clone)) 2082 { 2083 var thisClone = ""; 2084 if (clone.Contains(";")) 2085 { 2086 var clones = clone.Replace(" ", "").Split(';'); 2087 foreach (var x in clones) 2088 { 2089 var cloneHTML = HttpUtility.HtmlDecode(x); 2090 var cloneTag = "; "; 2091 thisClone += "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + x + "</a>" + cloneTag; 2092 } 2093 } 2094 else 2095 { 2096 var cloneHTML = HttpUtility.HtmlDecode(clone); 2097 if (pCat.Equals("RECOM_PRO")) 2098 { 2099 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 2100 } 2101 else 2102 { 2103 if (searchType == "Detail") 2104 { 2105 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\">" + clone + "</a>"; 2106 } 2107 else 2108 { 2109 thisClone = "<a href=\"/Default.aspx?ID=" + spID + "&amp;Clone=" + cloneHTML + "\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i> " + clone + "</a>"; 2110 } 2111 } 2112 } 2113 2114 cloneText += thisClone; 2115 } 2116 else if (!string.IsNullOrWhiteSpace(pReact) && !pCat.Equals("RECOM_PRO") && !searchType.Equals("Detail")) 2117 { 2118 cloneText += "<a href=\"javascript:void(0);\"><i class=\"bl bl-cloneIcon\" data-toggle=\"tooltip\" title=\"" + pReact + "\"></i></a>"; 2119 } 2120 2121 <text>@cloneText</text> 2122 } 2123 @using System.Collections.Specialized; 2124 @using System.Linq 2125 @functions { 2126 2127 public string LocalizeLinksHTML (string HtmlContent){ 2128 int areaID = Pageview.Area.ID; 2129 var area = Dynamicweb.Services.Areas.GetArea(areaID); 2130 string areaCulture = area.Culture.ToLower(); 2131 if(!string.IsNullOrEmpty(HtmlContent)){ 2132 if(HtmlContent.IndexOf("dwcountry") > -1){ 2133 return HtmlContent.Replace("dwcountry",areaCulture); 2134 } else{ 2135 return HtmlContent; 2136 } 2137 2138 } else { 2139 return HtmlContent; 2140 } 2141 2142 } 2143 2144 public string LocalizeLinks (string HtmlContent){ 2145 int areaID = Pageview.Area.ID; 2146 var area = Dynamicweb.Services.Areas.GetArea(areaID); 2147 string areaCulture = area.Culture.ToLower(); 2148 if(!string.IsNullOrEmpty(HtmlContent)){ 2149 if(HtmlContent.IndexOf("dwcountry") > -1){ 2150 return HtmlContent.Replace("dwcountry",areaCulture); 2151 } else if (HtmlContent.IndexOf("?ID=") > -1) { 2152 //do something 2153 string baseHref = String.Format("https://{0}",GetGlobalValue("Global:Request.Host")); 2154 HtmlContent = HtmlContent.Contains("http") ? HtmlContent : baseHref + "/" + HtmlContent; 2155 var uri = new Uri(HtmlContent,UriKind.RelativeOrAbsolute); 2156 var parsedQuery = HttpUtility.ParseQueryString(uri.Query); 2157 var pageID = parsedQuery.Get("ID"); 2158 2159 string pageVersionID = pageID; 2160 string localizedLink = HtmlContent; 2161 if (!string.IsNullOrEmpty(pageID)){ 2162 var pageService = new Dynamicweb.Content.PageService(); 2163 var linkPage = pageService.GetPagesByAreaID(areaID).FirstOrDefault(x => x.MasterPageId == int.Parse(pageID)); 2164 pageVersionID = linkPage != null ? linkPage.ID.ToString() : pageID ; 2165 2166 localizedLink = ModifyQueryStringValue(HtmlContent,"ID",pageVersionID); 2167 } 2168 //return string.Join(",", parsedQuery.AllKeys); 2169 //return string.Join(HtmlContent,"-",pageVersionID); 2170 return localizedLink; 2171 } else { 2172 return HtmlContent; 2173 } 2174 }else { 2175 return HtmlContent; 2176 } 2177 2178 } 2179 2180 private string ModifyQueryStringValue(string p_query, string p_Name, string p_NewValue) 2181 { 2182 Uri uri = new Uri(p_query,UriKind.RelativeOrAbsolute); 2183 //if(p_query.Contains("http")) 2184 //{ 2185 //uri = new Uri(p_query); 2186 //} else { 2187 //uri = new Uri(p_query, UriKind.Relative); 2188 //} 2189 //uri = new Uri(p_query); 2190 2191 2192 2193 var nameValues = HttpUtility.ParseQueryString(uri.Query); 2194 nameValues.Set(p_Name, p_NewValue); 2195 string url = uri.AbsolutePath + "?" + nameValues.ToString(); 2196 return url; 2197 } 2198 } 2199 2200 @functions { 2201 public bool IsSearchResultsWithSingleResult(List<LoopItem> loopProduct) 2202 { 2203 var prodLoop = loopProduct.Where(x => !string.IsNullOrWhiteSpace(x.GetString("Ecom:Product.Number"))).GroupBy(x => x.GetString("Ecom:Product.ID")).ToList(); 2204 var prodLoopCount = prodLoop.Count; 2205 2206 // Recommended alternative is to check if the current page ID == PageIdByNavigationTag("SearchResults") instead of checking querystring parameters 2207 var str_keywordsParam = Dynamicweb.Context.Current.Request.Params["Keywords"] ?? ""; 2208 2209 return prodLoopCount == 1 && GetInteger("Ecom:ProductList.CurrentPage") == 1 && !string.IsNullOrWhiteSpace(str_keywordsParam); 2210 } 2211 2212 public string GetListViewValue() 2213 { 2214 //var listView = HttpContext.Current.Request.Cookies["dataList"] != null ? HttpContext.Current.Request.Cookies["dataList"].Value : ""; 2215 //listView = HttpContext.Current.Request.Params["altView"] != null ? (HttpContext.Current.Request.Params["altView"] == "detail" ? "detail" : "") : listView; 2216 var listView = HttpContext.Current.Request.Cookies["dataList"] != null ? HttpContext.Current.Request.Cookies["dataList"].Value : "list"; 2217 return listView; 2218 } 2219 2220 #region Redirect methods 2221 public void CheckIfRedirectShouldHappen() 2222 { 2223 if (IsExploreNewProductsPage()) 2224 { 2225 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")); 2226 if (Dynamicweb.Context.Current.Request.Params["altView"] == null && !String.IsNullOrEmpty(GetListViewValue())) 2227 { 2228 if(redirect.Contains("?")){ 2229 redirect = redirect + "&altView=detail"; 2230 } 2231 else{ 2232 redirect = redirect + "?altView=detail"; 2233 } 2234 } 2235 BioLegend.Shared.WebUtility.Redirect(Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(redirect)); 2236 } 2237 2238 if (GetLoop("Subgroups").Any()) 2239 { 2240 var redirect = "/" + Pageview.Area.Item["GroupsPage"] + "&GroupID=" + HttpContext.Current.Request.QueryString["GroupID"]; 2241 BioLegend.Shared.WebUtility.Redirect(redirect); 2242 } 2243 2244 if (MustRedirectToDetailView()) 2245 { 2246 var redirectURL = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(GetGlobalValue("Global:Pageview.Url.Raw").Replace("/Default.aspx", "Default.aspx")); 2247 if(redirectURL.Contains("?")){ 2248 redirectURL = redirectURL + "&altView=detail"; 2249 } 2250 else{ 2251 redirectURL = redirectURL + "?altView=detail"; 2252 } 2253 //redirectURL += "&altView=detail"; 2254 BioLegend.Shared.WebUtility.Redirect(redirectURL); 2255 } 2256 } 2257 2258 public bool IsExploreNewProductsPage() 2259 { 2260 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); 2261 } 2262 2263 public bool MustRedirectToDetailView() 2264 { 2265 var currentView = GetListViewValue(); 2266 return Pageview.Page.ID.ToString() != (Pageview.Area.Item["LiveSearchPage"] ?? "").ToString() && Dynamicweb.Context.Current.Request.Params["altView"] == null && !currentView.Equals("list"); 2267 } 2268 #endregion 2269 } 2270 2271 @{ 2272 CheckIfRedirectShouldHappen(); 2273 2274 var loopProduct = GetLoop("Products"); 2275 var prodLoop = loopProduct.Where(x => !string.IsNullOrWhiteSpace(x.GetString("Ecom:Product.Number"))).GroupBy(x => x.GetString("Ecom:Product.ID")).ToList(); 2276 2277 if (IsSearchResultsWithSingleResult(loopProduct)) 2278 { 2279 var detailPageId = Pageview.Area.Item["ProductDetail"].ToString(); 2280 var singleProductResultsUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(String.Format("Default.aspx?ID={0}&ProductID={1}", detailPageId, prodLoop[0].Key)); 2281 2282 BioLegend.Shared.WebUtility.Redirect(singleProductResultsUrl); 2283 } 2284 else 2285 { 2286 var selectedListView = GetListViewValue() == "detail" ? "detailedView" : ""; 2287 @RenderProductListViewSelector() 2288 @RenderFacets() 2289 2290 <div class="col-xs-10 productArea noPaddingRight @(selectedListView)"> 2291 @RenderProductGroupDescription() 2292 @RenderSearchResultsNumbers(loopProduct) 2293 @RenderSortBy() 2294 @RenderPagination("col-xs-5 pull-right") 2295 @RenderSelectedFilters() 2296 @*@RenderDidYouMean()*@ 2297 <ul id="productsHolder" class="productList col-xs-12 noPadding"> 2298 @{ 2299 if (GetListViewValue() == "detail") 2300 { 2301 @RenderDetailView(prodLoop, loopProduct) 2302 } 2303 else 2304 { 2305 @RenderListView(prodLoop, loopProduct) 2306 } 2307 } 2308 </ul> 2309 @RenderResultPerPageOption() 2310 @RenderPagination("pageBottom pull-right col-xs-5") 2311 </div> 2312 2313 @SnippetStart("jsOnLoad") 2314 @: onLoadProductList(); 2315 @SnippetEnd("jsOnLoad") 2316 } 2317 } 2318 2319 @* START HACK 2320 <script> 2321 ////////////////////////////////////// 2322 //TEMP HACK to have v2 free text search to work, without breaking for all other pages 2323 ////////////////////////////////////// 2324 document.addEventListener("DOMContentLoaded", function (event) { 2325 const pageIdField = document.querySelector("input[name=ID]"); 2326 const ProductV2PageId = "37725"; 2327 pageIdField.value = ProductV2PageId; 2328 pageIdField.setAttribute("data-productsearch", ProductV2PageId).value = ProductV2PageId; 2329 }); 2330 </script> 2331 END HACK *@ 2332 2333
ProductsHere

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