| 0
|

Error executing template "Designs/PLC/eCom/Productlist/PLCProductList.cshtml"
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at CompiledRazorTemplates.Dynamic.RazorEngine_c62dbd2cf0b44dd2bdd58c1ee35f1145.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in E:\www\uat.petloverscentre.co.th\Solution\Files\Templates\Designs\PLC\eCom\Productlist\PLCProductList.cshtml:line 397
   at CompiledRazorTemplates.Dynamic.RazorEngine_c62dbd2cf0b44dd2bdd58c1ee35f1145.Execute() in E:\www\uat.petloverscentre.co.th\Solution\Files\Templates\Designs\PLC\eCom\Productlist\PLCProductList.cshtml:line 1932
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using Newtonsoft.Json.Linq; 2 @using System.Web 3 4 @using System.Text.RegularExpressions 5 @using System.Web 6 7 8 @functions{ 9 public class WrapMethods 10 { 11 12 13 //Gets the contrasting color 14 public static string getContrastYIQ(string hexcolor) 15 { 16 if (hexcolor != "") 17 { 18 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 19 20 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 21 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 22 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 23 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 24 25 if (yiq >= 128) 26 { 27 return "black"; 28 } 29 else 30 { 31 return "white"; 32 } 33 } 34 else 35 { 36 return "black"; 37 } 38 } 39 40 41 //Truncate text 42 public static string Truncate (string value, int count, bool strip=true) 43 { 44 if (strip == true){ 45 value = StripHtmlTagByCharArray(value); 46 } 47 48 if (value.Length > count) 49 { 50 value = value.Substring(0, count - 1) + "..."; 51 } 52 53 return value; 54 } 55 56 57 //Strip text from HTML 58 public static string StripHtmlTagByCharArray(string htmlString) 59 { 60 char[] array = new char[htmlString.Length]; 61 int arrayIndex = 0; 62 bool inside = false; 63 64 for (int i = 0; i < htmlString.Length; i++) 65 { 66 char let = htmlString[i]; 67 if (let == '<') 68 { 69 inside = true; 70 continue; 71 } 72 if (let == '>') 73 { 74 inside = false; 75 continue; 76 } 77 if (!inside) 78 { 79 array[arrayIndex] = let; 80 arrayIndex++; 81 } 82 } 83 return new string(array, 0, arrayIndex); 84 } 85 86 //Make the correct count of columns 87 public static string ColumnMaker(int Col, string ScreenSize) 88 { 89 string Columns = ""; 90 91 switch (Col) 92 { 93 case 1: 94 Columns = "col-"+ScreenSize+"-12"; 95 break; 96 97 case 2: 98 Columns = "col-"+ScreenSize+"-6"; 99 break; 100 101 case 3: 102 Columns = "col-"+ScreenSize+"-4"; 103 break; 104 105 case 4: 106 Columns = "col-"+ScreenSize+"-3"; 107 break; 108 109 default: 110 Columns = "col-"+ScreenSize+"-3"; 111 break; 112 } 113 114 return Columns; 115 } 116 117 118 private string Custom(string firstoption, string secondoption) 119 { 120 if (firstoption == "custom") 121 { 122 return secondoption; 123 } 124 else 125 { 126 return firstoption; 127 } 128 } 129 } 130 } 131 @using DWAPAC.PLC.Services 132 @using Dynamicweb.Security.UserManagement.Common.CustomFields 133 134 135 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 136 <script type="text/javascript" src="/Files/Templates/Designs/PLC/eCom/ProductList/Compare.js"></script> 137 <style> 138 .ui-dialog-titlebar, .ui-dialog-buttonset button{ 139 background:#662010; 140 color: #FFF; 141 } 142 .clearfix{ 143 margin-bottom: -10px !important; 144 } 145 146 #myBtn { 147 display: none; 148 position: fixed; 149 bottom: 55px; 150 right: 9%; 151 z-index: 99; 152 font-size: 18px; 153 border: none; 154 outline: none; 155 color: white; 156 cursor: pointer; 157 padding: 15px; 158 border-radius: 4px; 159 background-image: url(/Files/Templates/Designs/PLC/assets/images/up_arrow_icon.png); 160 background-size: 35px; 161 width: 35px; 162 height: 35px; 163 } 164 165 .product-box .prod-img img { 166 display: block; 167 margin: 0px auto; 168 } 169 .prod-pbox{ 170 height:115px; 171 } 172 /*::before { 173 padding-top:0.5em; 174 }commented out By AKS due to menu collapsing problem */ 175 input[type=number]::-webkit-inner-spin-button, 176 input[type=number]::-webkit-outer-spin-button { 177 -webkit-appearance: none; 178 -moz-appearance: none; 179 appearance: none; 180 margin: 0; 181 } 182 @if(GetInteger("Ecom:ProductList.PageProdCnt") > 0) 183 { 184 <text> 185 .btn-addto-cart { 186 margin-bottom:5px; 187 background-color: #ad2d14; 188 height:38px; 189 border-radius: 3px; 190 } 191 .btn-addto-cart:hover { 192 //background-color: #500d00; 193 } 194 .glyphicon-minus, .glyphicon-plus { 195 cursor: pointer; 196 color: #ffffff; 197 } 198 </text> 199 if(System.Web.HttpContext.Current.Request.Browser.Type.ToUpper().Contains("SAFARI")) 200 { 201 <text> 202 .btn-addto-cart div a, .btn-addto-cart a { 203 line-height: 36px; 204 } 205 #addtocartLink { 206 margin-top: 30px !important; 207 } 208 @@media screen (max-width: 340px){ 209 .btn-addto-cart div a, .btn-addto-cart a { 210 padding-top: 0px; 211 } 212 } 213 .fixsize { 214 margin-top: 120px; 215 } 216 </text> 217 } 218 else 219 { 220 221 } 222 } 223 else 224 { 225 if(System.Web.HttpContext.Current.Request.Browser.Type.ToUpper().Contains("SAFARI")) 226 { 227 <text> 228 .btn-addto-cart div a, .btn-addto-cart a { 229 line-height: 36px; 230 } 231 #addtocartLink { 232 margin-top: 30px !important; 233 } 234 @@media screen (max-width: 340px){ 235 .btn-addto-cart div a, .btn-addto-cart a { 236 padding-top: 0px; 237 } 238 } 239 </text> 240 } 241 else 242 { 243 244 } 245 } 246 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) { 247 .mblAddTo { 248 padding-left:30px !important; 249 } 250 } 251 @@media screen and (max-width: 700px) and (min-width: 375px) and (max-height: 700px) { 252 .mblpromologo { 253 padding-bottom:2px; 254 } 255 } 256 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) { 257 .mblpromologo1 { 258 padding-bottom:-5px; 259 } 260 } 261 @@media screen and (max-width: 800px) and (min-width: 768px) and (max-height: 1024px) { 262 .mblPromologoipad { 263 padding-bottom:5px; 264 } 265 } 266 @@media screen and (max-width: 1024px) and (min-width: 768px) and (max-height: 800px) { 267 .mblPromologoipad1 { 268 padding-bottom:5px; 269 } 270 } 271 @@media screen and (max-width: 800px) and (min-width: 760px) and (max-height: 1200px) { 272 .mblPromologolap { 273 padding-bottom:2px; 274 } 275 } 276 277 278 @@media screen and (max-width: 800px) and (min-width: 700px) and (max-height: 1030px) { 279 .mblAddTo { 280 padding-left:70px !important; 281 } 282 } 283 284 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) { 285 .btn-sale{ 286 position: absolute; 287 z-index: 10; 288 right: 10px; 289 width: 80px; 290 padding-top: 8px !important; 291 } 292 } 293 </style> 294 295 @helper GetProductList(dynamic Loop,bool birthday,string becomeAMemberPrice, int ColMD=3, int ColSM=3, int ColXS=1) 296 { 297 298 var birthday0 = false; 299 bool showBirthdayPrice = false; 300 bool userHasVIPCard = false; 301 bool userHasValidVipCard = false; 302 DateTime expDate = new DateTime(); 303 DateTime today = DateTime.Now; 304 305 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 306 { 307 int i = Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID")); 308 Dynamicweb.Security.UserManagement.User u = Dynamicweb.Security.UserManagement.User.GetUserByID(i); 309 310 foreach (CustomFieldValue val in u.CustomFieldValues) 311 { 312 CustomField field = val.CustomField; 313 string fieldName = field.Name; 314 315 if(fieldName == "DOB") 316 { 317 DateTime bDay = new DateTime(); 318 if(val.Value != null) 319 { 320 bDay = (DateTime)val.Value; 321 if(bDay.Month == today.Month) 322 { 323 birthday0 = true; 324 } 325 } 326 } 327 if(fieldName=="ExpryDate") 328 { 329 expDate=(DateTime)val.Value; 330 } 331 332 switch (fieldName.ToUpper()) 333 { 334 case "VIP CARD NO": 335 userHasVIPCard = !string.IsNullOrEmpty((val.Value).ToString()); 336 break; 337 case "EXPRYDATE": 338 userHasValidVipCard = expDate.Date < today.Date; 339 break; 340 default: 341 break; 342 } 343 } 344 } 345 showBirthdayPrice = birthday0 && userHasVIPCard && userHasValidVipCard; 346 347 string pathproduct="/Files/Images/plc"; 348 string imgpath="/Files/Images/Ecom/Products/"; 349 string imgpathpng=""; 350 string pidString = ""; 351 var loopCounter = 0; 352 List<string>statusList = new List<string>(); 353 354 foreach(LoopItem product1 in Loop) 355 { 356 string pid1 = product1.GetString("Ecom:Product.ID"); 357 pidString += "[" + pid1 + "],"; 358 } 359 pidString = pidString.Remove(pidString.Length - 1); 360 pidString = "{" + pidString; 361 pidString = pidString + "}"; 362 363 var response = WebServices.getProductMultiStatusAdvServiceResponse(pidString); 364 365 var responseSplit = response.Split(';'); 366 if (responseSplit[0].Contains("500")) 367 { 368 <style> 369 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) { 370 .mainImg{ 371 padding-left: 85px; 372 } 373 } 374 375 @@media screen and (max-width: 700px) and (min-width: 600px) and (max-height: 400px) { 376 .mainImg{ 377 padding-left: 222px; 378 } 379 } 380 </style> 381 if(Pageview.Device.ToString().ToUpper() == "MOBILE") 382 { 383 <div style="padding-left: 60px;" name="under_maintenance"> 384 <img src="/Files/Templates/Designs/PLC/assets/images/under_maintenance_icon.png" class="mainImg" alt="Under Maintenance"><br><br> 385 <span style="font-size: 20px;font-weight: 700;">Sorry, we are facing a temporary server error. Please try again later.</span> 386 </div> 387 }else if(Pageview.Device.ToString().ToUpper() == "TABLET") 388 { 389 <div name="under_maintenance"><img src="/Files/Templates/Designs/PLC/assets/images/under_maintenance_icon.png" alt="Under Maintenance"><span style="padding-left: 15px; font-size: 20px; font-weight: 700;">Sorry, we are facing a temporary server error. Please try again later.</span></div> 390 }else{ 391 <div style="padding-left: 60px;" name="under_maintenance"><img src="/Files/Templates/Designs/PLC/assets/images/under_maintenance_icon.png" alt="Under Maintenance"><span style="padding-left: 15px; font-size: 20px; font-weight: 700;">Sorry, we are facing a temporary server error. Please try again later.</span></div> 392 } 393 return; 394 } 395 396 397 string productResponse = responseSplit[2].Split('{')[1].Replace("}",""); 398 399 var singleProduct = productResponse.Split(','); 400 for(var i =0; i < singleProduct.Length; i++) 401 { 402 string string1 = singleProduct[i].Remove(singleProduct[i].Length-1).Remove(0,1); 403 statusList.Add(string1.Split(':')[1]); 404 } 405 if (responseSplit[0].Contains("200")) 406 { 407 foreach (LoopItem product in Loop) 408 { 409 string pid=product.GetString("Ecom:Product.ID"); 410 //Promotion 411 412 string promoName = ""; 413 string promoD = ""; 414 List<string> productPromoNames=new List<string>(); 415 var promosqlString = "SELECT ED.DISCOUNTNAME,ED.DISCOUNTDESCRIPTION FROM EcomDiscountExtensions EDEs INNER JOIN EcomDiscount ED ON EDEs.DISCOUNTID = ED.DISCOUNTID WHERE EDEs.DISCOUNTDISPLAYATPDP = 'True' and ED.DiscountActive = 'True' and (GetDate() BETWEEN ED.DiscountValidFrom AND ED.DiscountValidTo) and ED.DISCOUNTPRODUCTSANDGROUPS LIKE '%p:" + pid + ",%'"; 416 using(System.Data.IDataReader promoNameReder = Dynamicweb.Data.Database.CreateDataReader(promosqlString)) 417 { 418 while (promoNameReder.Read()) 419 { 420 promoName += promoNameReder["DISCOUNTNAME"].ToString(); 421 promoD += promoNameReder["DISCOUNTDESCRIPTION"].ToString() + "<br>"; 422 } 423 } 424 string Image = product.GetString("Ecom:Product.ImageSmall.Default.Clean"); 425 string Link = product.GetString("Ecom:Product.Link.Clean"); 426 string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); 427 string Name = product.GetString("Ecom:Product.Name"); 428 Name = Name.Replace("\"","&#10078;"); 429 GroupLink = "Default.aspx?ID=" + GetPageIdByNavigationTag("Products") + "&ProductID=" + pid; 430 string Number = product.GetString("Ecom:Product.Number"); 431 string ProdBrand = product.GetString("Ecom:Product:Field.ProductBrand"); 432 imgpath = "/Files/Images/Ecom/Products/" + pid + ".jpg"; 433 imgpathpng = "/Files/Images/Ecom/Products/" + pid + ".png"; 434 var absolutePathjpg = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpath); 435 var absolutePathpng = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpathpng); 436 if(System.IO.File.Exists(absolutePathjpg)) 437 { 438 Image=imgpath; 439 } 440 else if(System.IO.File.Exists(absolutePathpng)) 441 { 442 Image=imgpathpng; 443 } 444 445 string Description = product.GetString("Ecom:Product.ShortDescription"); 446 string Discount = product.GetString("Ecom:Product.Discount.Price"); 447 string Price = product.GetString("Ecom:Product.Price"); 448 string CurrencyCode = product.GetString("Ecom:Product.Price.Currency.Code"); 449 //string Promotion=product.GetString("Ecom:Product.Price"); 450 string Active=product.GetString("Ecom:Product.IsActive"); 451 var Rating=product.GetDouble("Ecom:Product.Rating"); 452 453 var sellingPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSPrice"))*1000/5)/200; 454 var internetPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSInternetPrice"))*1000/5)/200; 455 var price=9.95; 456 457 if(price==product.GetDouble("Ecom:Product:Field.ProductSInternetPrice")) 458 { 459 internetPrice= product.GetDouble("Ecom:Product:Field.ProductSInternetPrice"); 460 } 461 Boolean inventoryDiscount = product.GetBoolean("Ecom:Product:Field.ProductInventoryDiscountFlag"); 462 var discountPercentage = product.GetDouble("Ecom:Product:Field.ProductInventoryDiscount"); 463 var birthdayPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSBirthdayPrice"))*1000/5)/200; 464 var memberPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSMemberPrice"))*1000/5)/200; 465 var disable=product.GetBoolean("Ecom:Product:Field.Disable"); 466 var promotion=0.00; 467 var discountType=""; 468 var promoNames = ""; 469 var testingNames = ""; 470 foreach(var promoItem in product.GetLoop("AllDiscounts")) 471 { 472 promoNames += promoItem.GetString("Ecom:AllDiscounts.Discount.Name") +"<br>"; 473 } 474 foreach (LoopItem item in product.GetLoop("ProductDiscounts")) 475 { 476 477 if(item.GetString("Ecom:Product.Discount.Type")=="PERCENT") 478 { 479 discountType="PERCENT"; 480 promotion=item.GetDouble("Ecom:Product.Discount.PercentWithoutVATFormatted"); 481 } 482 else 483 { 484 discountType="AMOUNT"; 485 promotion=item.GetDouble("Ecom:Product.Discount.AmountWithoutVATFormatted"); 486 } 487 } 488 489 string sellingPriceStr = ((sellingPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice) : string.Format("{0:0}", sellingPrice); 490 string internetPriceStr = ((internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", internetPrice) : string.Format("{0:0}", internetPrice); 491 string savePriceStr = ((sellingPrice-internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice-internetPrice) : string.Format("{0:0.00}", sellingPrice-internetPrice); 492 string memberPriceStr = ((memberPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", memberPrice) : string.Format("{0:0}", memberPrice); 493 string birthdayPriceStr = ((birthdayPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", birthdayPrice) : string.Format("{0:0}", birthdayPrice); 494 495 if(pid != "PROD1" && pid !="PROD2") 496 { 497 <!--product start--> 498 if(!disable) 499 { 500 <div class="product-box col-1-3 tab-col-1-2 mobile-col-1-1" id="get_@pid"> 501 <div class="prod-img"> 502 @if(promotion != 0) 503 { 504 if(discountType == "PERCENT") 505 { 506 <div class="ribbon-P"><span>@promotion% Off</span></div> 507 } 508 else 509 { 510 <div class="ribbon-P"><span>@product.GetString("Ecom:Product.Currency.Symbol")@promotion Off</span></div> 511 } 512 } 513 else 514 { 515 //add ERP discount ribbon 516 if(inventoryDiscount) 517 { 518 if(discountPercentage != 0) 519 { 520 <div class="ribbon-D"><span>@discountPercentage% Off</span></div> 521 } 522 } 523 } 524 <a href="@GroupLink" title="@Name"> 525 <img src="/Admin/Public/Getimage.ashx?width=147&amp;compression=60&amp;Crop=5&amp;image=@Image" class="img-responsive" id="img_@pid" alt="@Name @Number" title="@Name @Number"> 526 </a> 527 </div> 528 <p class="prod-name">@ProdBrand 529 <br/> @product.GetString("Ecom:Product.Name") 530 </p> 531 532 533 @if(promoName != "") 534 { 535 <span class="top tipso_style" data-tipso='@promoName.Replace("\"", "&quot;").Replace("'","&#39;").Replace("<","&lt;").Replace(">","&gt;")'> 536 @if(GetGlobalValue("Global:Extranet.UserName")!= ""){ 537 <div style="background: linear-gradient(to right, #ec5a11 , #f4a413 ); text-align: center; font-size: medium; color: white; font-weight: 600; margin-bottom: inherit;">@Translate("PROMOTION")</div> 538 539 540 } 541 else{ 542 543 <div class="mblpromologo mblpromologo1 mblPromologoipad mblPromologoipad1 mblPromologolap" style="background: linear-gradient(to right, #ec5a11 , #f4a413 ); text-align: center; font-size: medium; color: white; font-weight: 600; margin-bottom: inherit;"><img src="/Files/Templates/Designs/PLC/assets/images/login_promo.png" style="padding-bottom:2px;"> @Translate("LOGIN PROMO")</div> 544 545 } 546 </span> 547 }else{ 548 <div style="background: white; text-align: center; font-size: medium; color: white; font-weight: 600; margin-bottom: inherit; padding-bottom: 3px;"></div> 549 } 550 <div class="prod-star" style="display:none;"> 551 @if(@Rating == 0) 552 { 553 <label class = "starUnselected"></label> 554 <label class = "starUnselected"></label> 555 <label class = "starUnselected"></label> 556 <label class = "starUnselected"></label> 557 <label class = "starUnselected"></label> 558 } 559 @if(Rating % 1 != 0) 560 { 561 for(var i = 1; i < @Rating; i++) 562 { 563 <label class = "starSelected"></label> 564 } 565 <label class = "starSelected half"></label> 566 } 567 else 568 { 569 for(var i = 1; i < @Rating+1; i++) 570 { 571 <label class = "starSelected"></label> 572 } 573 } 574 575 576 </div> 577 <div class="prod-pbox"> 578 @if(inventoryDiscount) 579 { 580 if(sellingPrice != internetPrice) 581 { 582 <div class="prod-price"> 583 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 584 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p> 585 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p> 586 </div> 587 } 588 else if(sellingPrice == internetPrice) 589 { 590 <div class="prod-price"> 591 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 592 </div> 593 } 594 <div style="height:65px;">@* Add gap to fix aligment *@ 595 <div class="member-price"></div> 596 </div> 597 } 598 @*inventoryDiscount false*@ 599 else 600 { 601 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 602 { 603 @*<div class="prod-price"> 604 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 605 </div>*@ 606 607 if(sellingPrice != internetPrice) 608 { 609 <div class="prod-price"> 610 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 611 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p> 612 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p> 613 </div> 614 } 615 else if(sellingPrice == internetPrice) 616 { 617 <div class="prod-price"> 618 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 619 </div> 620 } 621 622 <div style="height:65px;"> 623 <div class="member-price"> 624 @if(memberPrice > 0) 625 { 626 <div id="proId" style="display:none"></div> 627 <div class="title" id="memberId">@Translate("VIP Member")&nbsp; 628 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @product.GetString("Ecom:Product.Currency.Symbol") 100 & @Translate("log in to your web account to enjoy this price")"> 629 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span> 630 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p> 631 </div> 632 <div class="title" id="birthdayId" >@Translate("VIP Birthday")&nbsp; 633 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @product.GetString("Ecom:Product.Currency.Symbol") 100 & @Translate("log in to your web account to enjoy this price on your birthday month")"> 634 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span> 635 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p> 636 </div> 637 638 } 639 @if(birthdayPrice > 0 && showBirthdayPrice) 640 { 641 <div class="title">@Translate("VIP Birthday")&nbsp; 642 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @product.GetString("Ecom:Product.Currency.Symbol") 100 & @Translate("enjoy this price on your birthday month")"> 643 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span> 644 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p> 645 </div> 646 } 647 </div> 648 </div> 649 } 650 else if(Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 651 { 652 @*<div class="prod-price"> 653 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p> 654 </div>*@ 655 656 if(sellingPrice != internetPrice) 657 { 658 <div class="prod-price"> 659 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 660 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p> 661 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p> 662 </div> 663 } 664 else if(sellingPrice == internetPrice) 665 { 666 <div class="prod-price"> 667 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p> 668 </div> 669 } 670 671 if(userHasVIPCard) 672 { 673 if(userHasValidVipCard) 674 { 675 <div id="proId" style="display:none"></div> 676 <div style="height:65px;"> 677 <div class="member-price"> 678 <div class="title" id="memberId" >@Translate("VIP Member")&nbsp; 679 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price"> 680 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span> 681 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p> 682 </div> 683 <div class="title" id="birthdayId">@Translate("VIP Birthday")&nbsp; 684 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price on your birthday month"> 685 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span> 686 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p> 687 </div> 688 </div> 689 </div> 690 } 691 692 if(!birthday) 693 { 694 if(!userHasValidVipCard) 695 { 696 <div style="height:65px;"> 697 <div class="member-price"> 698 @if(memberPrice > 0) 699 { 700 <div class="title" id="memberId">@Translate("VIP Member")&nbsp; 701 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price " > 702 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span> 703 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p> 704 </div> 705 } 706 </div> 707 </div> 708 } 709 } 710 else if (birthday) 711 { 712 if(!userHasValidVipCard) 713 { 714 <div style="height:65px;"> 715 <div class="member-price"> 716 <div class="title" id="birthdayId">@Translate("VIP Birthday")&nbsp; 717 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price on your birthday month"> 718 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon_info"></span> 719 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p> 720 </div> 721 </div> 722 </div> 723 } 724 } 725 } 726 else 727 { 728 if(memberPrice > 0) 729 { 730 <div id="proId" style="display:none"></div> 731 <div style="height:65px;"> 732 <div class="member-price"> 733 <div class="title" id="memberId" >@Translate("VIP Member")&nbsp; 734 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @product.GetString("Ecom:Product.Currency.Symbol") 100 & @Translate("log in to your web account to enjoy this price") "> 735 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span> 736 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p> 737 </div> 738 <div class="title" id="birthdayId">@Translate("VIP Birthday")&nbsp; 739 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @product.GetString("Ecom:Product.Currency.Symbol") 100 & @Translate("log in to your web account to enjoy this price on your birthday month")"> 740 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span> 741 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p> 742 </div> 743 </div> 744 </div> 745 } 746 } 747 } 748 } 749 </div> 750 <!-------------------------------------------------------End Pricing----------------------------------------------------------------------------------------------------> 751 <hr> 752 @{ 753 string tipsoMessage = "no Message Available!"; 754 tipsoMessage = statusList[loopCounter]; 755 switch (statusList[loopCounter].ToUpper()) 756 { 757 case "AVAILABLE" : 758 //tipsoMessage = "Stocks are available, with the earliest delivery within 2 working days from the date of order."; 759 tipsoMessage = Translate("Stocks are available, with the earliest delivery within 3 working days from the date of order."); 760 break; 761 case "SPECIAL ORDER" : 762 //tipsoMessage = "We will check physical stocks availability before confirming your order."; 763 //tipsoMessage = Translate("Stocks are subject to supplier's availability. For more details, please contact") + " Customer Care hotline: 02-170-7979 / Line OA : @plcthailand"; 764 tipsoMessage = Translate("SPECIAL ORDER Tooltip_Message"); 765 break; 766 case "IN STOCK" : 767 tipsoMessage = Translate("Stocks are available at our retail stores for delivery within 7 working days upon receipt of payment."); 768 break; 769 default : 770 tipsoMessage = "no Message Available!"; 771 break; 772 } 773 tipsoMessage = tipsoMessage.Replace("\'", "&#39;"); 774 <ul class="info"> 775 <li>*@Translate(statusList[loopCounter])<span class="top tipso_style" data-tipso='@tipsoMessage' style="vertical-align: text-bottom;"> 776 <img src="@pathproduct/images/icon_question_mark.png" alt="icon info" title="" style="width:10px;"> 777 </span></li> 778 </ul> 779 if(statusList[loopCounter].ToUpper() == "SPECIAL ORDER") 780 { 781 <ul class="info" style="line-height: 32.7px;"> 782 <li>*@Translate("NOT AVAILABLE ONLINE")</li> 783 </ul> 784 } 785 } 786 @if(statusList[loopCounter].ToUpper() != "SPECIAL ORDER") 787 { 788 <div class="btn-addto-cart smalldev"> 789 <div class="col-md-6 col-sm-6 col-xs-6" style="padding: 5px 0px; border-radius: 3px 0px 0px 3px; text-align: center;display: table-cell;vertical-align: middle;"> 790 <span onclick='QtyControlBtn("quantityInput_@pid", "-");' type="button" data-value="-1" data-target="#spinner2" data-toggle="spinner"> 791 <span class="glyphicon glyphicon-minus"></span> 792 </span> 793 <input type="number" onkeydown='QtyKeyControl("quantityInput_@pid", "keydown");' onkeyup='QtyKeyControl("quantityInput_@pid", "keyup");' onfocusout='return QtyKeyControl("quantityInput_@pid", "focusout");' class="selectbox-qty" style="width:50px;text-align:center;" id="quantityInput_@pid" value="1" min="1" max="9999"> 794 <span onclick='QtyControlBtn("quantityInput_@pid", "+");' type="button" data-value="2" data-target="#spinner2" data-toggle="spinner"> 795 <span class="glyphicon glyphicon-plus"></span> 796 </span> 797 </div> 798 <div class="col-md-6 col-sm-6 col-xs-6 mblAddTo" style="padding: 1px 5px;display: table-cell;"> 799 <a onclick='ShowAddedItem_Then_AjaxAddToCart(" ", "@pid", "@ProdBrand.Replace(" & ", " myAND ")", "@product.GetString("Ecom:Product.Name").Replace(" & ", " myAND ").Replace("\"", "")", "@product.GetString("Ecom:Product.Price.PriceWithVAT")", "@product.GetString("Ecom:Product.Price.Currency.Symbol")", $("#quantityInput_" + "@pid").val(), true, "&cartcmd=add&productid=@pid&quantity=","@product.GetString("Ecom:Product.Number")");' href='javascript:void(0)' style="border-radius: 0px 3px 3px 0px;"> 800 <i class="fa fa-shopping-cart"></i> 801 @Translate("Add to cart") 802 </a> 803 </div> 804 </div> 805 } 806 else 807 { 808 <div class="btn-addto-cart" style="margin-bottom:5px; cursor:not-allowed; display:none;"> 809 <a ><i class="fa fa-shopping-cart"></i> In Store Only </a> 810 </div> 811 } 812 <!--<div class="btn-addto-cart smalldev" style="margin-bottom:5px;"> 813 <a href="@GroupLink"><i class="fa fa-search-plus"></i> View products details </a> 814 </div>--> 815 <div class="prod-compare" style="height : 35px;"> 816 @{ 817 string productname = product.GetString("Ecom:Product.Name"); 818 productname = productname.Replace("\"","&#10078;"); 819 } 820 <form> 821 <label>@Translate("Compare") 822 <input type="checkbox" id='@product.GetString("Ecom:Product.CompareID")' name="compareproduct" onclick="compareProducts('@product.GetString("Ecom:Product.CompareID")', '@productname', '@product.GetString("Ecom:Product.LinkGroup.Clean")',$(this).prop('checked'));$('html, body').animate({scrollTop: $('.compare-box').offset().top}, 500);"> 823 <span></span> 824 </label> 825 </form> 826 </div> 827 </div> 828 } 829 <!--product end--> 830 } 831 loopCounter++; 832 } 833 } 834 <div onclick="topFunction()" id="myBtn" title="Go to top"></div> 835 } 836 <script> 837 function topFunction() { 838 //document.body.scrollTop = 0; 839 //document.documentElement.scrollTop = 0; 840 $('html, body').animate({ scrollTop: 0 }, 'fast') 841 } 842 843 window.onscroll = function() {scrollFunction()}; 844 845 function scrollFunction() { 846 if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 847 document.getElementById("myBtn").style.display = "block"; 848 } else { 849 document.getElementById("myBtn").style.display = "none"; 850 } 851 } 852 </script> 853 <script type="text/javascript" src="/Files/Templates/Designs/PLC/eCom/ProductList/Compare.js"></script> 854 855 <style> 856 .smallText { 857 font-size: 14px; 858 font-weight: bold; 859 } 860 861 .product-box .prod-compare label{ 862 display: inline; 863 } 864 .btn-addto-cart { 865 height: 37px !important; 866 } 867 @@media (max-width: 768px) { 868 .category-title { 869 margin-top: 0px; 870 } 871 } 872 .backBtn { 873 margin-top: -10px;margin-bottom: 10px; 874 } 875 @@media (max-width: 738px) { 876 .backBtn { 877 margin-top: 10px; 878 } 879 } 880 881 .clearfix{ 882 margin-bottom: -10px; 883 } 884 885 .current1{ 886 margin-left: 217px; 887 } 888 889 .current2{ 890 margin-left: 158px; 891 } 892 893 .current3{ 894 margin-left: 131px; 895 } 896 897 .current4{ 898 margin-left: 103px; 899 } 900 901 .current5{ 902 margin-left: 75px; 903 } 904 905 .current6{ 906 margin-left: 51px; 907 } 908 909 .destopcurrent2{ 910 margin-left: 350px; 911 } 912 913 .destopcurrent3{ 914 margin-left: 300px; 915 } 916 917 .destopcurrent4{ 918 margin-left: 250px; 919 } 920 921 .destopcurrent5{ 922 margin-left: 200px; 923 } 924 925 .destopcurrent6{ 926 margin-left: 150px; 927 } 928 929 .commoncurrent{ 930 margin-left: 221px; 931 } 932 933 .total1{ 934 margin-left: 163px; 935 } 936 937 .total2{ 938 margin-left: 134px; 939 } 940 941 .total3{ 942 margin-left: 106px; 943 } 944 945 .total4{ 946 margin-left: 79px; 947 } 948 949 .total5{ 950 margin-left: 79px; 951 } 952 953 .commontotal{ 954 margin-left: 51px; 955 } 956 957 .currenttotal1{ 958 margin-left: 400px; 959 } 960 961 .currenttotal2{ 962 margin-left: 304px; 963 } 964 965 .currenttotal3{ 966 margin-left: 292px; 967 } 968 969 .currenttotal4{ 970 margin-left: 278px; 971 } 972 973 .currenttotal5{ 974 margin-left: 256px; 975 } 976 977 .currenttotal6{ 978 margin-left: 238px; 979 } 980 981 @@media only screen and (max-width: 850px){ 982 .mblpagination{ 983 margin-left: unset !important; 984 } 985 } 986 987 @@media screen and (max-width: 1050px) and (min-width: 1000px) and (max-height: 800px) { 988 .currenttotal1{ 989 margin-left: 310px !important; 990 } 991 992 .currenttotal2{ 993 margin-left: 250px !important; 994 } 995 996 .currenttotal3{ 997 margin-left: 220px !important; 998 } 999 1000 .currenttotal4{ 1001 margin-left: 195px !important; 1002 } 1003 1004 .currenttotal5{ 1005 margin-left: 170px !important; 1006 } 1007 1008 .currenttotal6{ 1009 margin-left: 135px !important; 1010 } 1011 1012 .total6current2{ 1013 margin-left: 185px; 1014 } 1015 1016 .total6current3{ 1017 margin-left: 166px; 1018 } 1019 1020 .total6current4{ 1021 margin-left: 130px; 1022 } 1023 1024 .total6current5{ 1025 margin-left: 100px; 1026 } 1027 1028 .total6current6{ 1029 margin-left: 100px; 1030 } 1031 1032 .current1{ 1033 margin-left: 125px; 1034 } 1035 1036 .current2{ 1037 margin-left: 70px; 1038 } 1039 1040 .current3{ 1041 margin-left: 40px; 1042 } 1043 1044 .current4{ 1045 margin-left: 12px; 1046 } 1047 1048 .current5{ 1049 margin-left: -15px; 1050 } 1051 1052 .current6{ 1053 margin-left: -40px; 1054 } 1055 1056 .commoncurrent{ 1057 margin-left: 128px; 1058 } 1059 1060 .total1{ 1061 margin-left: 70px; 1062 } 1063 1064 .total2{ 1065 margin-left: 45px; 1066 } 1067 1068 .total3{ 1069 margin-left: 16px; 1070 } 1071 1072 .total4{ 1073 margin-left: -10px; 1074 } 1075 1076 .total5{ 1077 margin-left: -15px; 1078 } 1079 1080 .commontotal{ 1081 margin-left: -42px; 1082 } 1083 } 1084 </style> 1085 1086 @{ 1087 string sqlString = "SELECT BecomeAMemberPrice FROM ItemType_PLC_WebSite_Settings"; 1088 string becomeAMemberPrice = ""; 1089 using (System.Data.IDataReader myImageReader = Dynamicweb.Data.Database.CreateDataReader(sqlString.ToString())) 1090 { 1091 while (myImageReader.Read()) 1092 { 1093 becomeAMemberPrice = myImageReader["BecomeAMemberPrice"].ToString(); 1094 } 1095 } 1096 1097 var birthday = false; 1098 bool showBirthdayPrice1 = false; 1099 bool userHasVIPCard1 = false; 1100 bool userHasValidVipCard1 = false; 1101 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 1102 { 1103 int i = Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID")); 1104 1105 Dynamicweb.Security.UserManagement.User u = Dynamicweb.Security.UserManagement.User.GetUserByID(i); 1106 1107 foreach (CustomFieldValue val in u.CustomFieldValues) 1108 { 1109 CustomField field = val.CustomField; 1110 1111 string fieldName = field.Name; 1112 1113 if(fieldName == "DOB") 1114 { 1115 DateTime today = DateTime.Now; 1116 DateTime bDay = new DateTime(); 1117 if(val.Value != null) 1118 { 1119 bDay = (DateTime)val.Value; 1120 if(bDay.Month == today.Month) 1121 { 1122 birthday = true; 1123 } 1124 } 1125 } 1126 switch (fieldName.ToUpper()) 1127 { 1128 case "VIP CARD NO": 1129 userHasVIPCard1 = !string.IsNullOrEmpty((val.Value).ToString()); 1130 break; 1131 case "EXPRYDATE": 1132 userHasValidVipCard1 = DateTime.Now.Month <= ((DateTime)val.Value).Month; 1133 break; 1134 default: 1135 break; 1136 } 1137 } 1138 } 1139 showBirthdayPrice1 = birthday && userHasVIPCard1 && userHasValidVipCard1; 1140 1141 string grouplink = ""; 1142 1143 if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) 1144 { 1145 grouplink = "/Default.aspx?ID=" + GetValue("Ecom:ProductList:Page.ID") + "&amp;GroupID=" + GetValue("Ecom:ProductList:Page.GroupID"); 1146 } 1147 else 1148 { 1149 grouplink = "&amp;eComQuery=" + GetValue("Ecom:ProductList:Search.Query"); 1150 } 1151 var strUrl = System.Web.HttpContext.Current.Request.RawUrl.ToString() ; 1152 string[] words = strUrl.Split('/'); 1153 var firstgroup =System.Web.HttpContext.Current.Request.Params["firstgroup"]; 1154 var secondgroup = System.Web.HttpContext.Current.Request.Params["secondgroup"]; 1155 var thirdgroup = System.Web.HttpContext.Current.Request.Params["thirdgroup"]; 1156 @*var firstgroup =words[2]; 1157 var secondgroup = words[3]; 1158 var thirdgroup = words[4];*@ 1159 var grouptext = ""; 1160 1161 if (!string.IsNullOrWhiteSpace(firstgroup) && !string.IsNullOrWhiteSpace(secondgroup) && !string.IsNullOrWhiteSpace(thirdgroup)) 1162 { 1163 grouptext = thirdgroup; 1164 } 1165 else if(!string.IsNullOrWhiteSpace(firstgroup) && !string.IsNullOrWhiteSpace(secondgroup)){ 1166 grouptext = secondgroup; 1167 } 1168 else{ 1169 grouptext = firstgroup; 1170 } 1171 1172 var totalPages = GetInteger("Ecom:ProductList.TotalPages"); 1173 var currentPage = GetInteger("Ecom:ProductList.CurrentPage"); 1174 var noOfPages = 3; 1175 var currentPageLink = ""; 1176 var blankLink = ""; 1177 var otherLink = ""; 1178 if(totalPages != 0){ 1179 1180 1181 foreach (LoopItem page in GetLoop("Ecom:ProductList.Pages")) 1182 { 1183 if (page.GetBoolean("Ecom:ProductList.Pages.Page.IsCurrent")){ 1184 1185 currentPageLink = page.GetString("Ecom:ProductList.Pages.Page.Url"); 1186 } 1187 } 1188 var firstSplit = currentPageLink.Split(new string[] { "PageNum=" }, StringSplitOptions.None); 1189 blankLink =firstSplit[0]; 1190 1191 if(firstSplit[1].Contains("&")){ 1192 string[] split = firstSplit[1].Split(new char[] { '&' }, 2); 1193 otherLink = "&"+split[1]; 1194 } 1195 } 1196 1197 object objShowH1Title = false; 1198 bool showH1TitleFlag = false; 1199 Dynamicweb.Frontend.PageView.Current().Page.PropertyItem.TryGetValue("Show_H1_Title", ref objShowH1Title); ///with 9.6.10 1200 //Dynamicweb.Frontend.PageView.Current().Page.PropertyItem.TryGetValue("Show_H1_Title", out objShowH1Title); ///with 9.10.17 1201 showH1TitleFlag = objShowH1Title != null ? bool.Parse(objShowH1Title.ToString()) : false; 1202 } 1203 1204 <script> 1205 $( document ).ready(function() { 1206 document.cookie = "sortby="; 1207 Compare.writecompare(); 1208 if(getQueryStringValue("SortBy")){ 1209 var selectedVal = getQueryStringValue("SortBy") + "&SortOrder=" + getQueryStringValue("SortOrder") 1210 $('#sortSelect').val(selectedVal); 1211 }else{ 1212 //$('#sortSelect').val('PleaseSelect'); 1213 } 1214 }); 1215 function getCookie(name){ 1216 var pattern = RegExp(name + "=.[^;]*") 1217 matched = document.cookie.match(pattern) 1218 1219 if (matched) { 1220 var cookie = matched[0].split('=') 1221 return cookie[1] 1222 } 1223 return false 1224 } 1225 1226 </script> 1227 @{ 1228 string pathproduct = "/Files/Images/plc/"; 1229 } 1230 1231 <div class="col-3-12"> 1232 <div class="backBtn"> 1233 <span onclick="window.location.assign(document.referrer);" style="padding-left:30px; font-weight:bold;cursor:pointer;"><img src="/Files/Templates/Designs/PLC/assets/images/backarrow.png" style="width:20px;padding-bottom:3px;"> @Translate("Back")</span> 1234 </div> 1235 <div class="category-title col-1-1"> 1236 <div class="smallText">@Translate("Filter by"):</div> 1237 </div> 1238 <div class="category-box col-1-1"> 1239 <div class="smallText">@Translate("Filter by"):</div> 1240 <hr class="grey"> 1241 @{ 1242 string stringGroupID = ""; 1243 if(GetString("Ecom:ProductList:Page.ID") != "298") 1244 { 1245 foreach(var productGroup in GetLoop("ProductGroups")) 1246 { 1247 stringGroupID += productGroup.GetString("Ecom:Group.ID") + ","; 1248 } 1249 } 1250 } 1251 <!------------------------- for Price Filter Begin -------------------------> 1252 1253 <!------------------------- for Price Filter End -------------------------> 1254 <div class="filter-vertical toogleContent FixedHeightContainer" > 1255 <form id="filtercontainer" name="EcomSearch" class="form-filters" method="get" > 1256 @*<input type="hidden" name="ID" value='@GetString("Ecom:ProductList:Page.ID")' />*@ 1257 @if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["q"])) 1258 { <input type='hidden' name='q' value='@System.Web.HttpContext.Current.Request["q"]' /> } 1259 @if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["searchsuggest"])) 1260 { <input type='hidden' name='searchsuggest' value='@System.Web.HttpContext.Current.Request["searchsuggest"]' /> } 1261 1262 <input type="submit" style="display:none;"> 1263 1264 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 1265 { 1266 foreach (LoopItem facet in facetGroup.GetLoop("Facets")) 1267 { 1268 var facetOptions = facet.GetLoop("FacetOptions"); 1269 string facetQueryParameter = facet.GetString("Facet.QueryParameter"); 1270 1271 if (!facetOptions.Any()) 1272 { 1273 continue; 1274 } 1275 if( 1276 (facet.GetString("Facet.Name")=="SecondGroup" ) || 1277 (facet.GetString("Facet.Name")=="ThirdGroup" ) || 1278 (facet.GetString("Facet.Name")=="FirstGroup") || 1279 (facet.GetString("Facet.Name")=="Color") || 1280 //(facet.GetString("Facet.Name")=="Size") || 1281 (facet.GetString("Facet.Name")=="Weight") || 1282 (facet.GetString("Facet.Name")=="Health Consideration") || 1283 (facet.GetString("Facet.Name")=="Life Stage") || 1284 (facet.GetString("Facet.Name")=="Availability") || 1285 (facet.GetString("Facet.Name")=="productclassic") || 1286 (facet.GetString("Facet.Name")=="Nutritional Option")|| 1287 (facet.GetString("Facet.Name")=="Brands")|| 1288 (facet.GetString("Facet.Name")=="Treats Type")|| 1289 (facet.GetString("Facet.Name")=="Kibble - Bite Size")|| 1290 (facet.GetString("Facet.Name")=="Pet Type")|| 1291 (facet.GetString("Facet.Name")=="Applications Type")|| 1292 (facet.GetString("Facet.Name")=="Pet Weight Range")|| 1293 (facet.GetString("Facet.Name")=="Litter Materials")|| 1294 (facet.GetString("Facet.Name")=="Litter Features")|| 1295 (facet.GetString("Facet.Name") == "Size")|| 1296 (facet.GetString("Facet.Name") == "Weights")|| 1297 (facet.GetString("Facet.Name") == "Volume")|| 1298 (facet.GetString("Facet.Name") == "Pet Weight Ranges") 1299 ) 1300 { 1301 if((facet.GetString("Facet.Name")=="SecondGroup")||(facet.GetString("Facet.Name")=="ThirdGroup")||(facet.GetString("Facet.Name")=="FirstGroup")||(facet.GetString("Facet.Name")=="productclassic")){ 1302 1303 <!--Category--> 1304 <div style="display:none" class="panel panel-flat"> 1305 <div class="panel-heading"> 1306 @{ 1307 var str = Regex.Replace(facet.GetString("Facet.Name"), @"\s+", ""); 1308 } 1309 <h4 class="panel-title tot-accordion"> 1310 <a data-toggle="collapse" data-target='#collapse@(str)' class="accordion-section-title" style="color: #000 !important;"> 1311 <span class="pull-right hasMinus"> <i class="i-minus"></i></span> &nbsp;@Translate(facet.GetString("Facet.Name")) 1312 </a> 1313 </h4> 1314 </div> 1315 <div id='collapse@(str)' class="collapse in"> 1316 <div class="panel-body smoothscroll" > 1317 1318 @if (facetOptions.Count() > 0) 1319 { 1320 <ul class="list-unstyled long-list"> 1321 1322 @foreach (LoopItem option in facetOptions) 1323 { 1324 var value = option.GetValue("FacetOption.Value"); 1325 var isSelected = option.GetBoolean("FacetOption.Selected"); 1326 var label = option.GetString("FacetOption.Label"); 1327 label = label.Replace("-a-",""); 1328 1329 var count = option.GetInteger("FacetOption.Count"); 1330 var facetName = (Regex.Replace(facet.GetString("Facet.Name"), @"\s+", "")).ToLower(); 1331 1332 char[] array = label.ToCharArray(); 1333 // Handle the first letter in the string. 1334 if (array.Length >= 1) 1335 { 1336 if (char.IsLower(array[0])) 1337 { 1338 array[0] = char.ToUpper(array[0]); 1339 } 1340 } 1341 // Scan through the letters, checking for spaces. 1342 // ... Uppercase the lowercase letters following spaces. 1343 for (int i = 1; i < array.Length; i++) 1344 { 1345 if (array[i - 1] == ' ') 1346 { 1347 if (char.IsLower(array[i])) 1348 { 1349 array[i] = char.ToUpper(array[i]); 1350 } 1351 } 1352 } 1353 string label2=new string(array); 1354 <li> 1355 <div class="block-element"> 1356 <label onclick ="clickCheckbox(this);"> 1357 @*<input type="checkbox" onclick="submitform()" data-hidden="true" class="filter-option-value" id="chk@(facetName)@(count)" name="@facetName" value="@value" @if (isSelected) { <text> checked="checked" </text> } />*@ 1358 <input type="checkbox" onclick="submitform()" data-hidden="true" class="filter-option-value" id="chk@(facetName)@(count)" name="@facetQueryParameter" value="@value" @if (isSelected) { <text> checked="checked" </text> } /> 1359 @label2 1360 </label> 1361 <span class="badge">(@count)</span> 1362 </div> 1363 </li> } 1364 </ul> 1365 } 1366 </div> 1367 </div> 1368 </div> 1369 <!--/Category menu end--> 1370 1371 } 1372 else{ 1373 1374 <div id="accordion"> 1375 <!--Category--> 1376 <div class="accordion-section" > 1377 @{ 1378 var str = Regex.Replace(facet.GetString("Facet.Name"), @"\s+", ""); 1379 bool showFacetName = false; 1380 } 1381 @if(facetOptions.Count() == 1) 1382 { 1383 foreach (LoopItem option in facetOptions) 1384 { 1385 if(option.GetInteger("FacetOption.Count") > 0 && option.GetString("FacetOption.Label").ToLower().Contains("nothing select")) 1386 { 1387 showFacetName = false; 1388 } 1389 else if(option.GetInteger("FacetOption.Count") > 0) 1390 { 1391 showFacetName = true; 1392 } 1393 } 1394 } 1395 else if (facetOptions.Count() > 1) 1396 { 1397 foreach (LoopItem option in facetOptions) 1398 { 1399 if(option.GetInteger("FacetOption.Count") > 0) 1400 { 1401 showFacetName = true; 1402 } 1403 } 1404 } 1405 @if(showFacetName) 1406 { 1407 <a class="accordion-section-title" data-toggle="collapse" onclick="return disableLink();" data-target='#collapse@(str)' href="#collapse@(str)" style="padding-top: 20px;"> 1408 @Translate(facet.GetString("Facet.Name")) 1409 </a> 1410 } 1411 </div> 1412 <div name="visibleFilter" id='collapse@(str)' class="accordion-section-content collapse scrollminicart"> 1413 @if (facetOptions.Count() > 0) 1414 { 1415 foreach (LoopItem option in facetOptions) 1416 { 1417 var value = option.GetValue("FacetOption.Value"); 1418 var isSelected = option.GetBoolean("FacetOption.Selected"); 1419 1420 var count = option.GetInteger("FacetOption.Count"); 1421 var label = option.GetString("FacetOption.Label"); 1422 label = facet.GetString("Facet.Name") == "Brands" ? label.ToUpper() : System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(label.ToLower()); 1423 var displayLabel = Translate(label) + " (" + count + ")"; 1424 var labelCount = " (" + count + ")"; 1425 var facetName = (Regex.Replace(facet.GetString("Facet.Name"), @"\s+", "")).ToLower(); 1426 facetName = facetName == "kibble-bitesize" ? "bitesize" : facetName; 1427 if(count != 0 && !displayLabel.ToLower().Contains("nothing select")) 1428 { 1429 @*<input type="checkbox" onclick="submitform()" data-hidden="false" data-category="@str" class="filter-option-value" id="chk@(label)@(count)" name="@facetName" value="@value" @if (isSelected) { <text> checked="checked" </text> } />*@ 1430 <input type="checkbox" onclick="submitform()" data-hidden="false" data-category="@str" class="filter-option-value" id="chk@(label)@(count)" name="@facetQueryParameter" value="@value" @if (isSelected) { <text> checked="checked" </text> } /> 1431 @*@Translate(label) @labelCount*@ 1432 @displayLabel 1433 <br> 1434 } 1435 1436 } 1437 } 1438 </div> 1439 <!--/Category menu end--> 1440 </div>}} 1441 } 1442 1443 } 1444 @{ 1445 string currency = GetLoop("Products").Count() > 0 ? GetLoop("Products")[0].GetString("Ecom:Product.Discount.Price.Currency.Symbol") : string.Empty; 1446 } 1447 <div id="accordion"> 1448 <div id="priceFilterTitle" class="accordion-section" style="display:none;"> 1449 <a class="accordion-section-title" data-toggle="collapse" onclick="return disableLink(); return false;" data-target='#collapsePriceFilter' href="#collapsePriceFilter" style="padding-top: 20px;"> 1450 @Translate("Price Filter") 1451 </a> 1452 </div> 1453 <div name="visibleFilter" id='collapsePriceFilter' class="accordion-section-content collapse scrollminicart" style="display:none;"> 1454 <div> 1455 <label>@Translate("Price range"): @currency</label> 1456 <input class="price-filter-min" id="price-filter-min" name="minpricefilter" value="0" readonly /> 1457 ~ 1458 <input class="price-filter-max" id="price-filter-max" name="maxpricefilter" value="10000" readonly /> 1459 <input type="hidden" id="minprice" name="minprice" value="0" /> 1460 <input type="hidden" id="maxprice" name="maxprice" value="10000" /> 1461 </div> 1462 <div class="slider-range"> 1463 <div id="slider-range"></div> 1464 </div> 1465 </div> 1466 </div> 1467 1468 <div id="accordion"> 1469 <div id="wordSearchTitle" class="accordion-section"> 1470 <a class="accordion-section-title" data-toggle="collapse" onclick="return disableLink();" data-target='#collapseWordSearch' href="#collapseWordSearch" style="padding-top: 20px;"> 1471 @Translate("Search within this list") 1472 </a> 1473 </div> 1474 <div name="visibleFilter" id='collapseWordSearch' class="accordion-section-content collapse scrollminicart"> 1475 <div> 1476 <input type="text" id="wordSearch" name="wordSearch" placeholder='@Translate("Word Search")' value='@System.Web.HttpContext.Current.Request["wordSearch"]' /> 1477 <input id="applyFilters" type="submit" class="btn btn-sm btn-two" value='@Translate("Search")' style="width:60px;" /> 1478 </div> 1479 </div> 1480 </div> 1481 1482 <div style="clear:both;margin-bottom:40px;" > 1483 <input id="clearFilters" type="reset" onclick="resetForm()" class="btn btn-sm btn-two" value='@Translate("Reset Filters")' /> 1484 </div> 1485 </form> 1486 1487 1488 1489 1490 <script> 1491 function resetForm(){ 1492 var checkboxes = document.getElementById("filtercontainer").getElementsByTagName("input"); 1493 for(var i=0;i<checkboxes.length;i++){ 1494 if(checkboxes[i].checked == true && $(checkboxes[i]).data("hidden")==false){ 1495 console.log(checkboxes[i].value); 1496 $(checkboxes[i]).attr("checked",false); 1497 } 1498 } 1499 $("#wordSearch").val(""); 1500 var url = new URL(window.location); 1501 var query_string = url.search; 1502 var search_params = new URLSearchParams(query_string); 1503 search_params.set('minpricefilter', '0'); 1504 search_params.set('maxpricefilter', max_price); 1505 search_params.set('wordSearch', ''); 1506 url.search = search_params.toString(); 1507 var new_url = url.toString(); 1508 window.location.href = new_url; 1509 setTimeout(function(){document.getElementById("filtercontainer").submit();},300); 1510 } 1511 </script> 1512 @foreach (LoopItem k in GetLoop("Ecom:Search.Filters")) 1513 { 1514 1515 <!--@LoopStart("Ecom:Search.Filter.Options")--> 1516 <!--@Ecom:Search.Filter.Name--> 1517 <!--@Ecom:Search.Filter.Option.Label--> 1518 <!--@Ecom:Search.Filter.Option.Value--> 1519 <!--@LoopEnd("Ecom:Search.Filter.Options")--> 1520 } 1521 1522 </div> 1523 <script> 1524 function disableLink(){ 1525 return false; 1526 } 1527 function submitform(){ 1528 var x = document.getElementsByName('EcomSearch'); 1529 x[0].submit(); 1530 } 1531 1532 function clickCheckbox(check){ 1533 1534 } 1535 1536 function expandFacets(){ 1537 1538 var filterDiv = document.getElementsByName("visibleFilter"); 1539 1540 for(var i=0;i<filterDiv.length;i++){ 1541 1542 var checkboxes = filterDiv[i].getElementsByTagName("input"); 1543 1544 for(var j=0;j<checkboxes.length;j++){ 1545 if(checkboxes[j].checked == true){ 1546 var targetFilter = document.getElementById("collapse"+$(checkboxes[j]).data("category")); 1547 console.log("collapse"+$(checkboxes[j]).data("category")); 1548 targetFilter.setAttribute("class", "collapse in"); 1549 break; 1550 } 1551 } 1552 } 1553 } 1554 1555 $(document).ready(function() { 1556 //expandFacets(); 1557 if('@GetGlobalValue("Global:Device.IsMobile")' != "True") { 1558 $('.accordion-section-title').click(); 1559 } 1560 }); 1561 </script> 1562 <style> 1563 .price-filter-min, .price-filter-max { 1564 width: 22%; 1565 border: none; 1566 background: none; 1567 } 1568 .price-filter-min { 1569 text-align: right; 1570 } 1571 .price-filter-max { 1572 text-align: left; 1573 } 1574 .slider-range { 1575 padding: 0 10px 0 10px; 1576 } 1577 #applyFilters { 1578 margin-top: -3px; 1579 } 1580 1581 .FixedHeightContainer 1582 { 1583 height: auto; 1584 } 1585 .scrollminicart 1586 { 1587 max-height:224px; 1588 height:auto; 1589 overflow:auto; 1590 1591 } 1592 #collapsePriceFilter.collapse > div 1593 { 1594 display:none; 1595 } 1596 #collapsePriceFilter.collapse.in > div 1597 { 1598 display:block!important; 1599 } 1600 </style> 1601 <!------------------------- Price Filter Begin -------------------------> 1602 @{ 1603 int requested_Min_Price = 0; 1604 int requested_Max_Price = 0; 1605 int minPrice = 0; 1606 int maxPrice = 0; 1607 int pageNumber = 0; 1608 string getPriceUrl = string.Empty; 1609 try 1610 { 1611 requested_Min_Price = Convert.ToInt32(System.Web.HttpContext.Current.Request["minpricefilter"]); 1612 requested_Max_Price = Convert.ToInt32(System.Web.HttpContext.Current.Request["maxpricefilter"]); 1613 minPrice = Convert.ToInt32(System.Web.HttpContext.Current.Request["minprice"]); 1614 maxPrice = Convert.ToInt32(System.Web.HttpContext.Current.Request["maxprice"]); 1615 pageNumber = Convert.ToInt32(System.Web.HttpContext.Current.Request["PageNum"]); 1616 //getPriceUrl = System.Web.HttpContext.Current.Request.Url.AbsoluteUri.Replace(GetString("Ecom:ProductList:Page.ID"), "3123").Replace("PageNum=" + pageNumber,"PageNum="); 1617 getPriceUrl = System.Web.HttpContext.Current.Request.Url.Scheme + "://" + System.Web.HttpContext.Current.Request.Url.Host + "/Default.aspx?ID=3123"; 1618 } 1619 catch(Exception ex) 1620 { 1621 requested_Min_Price = 0; 1622 requested_Max_Price = 0; 1623 minPrice = 0; 1624 maxPrice = 0; 1625 //getPriceUrl = System.Web.HttpContext.Current.Request.Url.AbsoluteUri.Replace(GetString("Ecom:ProductList:Page.ID"), "3123"); 1626 getPriceUrl = System.Web.HttpContext.Current.Request.Url.Scheme + "://" + System.Web.HttpContext.Current.Request.Url.Host + "/Default.aspx?ID=3123"; 1627 } 1628 } 1629 1630 <link rel="stylesheet" href="/Files/Templates/Designs/PLC/assets/jQuery_Ui_Slider/jquery-ui.css" type="text/css"> 1631 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 1632 <script src="/Files/Templates/Designs/PLC/assets/jQuery_Ui_Slider/jquery.ui.touch-punch.min.js"></script> 1633 1634 <script> 1635 var priceFilterMouseDown = false; 1636 var min_price = 0; 1637 var max_price = 0; 1638 var requested_min_price = parseInt("@requested_Min_Price"); 1639 var requested_max_price = parseInt("@requested_Max_Price"); 1640 var url = "@getPriceUrl" + "&SortBy=InternetPrice&SortOrder=Desc" + "&GroupId=" + "@stringGroupID"; 1641 $.ajax( 1642 { 1643 url: url, 1644 type: 'POST', 1645 success: function (data) 1646 { 1647 if(parseInt("@minPrice") == 0 && parseInt("@maxPrice") == 0) { 1648 min_price = parseInt(data["Min_Price"]); 1649 max_price = parseInt(data["Max_Price"]) + 1; 1650 } else { 1651 min_price = parseInt("@minPrice"); 1652 max_price = parseInt("@maxPrice"); 1653 } 1654 1655 $("#minprice").val(min_price); 1656 $("#maxprice").val(max_price); 1657 1658 if(requested_min_price == 0 && requested_max_price == 0) 1659 { 1660 requested_max_price = min_price; 1661 requested_max_price = max_price; 1662 } 1663 $( function() { 1664 $( "#slider-range" ).slider({ 1665 range: true, 1666 min: min_price, 1667 max: max_price, 1668 values: [ requested_min_price, requested_max_price ], 1669 slide: function( event, ui ) { 1670 $( "#price-filter-min" ).val(ui.values[ 0 ]); 1671 $( "#price-filter-max" ).val(ui.values[ 1 ]); 1672 } 1673 }); 1674 $( "#price-filter-min" ).val( $( "#slider-range" ).slider( "values", 0 )); 1675 $( "#price-filter-max" ).val( $( "#slider-range" ).slider( "values", 1 ) ); 1676 }); 1677 $( "#priceFilterTitle" ).show(); 1678 $( "#collapsePriceFilter" ).show(); 1679 $('.ui-slider-handle ui-corner-all ui-state-default').draggable(); 1680 }, 1681 error: function (jqXHR, textStatus, errorThrown) 1682 { 1683 //console.log("jqXHR: " + jqXHR); 1684 //console.log("textStatus: " + textStatus); 1685 //console.log("errorThrown: " + errorThrown); 1686 } 1687 }); 1688 1689 $( "#slider-range" ).mousedown(function() { 1690 priceFilterMouseDown = true; 1691 }); 1692 $(document).mouseup(function() { 1693 if(priceFilterMouseDown) { 1694 $("#applyFilters").click(); 1695 } 1696 }); 1697 1698 1699 <!------------------------- Price Filter End -------------------------> 1700 1701 <!------------------------- on Form Submit Begin -------------------------> 1702 1703 $(function() 1704 { 1705 $("form").submit(function() 1706 { 1707 $('#wordSearch').val($('#wordSearch').val().toLowerCase()); 1708 <!-- Handling null value parameter --> 1709 $( 'input[value=""]' ).each(function(index) { 1710 if($( this ).val() == null || $( this ).val() == "") { 1711 $( this ).attr("disabled", "disabled"); 1712 } 1713 }); 1714 return true; // ensure form still submits 1715 }); 1716 }); 1717 <!------------------------- on Form Submit End -------------------------> 1718 </script> 1719 <style> 1720 .dw-categories > li > .M2{ 1721 background:none; 1722 } 1723 .list-open-active { 1724 background:none; 1725 } 1726 ul.dw-categories > li > ul { 1727 background:none; 1728 } 1729 .list-active { 1730 background:none; 1731 } 1732 </style> 1733 </div> 1734 </div> 1735 @if(showH1TitleFlag) 1736 { 1737 <h1 style="text-align: center;">@GetString("Ecom:Group:Field.h1titletext")</h1> 1738 } 1739 <div class="prod-content-right col-9-12"> 1740 1741 @if( !string.IsNullOrWhiteSpace(grouptext)) 1742 { 1743 <h2 style="text-transform: capitalize;">@grouptext.Replace("-a-","&")</h2> 1744 } 1745 else{ 1746 <h2 style="text-transform: capitalize;">@grouptext</h2> 1747 } 1748 <div class="col-1-1 nopadding"> 1749 <div class="sort-box col-1-3 nopadding"> 1750 <form class="sort-by"> 1751 <label class="smallText bold">@Translate("Sort by:", "Sort by:") </label> 1752 <select id="sortSelect" onchange="SortProductsBy(this.value)" style="width:100px"> 1753 @*<option value="PleaseSelect">@Translate("Please select", "Please select")</option>*@ 1754 <option value="TotalAmtSold&amp;SortOrder=Desc" > @Translate("Best Selling", "Best Selling")</option> 1755 <option value="Brand&amp;SortOrder=Asc" >@Translate("Brand A-Z", "Brand A-Z") </option> 1756 <option value="Brand&amp;SortOrder=Desc" > @Translate("Brand Z-A", "Brand Z-A") </option> 1757 1758 <option value="InternetPrice&amp;SortOrder=Asc" >@Translate("Price low-high", "Price low-high")</option> 1759 <option value="InternetPrice&amp;SortOrder=Desc" > @Translate("Price high-low", "Price high-low")</option> 1760 1761 1762 1763 <option value="NewArrivals&amp;SortOrder=Desc" > @Translate("New Arrivals", "New Arrivals")</option> 1764 </select> 1765 </form> 1766 </div> 1767 1768 <div class="page-no-top col-2-3"> 1769 @if(currentPage == 1) 1770 { 1771 if(totalPages == 1) 1772 { 1773 <div id="items-pages" class="items-pages currenttotal1 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1774 }else if(totalPages == 2){ 1775 <div id="items-pages" class="items-pages currenttotal2 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1776 }else if(totalPages == 3){ 1777 <div id="items-pages" class="items-pages currenttotal3 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1778 }else if(totalPages == 4){ 1779 <div id="items-pages" class="items-pages currenttotal4 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1780 }else if(totalPages == 5){ 1781 <div id="items-pages" class="items-pages currenttotal5 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1782 }else if(totalPages == 6){ 1783 <div id="items-pages" class="items-pages currenttotal6 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1784 }else{ 1785 <div id="items-pages" class="items-pages current1 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1786 } 1787 }else if(currentPage == 2) 1788 { 1789 if(totalPages <= 6) 1790 { 1791 <div id="items-pages" class="items-pages total6current2 destopcurrent2 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1792 }else{ 1793 <div id="items-pages" class="items-pages current2 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1794 } 1795 }else if(currentPage == 3) 1796 { 1797 if(totalPages <= 6) 1798 { 1799 <div id="items-pages" class="items-pages total6current3 destopcurrent3 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1800 }else{ 1801 <div id="items-pages" class="items-pages current3 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1802 } 1803 }else if(currentPage == 4) 1804 { 1805 if(totalPages <= 6) 1806 { 1807 <div id="items-pages" class="items-pages total6current4 destopcurrent4 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1808 }else{ 1809 <div id="items-pages" class="items-pages current4 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1810 } 1811 }else if(currentPage == 5) 1812 { 1813 if(totalPages <= 6) 1814 { 1815 <div id="items-pages" class="items-pages total6current5 destopcurrent5 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1816 }else{ 1817 <div id="items-pages" class="items-pages current5 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1818 } 1819 }else if(currentPage == 6) 1820 { 1821 if(totalPages <= 6) 1822 { 1823 <div id="items-pages" class="items-pages total6current6 destopcurrent6 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1824 }else{ 1825 <div id="items-pages" class="items-pages current6 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1826 } 1827 }else 1828 { 1829 if(currentPage == totalPages) 1830 { 1831 <div id="items-pages" class="items-pages commoncurrent mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1832 }else{ 1833 if(currentPage == (totalPages - 1)) 1834 { 1835 <div id="items-pages" class="items-pages total1 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1836 }else if(currentPage == (totalPages - 2)) 1837 { 1838 <div id="items-pages" class="items-pages total2 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1839 }else if(currentPage == (totalPages - 3)) 1840 { 1841 <div id="items-pages" class="items-pages total3 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1842 }else if(currentPage == (totalPages - 4)) 1843 { 1844 <div id="items-pages" class="items-pages total4 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1845 }else if(currentPage == (totalPages - 5)) 1846 { 1847 <div id="items-pages" class="items-pages total5 mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1848 }else{ 1849 <div id="items-pages" class="items-pages commontotal mblpagination">@GetString("Ecom:ProductList.PageProdCnt")&nbsp;&nbsp;items in list</div> 1850 } 1851 } 1852 } 1853 <ul class="page-prev-next top-paging-prev" style="float: left;"> 1854 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) 1855 { 1856 <li><a href="@GetString("Ecom:ProductList.PrevPage.Clean")" style="margin-top:3px;">&lsaquo;</a></li> 1857 } 1858 </ul> 1859 <ul id="page-no" class="page-no"> 1860 1861 @{ 1862 if(currentPage!=1){ 1863 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum=1"+otherLink)'><strong>1</strong></a></li> 1864 } 1865 @*...*@ 1866 if(currentPage - noOfPages > 2){ 1867 <li><a>...</a></li> 1868 } 1869 @*previous 5 pages*@ 1870 for(var i = currentPage-noOfPages; i < currentPage; i++){ 1871 if(i>1){ 1872 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+i+otherLink)' ><strong>@i</strong></a></li> 1873 } 1874 } 1875 @*currentpage*@ 1876 <li class="active" style="padding: 0 2px 0 2px; text-decoration: underline;"><a href="@currentPageLink"><strong>@currentPage</strong></a></li> 1877 @*forward 5 pages*@ 1878 for(var i = currentPage+1; i < currentPage+noOfPages + 1; i++){ 1879 if(i<totalPages){ 1880 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+i+otherLink)'><strong>@i</strong></a></li> 1881 } 1882 } 1883 @*...*@ 1884 if(currentPage + noOfPages < totalPages-2){ 1885 <li style="padding: 0 2px 0 2px;"><a>...</a></li> 1886 } 1887 1888 if(currentPage != totalPages && totalPages != 0){ 1889 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+totalPages+otherLink)'><strong>@totalPages</strong></a></li> 1890 } 1891 } 1892 1893 </ul> 1894 <ul class="page-prev-next" style="margin-left: 10px;"> 1895 1896 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) 1897 { 1898 <li><a href="@GetString("Ecom:ProductList.NextPage.Clean")" style="margin-top: 3px;">&rsaquo;</a></li> 1899 } 1900 1901 </ul> 1902 </div> 1903 1904 <hr class="grey"> 1905 </div> 1906 @if(birthday && showBirthdayPrice1) 1907 { 1908 <!--<div class="info-box col-1-1" style="padding-bottom: 20px;">--> 1909 <!--<img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon_info" title="">--> 1910 <!--<span style="font-size:16px;"><strong>That's because it's your birthday this month!</span>--> 1911 <!--</div>--> 1912 } 1913 <div class="clearfix"></div> 1914 <div class="clearfix"></div> 1915 1916 <div class="compare-box" id="comparebox" style="display: none;"> 1917 <div class="title"> 1918 <h3>@Translate("Compare products")</h3> 1919 <p>(@Translate("Add up to 3 products"))</p> 1920 </div> 1921 <div class="btn-box"> 1922 <div class="btn" style="background-color:#FDF2F0;"><a href='javascript:Compare.compare(@GetPageIdByNavigationTag("ProductComparison"));'>@Translate("Compare","Compare")</a></div> 1923 <p align="center" class="smallText bold"><a href="javascript:Compare.removeall();">@Translate("Clear All","Clear All")</a></p> 1924 </div> 1925 <div id ="compare" class="add-img"> 1926 <div class="btn-add-img"><a href="#">+</a></div> 1927 </div> 1928 </div> 1929 1930 <div id="addedItem"></div> 1931 <div class="col-1-1 nopadding"> 1932 @GetProductList(GetLoop("Products"),birthday,becomeAMemberPrice, 3) 1933 </div> 1934 1935 <p>&nbsp;</p> 1936 <hr class="grey"> 1937 1938 <div class="page-no-bottom col-1-1" style="margin-bottom:0px;"> 1939 <div class="items-pages">@GetString("Ecom:ProductList.PageProdCnt") &nbsp;&nbsp;items in list</div> 1940 <ul class="page-prev-next"> 1941 1942 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) 1943 { 1944 <li style="padding: 0 2px 0 2px;"><a href="@GetString("Ecom:ProductList.PrevPage.Clean")">&lsaquo;</a></li> 1945 } 1946 1947 </ul> 1948 <ul id="page-no" class="page-no"> 1949 1950 @{ 1951 if(currentPage!=1){ 1952 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum=1"+otherLink)'><strong>1</strong></a></li> 1953 } 1954 @*...*@ 1955 if(currentPage - noOfPages > 2){ 1956 <li><a>...</a></li> 1957 } 1958 @*previous 5 pages*@ 1959 for(var i =currentPage-noOfPages;i<currentPage;i++){ 1960 if(i>1){ 1961 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+i+otherLink)' ><strong>@i</strong></a></li> 1962 } 1963 } 1964 @*currentpage*@ 1965 <li class="active" style="padding: 0 2px 0 2px; text-decoration: underline;"><a href="@currentPageLink"><strong>@currentPage</strong></a></li> 1966 @*forward 5 pages*@ 1967 for(var i =currentPage+1;i<currentPage+noOfPages+1;i++){ 1968 if(i<totalPages){ 1969 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+i+otherLink)'><strong>@i</strong></a></li> 1970 } 1971 } 1972 @*...*@ 1973 if(currentPage + noOfPages < totalPages-2){ 1974 <li><a>...</a></li> 1975 } 1976 1977 if(currentPage != totalPages && totalPages != 0){ 1978 <li style="padding: 0 2px 0 2px;"><a href='@(blankLink+"PageNum="+totalPages+otherLink)'><strong>@totalPages</strong></a></li> 1979 } 1980 } 1981 1982 </ul> 1983 <ul class="page-prev-next" style="margin-left: 10px;"> 1984 1985 @if (!string.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) 1986 { 1987 <li><a href="@GetString("Ecom:ProductList.NextPage.Clean")">&rsaquo;</a></li> 1988 } 1989 1990 </ul> 1991 </div> 1992 <!--<div class="clearfix"></div> 1993 1994 1995 1996 </div>--> 1997 1998 <div id="location" style="width:100%; max-width:400px;display: none;"> 1999 <form> 2000 <h3 style="margin:0;">You have selected more than one location.</h3> 2001 <p style="margin:0 0 20px 0;">Which location would like to pick up this product from?</p> 2002 <input type="checkbox" /> Toa Payoh<br /> 2003 <input type="checkbox" /> Valley Point 2004 <div class="btn-addto-cart" style="margin-top:20px; width:200px;"> 2005 <a href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a> 2006 </div> 2007 </form> 2008 </div> 2009 <script> 2010 function getQueryStringValue (key) { 2011 return unescape(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + escape(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1")); 2012 } 2013 2014 2015 setSortDropDown(); 2016 function setSortDropDown(){ 2017 var pageLink = document.location.href; 2018 if(!pageLink.includes("SortBy")){ 2019 2020 } 2021 else{ 2022 var sortby1 = pageLink.split('SortBy=')[1]; 2023 var sortby = sortby1.split('&SortOrder=')[0]; 2024 var sortorder = sortby1.split('&SortOrder=')[1]; 2025 var sortstring = sortby.toLowerCase()+sortorder.toLowerCase(); 2026 document.getElementById("sortSelect").value = sortstring; 2027 } 2028 } 2029 function SortProductsBy(sortcode) { 2030 2031 var Page = "@grouplink"; 2032 var pageLink = document.location.href; 2033 //document.cookie = "sortby=" + sortcode; 2034 2035 if(window.location.href.indexOf("?") >= 0) { 2036 if(window.location.href.indexOf("?SortBy=") >= 0) { 2037 document.location.href = window.location.href.split("?")[0] + "?SortBy=" + sortcode; 2038 } else { 2039 if(window.location.href.indexOf("&SortBy=") >= 0) { 2040 document.location.href = window.location.href.split("&SortBy=")[0] + "&SortBy=" + sortcode; 2041 } else { 2042 document.location.href = window.location.href + "&SortBy=" + sortcode; 2043 } 2044 } 2045 } else { 2046 document.location.href = window.location.href + "?SortBy=" + sortcode; 2047 } 2048 } 2049 2050 function compareProducts(compareId,productName,productLink,checked){ 2051 2052 if(!checked){ 2053 Compare.remove(compareId); 2054 2055 } 2056 else{ 2057 Compare.add(compareId,productName,productLink); 2058 } 2059 2060 } 2061 </script> 2062 @* ----- qty controller Begin----- *@ 2063 <script type="text/javascript" src="/Files/Templates/Designs/PLC/js/PLCAddToCartQtyController.js?v=1.3"></script> 2064 @* ----- qty controller End------- *@
Cookies

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, You consent to the use of All the cookies.

เว็บไซต์ของเรามีการใช้คุกกี้ เพื่อให้คุณได้รับประสบการณ์ที่เกี่ยวข้องมากที่สุดโดยจดจำการตั้งค่าของคุณและการเยี่ยมชมซ้ำ การคลิก"ยอมรับ" แสดงว่าคุณยินยอมให้ใช้คุกกี้ทั้งหมด