| 0
|
Cat image

Cat Supplies And Others

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

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