Error executing template "Designs/PLC/eCom/Product/PLCProductDetail.cshtml"
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting the varchar value 'NVALI' to data type int.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at System.Data.SqlClient.SqlDataReader.Read()
at CompiledRazorTemplates.Dynamic.RazorEngine_8ea9a26df59e49fc9946c3d5a630bcf5.Execute() in E:\www\uat.petloverscentre.co.th\Solution\Files\Templates\Designs\PLC\eCom\Product\PLCProductDetail.cshtml:line 1195
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()
ClientConnectionId:2ced4d01-5453-445d-9f32-d32e72a7d46a
Error Number:245,State:1,Class:16
1 @using DWAPAC.PLC.Services
2 @{
3 string currentAbsoluteUriString = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
4 var userAgent = HttpContext.Current.Request.UserAgent.ToLower();
5 Uri currentAbsoluteUri = new Uri(currentAbsoluteUriString);
6 string plcUrl = currentAbsoluteUri.Scheme + "://" + currentAbsoluteUri.Host;
7 string showHide = string.Empty;
8 string language = GetGlobalValue("Global:Area.LongLang");
9 }
10
11 @{
12 string promoName = "";
13 string promoD = "";
14 int pId= GetInteger("Ecom:Product.ID");
15 List<string> productPromoNames=new List<string>();
16 @*var promosqlString = "SELECT discountname, discountdescription FROM ecomdiscount WHERE DISCOUNTACTIVE='true' and discountproductsandgroups LIKE '%p:" + pId + "%'";*@
17 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 + ",%'";
18 using(System.Data.IDataReader promoNameReder = Dynamicweb.Data.Database.CreateDataReader(promosqlString))
19 {
20 while (promoNameReder.Read())
21 {
22 promoName += promoNameReder["discountname"].ToString() + "<br>" +"<div style='font-size: small; margin-top: 7px;'>" +promoNameReder["discountdescription"].ToString() +"</div>" +"<br>";
23 //promoD += promoNameReder["discountdescription"].ToString() + "<br>";
24 }
25 }
26 }
27 <script>
28 var canAddToCart = true;
29 </script>
30 @using System.Web
31
32 @using System.Text.RegularExpressions
33 @using System.Web
34
35
36 @functions{
37 public class WrapMethods
38 {
39
40
41 //Gets the contrasting color
42 public static string getContrastYIQ(string hexcolor)
43 {
44 if (hexcolor != "")
45 {
46 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", "");
47
48 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16);
49 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16);
50 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16);
51 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
52
53 if (yiq >= 128)
54 {
55 return "black";
56 }
57 else
58 {
59 return "white";
60 }
61 }
62 else
63 {
64 return "black";
65 }
66 }
67
68
69 //Truncate text
70 public static string Truncate (string value, int count, bool strip=true)
71 {
72 if (strip == true){
73 value = StripHtmlTagByCharArray(value);
74 }
75
76 if (value.Length > count)
77 {
78 value = value.Substring(0, count - 1) + "...";
79 }
80
81 return value;
82 }
83
84
85 //Strip text from HTML
86 public static string StripHtmlTagByCharArray(string htmlString)
87 {
88 char[] array = new char[htmlString.Length];
89 int arrayIndex = 0;
90 bool inside = false;
91
92 for (int i = 0; i < htmlString.Length; i++)
93 {
94 char let = htmlString[i];
95 if (let == '<')
96 {
97 inside = true;
98 continue;
99 }
100 if (let == '>')
101 {
102 inside = false;
103 continue;
104 }
105 if (!inside)
106 {
107 array[arrayIndex] = let;
108 arrayIndex++;
109 }
110 }
111 return new string(array, 0, arrayIndex);
112 }
113
114 //Make the correct count of columns
115 public static string ColumnMaker(int Col, string ScreenSize)
116 {
117 string Columns = "";
118
119 switch (Col)
120 {
121 case 1:
122 Columns = "col-"+ScreenSize+"-12";
123 break;
124
125 case 2:
126 Columns = "col-"+ScreenSize+"-6";
127 break;
128
129 case 3:
130 Columns = "col-"+ScreenSize+"-4";
131 break;
132
133 case 4:
134 Columns = "col-"+ScreenSize+"-3";
135 break;
136
137 default:
138 Columns = "col-"+ScreenSize+"-3";
139 break;
140 }
141
142 return Columns;
143 }
144
145
146 private string Custom(string firstoption, string secondoption)
147 {
148 if (firstoption == "custom")
149 {
150 return secondoption;
151 }
152 else
153 {
154 return firstoption;
155 }
156 }
157 }
158 }
159 @using DWAPAC.PLC.Services
160 @using Dynamicweb.Security.UserManagement.Common.CustomFields
161
162
163 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
164 <script type="text/javascript" src="/Files/Templates/Designs/PLC/eCom/ProductList/Compare.js"></script>
165 <style>
166 .ui-dialog-titlebar, .ui-dialog-buttonset button{
167 background:#662010;
168 color: #FFF;
169 }
170 .clearfix{
171 margin-bottom: -10px !important;
172 }
173
174 #myBtn {
175 display: none;
176 position: fixed;
177 bottom: 55px;
178 right: 9%;
179 z-index: 99;
180 font-size: 18px;
181 border: none;
182 outline: none;
183 color: white;
184 cursor: pointer;
185 padding: 15px;
186 border-radius: 4px;
187 background-image: url(/Files/Templates/Designs/PLC/assets/images/up_arrow_icon.png);
188 background-size: 35px;
189 width: 35px;
190 height: 35px;
191 }
192
193 .product-box .prod-img img {
194 display: block;
195 margin: 0px auto;
196 }
197 .prod-pbox{
198 height:115px;
199 }
200 /*::before {
201 padding-top:0.5em;
202 }commented out By AKS due to menu collapsing problem */
203 input[type=number]::-webkit-inner-spin-button,
204 input[type=number]::-webkit-outer-spin-button {
205 -webkit-appearance: none;
206 -moz-appearance: none;
207 appearance: none;
208 margin: 0;
209 }
210 @if(GetInteger("Ecom:ProductList.PageProdCnt") > 0)
211 {
212 <text>
213 .btn-addto-cart {
214 margin-bottom:5px;
215 background-color: #ad2d14;
216 height:38px;
217 border-radius: 3px;
218 }
219 .btn-addto-cart:hover {
220 //background-color: #500d00;
221 }
222 .glyphicon-minus, .glyphicon-plus {
223 cursor: pointer;
224 color: #ffffff;
225 }
226 </text>
227 if(System.Web.HttpContext.Current.Request.Browser.Type.ToUpper().Contains("SAFARI"))
228 {
229 <text>
230 .btn-addto-cart div a, .btn-addto-cart a {
231 line-height: 36px;
232 }
233 #addtocartLink {
234 margin-top: 30px !important;
235 }
236 @@media screen (max-width: 340px){
237 .btn-addto-cart div a, .btn-addto-cart a {
238 padding-top: 0px;
239 }
240 }
241 .fixsize {
242 margin-top: 120px;
243 }
244 </text>
245 }
246 else
247 {
248
249 }
250 }
251 else
252 {
253 if(System.Web.HttpContext.Current.Request.Browser.Type.ToUpper().Contains("SAFARI"))
254 {
255 <text>
256 .btn-addto-cart div a, .btn-addto-cart a {
257 line-height: 36px;
258 }
259 #addtocartLink {
260 margin-top: 30px !important;
261 }
262 @@media screen (max-width: 340px){
263 .btn-addto-cart div a, .btn-addto-cart a {
264 padding-top: 0px;
265 }
266 }
267 </text>
268 }
269 else
270 {
271
272 }
273 }
274 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) {
275 .mblAddTo {
276 padding-left:30px !important;
277 }
278 }
279 @@media screen and (max-width: 700px) and (min-width: 375px) and (max-height: 700px) {
280 .mblpromologo {
281 padding-bottom:2px;
282 }
283 }
284 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) {
285 .mblpromologo1 {
286 padding-bottom:-5px;
287 }
288 }
289 @@media screen and (max-width: 800px) and (min-width: 768px) and (max-height: 1024px) {
290 .mblPromologoipad {
291 padding-bottom:5px;
292 }
293 }
294 @@media screen and (max-width: 1024px) and (min-width: 768px) and (max-height: 800px) {
295 .mblPromologoipad1 {
296 padding-bottom:5px;
297 }
298 }
299 @@media screen and (max-width: 800px) and (min-width: 760px) and (max-height: 1200px) {
300 .mblPromologolap {
301 padding-bottom:2px;
302 }
303 }
304
305
306 @@media screen and (max-width: 800px) and (min-width: 700px) and (max-height: 1030px) {
307 .mblAddTo {
308 padding-left:70px !important;
309 }
310 }
311
312 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) {
313 .btn-sale{
314 position: absolute;
315 z-index: 10;
316 right: 10px;
317 width: 80px;
318 padding-top: 8px !important;
319 }
320 }
321 </style>
322
323 @helper GetProductList(dynamic Loop,bool birthday,string becomeAMemberPrice, int ColMD=3, int ColSM=3, int ColXS=1)
324 {
325
326 var birthday0 = false;
327 bool showBirthdayPrice = false;
328 bool userHasVIPCard = false;
329 bool userHasValidVipCard = false;
330 DateTime expDate = new DateTime();
331 DateTime today = DateTime.Now;
332
333 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
334 {
335 int i = Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID"));
336 Dynamicweb.Security.UserManagement.User u = Dynamicweb.Security.UserManagement.User.GetUserByID(i);
337
338 foreach (CustomFieldValue val in u.CustomFieldValues)
339 {
340 CustomField field = val.CustomField;
341 string fieldName = field.Name;
342
343 if(fieldName == "DOB")
344 {
345 DateTime bDay = new DateTime();
346 if(val.Value != null)
347 {
348 bDay = (DateTime)val.Value;
349 if(bDay.Month == today.Month)
350 {
351 birthday0 = true;
352 }
353 }
354 }
355 if(fieldName=="ExpryDate")
356 {
357 expDate=(DateTime)val.Value;
358 }
359
360 switch (fieldName.ToUpper())
361 {
362 case "VIP CARD NO":
363 userHasVIPCard = !string.IsNullOrEmpty((val.Value).ToString());
364 break;
365 case "EXPRYDATE":
366 userHasValidVipCard = expDate.Date < today.Date;
367 break;
368 default:
369 break;
370 }
371 }
372 }
373 showBirthdayPrice = birthday0 && userHasVIPCard && userHasValidVipCard;
374
375 string pathproduct="/Files/Images/plc";
376 string imgpath="/Files/Images/Ecom/Products/";
377 string imgpathpng="";
378 string pidString = "";
379 var loopCounter = 0;
380 List<string>statusList = new List<string>();
381
382 foreach(LoopItem product1 in Loop)
383 {
384 string pid1 = product1.GetString("Ecom:Product.ID");
385 pidString += "[" + pid1 + "],";
386 }
387 pidString = pidString.Remove(pidString.Length - 1);
388 pidString = "{" + pidString;
389 pidString = pidString + "}";
390
391 var response = WebServices.getProductMultiStatusAdvServiceResponse(pidString);
392
393 var responseSplit = response.Split(';');
394 if (responseSplit[0].Contains("500"))
395 {
396 <style>
397 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) {
398 .mainImg{
399 padding-left: 85px;
400 }
401 }
402
403 @@media screen and (max-width: 700px) and (min-width: 600px) and (max-height: 400px) {
404 .mainImg{
405 padding-left: 222px;
406 }
407 }
408 </style>
409 if(Pageview.Device.ToString().ToUpper() == "MOBILE")
410 {
411 <div style="padding-left: 60px;" name="under_maintenance">
412 <img src="/Files/Templates/Designs/PLC/assets/images/under_maintenance_icon.png" class="mainImg" alt="Under Maintenance"><br><br>
413 <span style="font-size: 20px;font-weight: 700;">Sorry, we are facing a temporary server error. Please try again later.</span>
414 </div>
415 }else if(Pageview.Device.ToString().ToUpper() == "TABLET")
416 {
417 <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>
418 }else{
419 <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>
420 }
421 return;
422 }
423
424
425 string productResponse = responseSplit[2].Split('{')[1].Replace("}","");
426
427 var singleProduct = productResponse.Split(',');
428 for(var i =0; i < singleProduct.Length; i++)
429 {
430 string string1 = singleProduct[i].Remove(singleProduct[i].Length-1).Remove(0,1);
431 statusList.Add(string1.Split(':')[1]);
432 }
433 if (responseSplit[0].Contains("200"))
434 {
435 foreach (LoopItem product in Loop)
436 {
437 string pid=product.GetString("Ecom:Product.ID");
438 //Promotion
439
440 string promoName = "";
441 string promoD = "";
442 List<string> productPromoNames=new List<string>();
443 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 + ",%'";
444 using(System.Data.IDataReader promoNameReder = Dynamicweb.Data.Database.CreateDataReader(promosqlString))
445 {
446 while (promoNameReder.Read())
447 {
448 promoName += promoNameReder["DISCOUNTNAME"].ToString();
449 promoD += promoNameReder["DISCOUNTDESCRIPTION"].ToString() + "<br>";
450 }
451 }
452 string Image = product.GetString("Ecom:Product.ImageSmall.Default.Clean");
453 string Link = product.GetString("Ecom:Product.Link.Clean");
454 string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean");
455 string Name = product.GetString("Ecom:Product.Name");
456 Name = Name.Replace("\"","❞");
457 GroupLink = "Default.aspx?ID=" + GetPageIdByNavigationTag("Products") + "&ProductID=" + pid;
458 string Number = product.GetString("Ecom:Product.Number");
459 string ProdBrand = product.GetString("Ecom:Product:Field.ProductBrand");
460 imgpath = "/Files/Images/Ecom/Products/" + pid + ".jpg";
461 imgpathpng = "/Files/Images/Ecom/Products/" + pid + ".png";
462 var absolutePathjpg = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpath);
463 var absolutePathpng = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpathpng);
464 if(System.IO.File.Exists(absolutePathjpg))
465 {
466 Image=imgpath;
467 }
468 else if(System.IO.File.Exists(absolutePathpng))
469 {
470 Image=imgpathpng;
471 }
472
473 string Description = product.GetString("Ecom:Product.ShortDescription");
474 string Discount = product.GetString("Ecom:Product.Discount.Price");
475 string Price = product.GetString("Ecom:Product.Price");
476 string CurrencyCode = product.GetString("Ecom:Product.Price.Currency.Code");
477 //string Promotion=product.GetString("Ecom:Product.Price");
478 string Active=product.GetString("Ecom:Product.IsActive");
479 var Rating=product.GetDouble("Ecom:Product.Rating");
480
481 var sellingPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSPrice"))*1000/5)/200;
482 var internetPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSInternetPrice"))*1000/5)/200;
483 var price=9.95;
484
485 if(price==product.GetDouble("Ecom:Product:Field.ProductSInternetPrice"))
486 {
487 internetPrice= product.GetDouble("Ecom:Product:Field.ProductSInternetPrice");
488 }
489 Boolean inventoryDiscount = product.GetBoolean("Ecom:Product:Field.ProductInventoryDiscountFlag");
490 var discountPercentage = product.GetDouble("Ecom:Product:Field.ProductInventoryDiscount");
491 var birthdayPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSBirthdayPrice"))*1000/5)/200;
492 var memberPrice = Math.Floor((product.GetDouble("Ecom:Product:Field.ProductSMemberPrice"))*1000/5)/200;
493 var disable=product.GetBoolean("Ecom:Product:Field.Disable");
494 var promotion=0.00;
495 var discountType="";
496 var promoNames = "";
497 var testingNames = "";
498 foreach(var promoItem in product.GetLoop("AllDiscounts"))
499 {
500 promoNames += promoItem.GetString("Ecom:AllDiscounts.Discount.Name") +"<br>";
501 }
502 foreach (LoopItem item in product.GetLoop("ProductDiscounts"))
503 {
504
505 if(item.GetString("Ecom:Product.Discount.Type")=="PERCENT")
506 {
507 discountType="PERCENT";
508 promotion=item.GetDouble("Ecom:Product.Discount.PercentWithoutVATFormatted");
509 }
510 else
511 {
512 discountType="AMOUNT";
513 promotion=item.GetDouble("Ecom:Product.Discount.AmountWithoutVATFormatted");
514 }
515 }
516
517 string sellingPriceStr = ((sellingPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice) : string.Format("{0:0}", sellingPrice);
518 string internetPriceStr = ((internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", internetPrice) : string.Format("{0:0}", internetPrice);
519 string savePriceStr = ((sellingPrice-internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice-internetPrice) : string.Format("{0:0.00}", sellingPrice-internetPrice);
520 string memberPriceStr = ((memberPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", memberPrice) : string.Format("{0:0}", memberPrice);
521 string birthdayPriceStr = ((birthdayPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", birthdayPrice) : string.Format("{0:0}", birthdayPrice);
522
523 if(pid != "PROD1" && pid !="PROD2")
524 {
525 <!--product start-->
526 if(!disable)
527 {
528 <div class="product-box col-1-3 tab-col-1-2 mobile-col-1-1" id="get_@pid">
529 <div class="prod-img">
530 @if(promotion != 0)
531 {
532 if(discountType == "PERCENT")
533 {
534 <div class="ribbon-P"><span>@promotion% Off</span></div>
535 }
536 else
537 {
538 <div class="ribbon-P"><span>@product.GetString("Ecom:Product.Currency.Symbol")@promotion Off</span></div>
539 }
540 }
541 else
542 {
543 //add ERP discount ribbon
544 if(inventoryDiscount)
545 {
546 if(discountPercentage != 0)
547 {
548 <div class="ribbon-D"><span>@discountPercentage% Off</span></div>
549 }
550 }
551 }
552 <a href="@GroupLink" title="@Name">
553 <img src="/Admin/Public/Getimage.ashx?width=147&compression=60&Crop=5&image=@Image" class="img-responsive" id="img_@pid" alt="@Name @Number" title="@Name @Number">
554 </a>
555 </div>
556 <p class="prod-name">@ProdBrand
557 <br/> @product.GetString("Ecom:Product.Name")
558 </p>
559
560
561 @if(promoName != "")
562 {
563 <span class="top tipso_style" data-tipso='@promoName.Replace("\"", """).Replace("'","'").Replace("<","<").Replace(">",">")'>
564 @if(GetGlobalValue("Global:Extranet.UserName")!= ""){
565 <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>
566
567
568 }
569 else{
570
571 <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>
572
573 }
574 </span>
575 }else{
576 <div style="background: white; text-align: center; font-size: medium; color: white; font-weight: 600; margin-bottom: inherit; padding-bottom: 3px;"></div>
577 }
578 <div class="prod-star" style="display:none;">
579 @if(@Rating == 0)
580 {
581 <label class = "starUnselected"></label>
582 <label class = "starUnselected"></label>
583 <label class = "starUnselected"></label>
584 <label class = "starUnselected"></label>
585 <label class = "starUnselected"></label>
586 }
587 @if(Rating % 1 != 0)
588 {
589 for(var i = 1; i < @Rating; i++)
590 {
591 <label class = "starSelected"></label>
592 }
593 <label class = "starSelected half"></label>
594 }
595 else
596 {
597 for(var i = 1; i < @Rating+1; i++)
598 {
599 <label class = "starSelected"></label>
600 }
601 }
602
603
604 </div>
605 <div class="prod-pbox">
606 @if(inventoryDiscount)
607 {
608 if(sellingPrice != internetPrice)
609 {
610 <div class="prod-price">
611 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
612 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
613 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p>
614 </div>
615 }
616 else if(sellingPrice == internetPrice)
617 {
618 <div class="prod-price">
619 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
620 </div>
621 }
622 <div style="height:65px;">@* Add gap to fix aligment *@
623 <div class="member-price"></div>
624 </div>
625 }
626 @*inventoryDiscount false*@
627 else
628 {
629 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
630 {
631 @*<div class="prod-price">
632 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
633 </div>*@
634
635 if(sellingPrice != internetPrice)
636 {
637 <div class="prod-price">
638 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
639 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
640 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p>
641 </div>
642 }
643 else if(sellingPrice == internetPrice)
644 {
645 <div class="prod-price">
646 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
647 </div>
648 }
649
650 <div style="height:65px;">
651 <div class="member-price">
652 @if(memberPrice > 0)
653 {
654 <div id="proId" style="display:none"></div>
655 <div class="title" id="memberId">@Translate("VIP Member")
656 <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 online account to enjoy this price")">
657 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
658 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
659 </div>
660 <div class="title" id="birthdayId" >@Translate("VIP Birthday")
661 <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 online account to enjoy this price on your birthday month")">
662 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
663 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
664 </div>
665
666 }
667 @if(birthdayPrice > 0 && showBirthdayPrice)
668 {
669 <div class="title">@Translate("VIP Birthday")
670 <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")">
671 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
672 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
673 </div>
674 }
675 </div>
676 </div>
677 }
678 else if(Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
679 {
680 @*<div class="prod-price">
681 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
682 </div>*@
683
684 if(sellingPrice != internetPrice)
685 {
686 <div class="prod-price">
687 <p class="op">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
688 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
689 <p class="save-price">Save @product.GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p>
690 </div>
691 }
692 else if(sellingPrice == internetPrice)
693 {
694 <div class="prod-price">
695 <p class="np">@product.GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
696 </div>
697 }
698
699 if(userHasVIPCard)
700 {
701 if(userHasValidVipCard)
702 {
703 <div id="proId" style="display:none"></div>
704 <div style="height:65px;">
705 <div class="member-price">
706 <div class="title" id="memberId" >@Translate("VIP Member")
707 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price">
708 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
709 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
710 </div>
711 <div class="title" id="birthdayId">@Translate("VIP Birthday")
712 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price on your birthday month">
713 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
714 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
715 </div>
716 </div>
717 </div>
718 }
719
720 if(!birthday)
721 {
722 if(!userHasValidVipCard)
723 {
724 <div style="height:65px;">
725 <div class="member-price">
726 @if(memberPrice > 0)
727 {
728 <div class="title" id="memberId">@Translate("VIP Member")
729 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price " >
730 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
731 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
732 </div>
733 }
734 </div>
735 </div>
736 }
737 }
738 else if (birthday)
739 {
740 if(!userHasValidVipCard)
741 {
742 <div style="height:65px;">
743 <div class="member-price">
744 <div class="title" id="birthdayId">@Translate("VIP Birthday")
745 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price on your birthday month">
746 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon_info"></span>
747 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
748 </div>
749 </div>
750 </div>
751 }
752 }
753 }
754 else
755 {
756 if(memberPrice > 0)
757 {
758 <div id="proId" style="display:none"></div>
759 <div style="height:65px;">
760 <div class="member-price">
761 <div class="title" id="memberId" >@Translate("VIP Member")
762 <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 online account to enjoy this price") ">
763 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
764 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
765 </div>
766 <div class="title" id="birthdayId">@Translate("VIP Birthday")
767 <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 online account to enjoy this price on your birthday month")">
768 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
769 <p class="price">@product.GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
770 </div>
771 </div>
772 </div>
773 }
774 }
775 }
776 }
777 </div>
778 <!-------------------------------------------------------End Pricing---------------------------------------------------------------------------------------------------->
779 <hr>
780 @{
781 string tipsoMessage = "no Message Available!";
782 tipsoMessage = statusList[loopCounter];
783 switch (statusList[loopCounter].ToUpper())
784 {
785 case "AVAILABLE" :
786 //tipsoMessage = "Stocks are available, with the earliest delivery within 2 working days from the date of order.";
787 tipsoMessage = Translate("Stocks are available, with the earliest delivery within 3 working days from the date of order.");
788 break;
789 case "SPECIAL ORDER" :
790 //tipsoMessage = "We will check physical stocks availability before confirming your order.";
791 //tipsoMessage = Translate("Stocks are subject to supplier's availability. For more details, please contact") + " Customer Care hotline: 02-170-7979 / Line OA : @plcthailand";
792 tipsoMessage = Translate("SPECIAL ORDER Tooltip_Message");
793 break;
794 case "IN STOCK" :
795 tipsoMessage = Translate("Stocks are available at our retail stores for delivery within 7 working days upon receipt of payment.");
796 break;
797 default :
798 tipsoMessage = "no Message Available!";
799 break;
800 }
801 tipsoMessage = tipsoMessage.Replace("\'", "'");
802 <ul class="info">
803 <li>*@Translate(statusList[loopCounter])<span class="top tipso_style" data-tipso='@tipsoMessage' style="vertical-align: text-bottom;">
804 <img src="@pathproduct/images/icon_question_mark.png" alt="icon info" title="" style="width:10px;">
805 </span></li>
806 </ul>
807 if(statusList[loopCounter].ToUpper() == "SPECIAL ORDER")
808 {
809 <ul class="info" style="line-height: 32.7px;">
810 <li>*@Translate("NOT AVAILABLE ONLINE")</li>
811 </ul>
812 }
813 }
814 @if(statusList[loopCounter].ToUpper() != "SPECIAL ORDER")
815 {
816 <div class="btn-addto-cart smalldev">
817 <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;">
818 <span onclick='QtyControlBtn("quantityInput_@pid", "-");' type="button" data-value="-1" data-target="#spinner2" data-toggle="spinner">
819 <span class="glyphicon glyphicon-minus"></span>
820 </span>
821 <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">
822 <span onclick='QtyControlBtn("quantityInput_@pid", "+");' type="button" data-value="2" data-target="#spinner2" data-toggle="spinner">
823 <span class="glyphicon glyphicon-plus"></span>
824 </span>
825 </div>
826 <div class="col-md-6 col-sm-6 col-xs-6 mblAddTo" style="padding: 1px 5px;display: table-cell;">
827 <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;">
828 <i class="fa fa-shopping-cart"></i>
829 @Translate("Add to cart")
830 </a>
831 </div>
832 </div>
833 }
834 else
835 {
836 <div class="btn-addto-cart" style="margin-bottom:5px; cursor:not-allowed; display:none;">
837 <a ><i class="fa fa-shopping-cart"></i> In Store Only </a>
838 </div>
839 }
840 <!--<div class="btn-addto-cart smalldev" style="margin-bottom:5px;">
841 <a href="@GroupLink"><i class="fa fa-search-plus"></i> View products details </a>
842 </div>-->
843 <div class="prod-compare" style="height : 35px;">
844 @{
845 string productname = product.GetString("Ecom:Product.Name");
846 productname = productname.Replace("\"","❞");
847 }
848 <form>
849 <label>@Translate("Compare")
850 <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);">
851 <span></span>
852 </label>
853 </form>
854 </div>
855 </div>
856 }
857 <!--product end-->
858 }
859 loopCounter++;
860 }
861 }
862 <div onclick="topFunction()" id="myBtn" title="Go to top"></div>
863 }
864 <script>
865 function topFunction() {
866 //document.body.scrollTop = 0;
867 //document.documentElement.scrollTop = 0;
868 $('html, body').animate({ scrollTop: 0 }, 'fast')
869 }
870
871 window.onscroll = function() {scrollFunction()};
872
873 function scrollFunction() {
874 if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
875 document.getElementById("myBtn").style.display = "block";
876 } else {
877 document.getElementById("myBtn").style.display = "none";
878 }
879 }
880 </script>
881 <style>
882 @@media only screen and (min-width: 400px) and (max-width: 700px){
883 .breadcrumb {
884 margin-top: 280px;
885 }
886 }
887 @@media only screen and (min-width: 350px) and (max-width: 400px){
888 .breadcrumb {
889 margin-top: 275px;
890 }
891 .whenNotiMainPg .breadcrumb {
892 margin-top: 140px !important;
893 }
894 }
895 @@media only screen and (max-width: 350px){
896 .breadcrumb {
897 margin-top: 55px;
898 }
899 .whenNotiMainPg .breadcrumb {
900 margin-top: 55px !important;
901 }
902 }
903 @@media only screen and (device-height: 640px) and (device-width: 360px){
904 .whenNotiMainPg .breadcrumb {
905 margin-top: 150px !important;
906 }
907 .breadcrumb {
908 margin-top: 60px !important;
909 }
910 }
911 @@media only screen and (device-height: 1138px) and (device-width: 712px){
912 .breadcrumb {
913 margin-top: 260px !important;
914 }
915 .whenNotiMainPg .breadcrumb {
916 margin-top: 75px !important;
917 }
918 }
919 @@media only screen and (device-height: 812px) and (device-width: 375px){
920 .breadcrumb {
921 margin-top: 280px !important;
922 }
923 .whenNotiMainPg .breadcrumb {
924 margin-top: 50px !important;
925 }
926 }
927
928 .lbl-pd-size, .lbl-pd-flavour, .lbl-pd-color, .lbl-pd-qty{
929 padding-left: 0;
930 }
931 .selectbox-size, .selectbox-flavour, .selectbox-color, .selectbox-qty{
932 padding: 5px;
933 width: 100%;
934 }
935 .qty-div{
936 padding: 0;
937 }
938 .sidenavi-title {
939 margin-bottom: 30px;
940 }
941 @@media only screen and (max-width: 768px){
942 #ImmediateAvailabilityAtDesktop_Onlinebtn {
943 display: none;
944 margin: 0;
945 width: 310px;
946 }
947 #ImmediateAvailabilityAtDesktop{
948 display: none;
949 }
950 #ImmediateAvailabilityAtMobile_Onlinebtn {
951 display: block;
952 margin: 0;
953
954 }
955 #ImmediateAvailabilityAtMobile {
956 display: block;
957 width:100% !important !important;
958 }
959 .content-wrapper{
960 top:0px;
961 }
962 }
963 @@media only screen and (min-width: 769px){
964 #ImmediateAvailabilityAtDesktop_Onlinebtn {
965 display: block;
966 margin: 0;
967 //width:260px;
968 }
969 #ImmediateAvailabilityAtDesktop{
970 display: block;
971 }
972 #ImmediateAvailabilityAtMobile_Onlinebtn {
973 display: none;
974 margin: 0;
975 width:260px;
976 }
977 #ImmediateAvailabilityAtMobile {
978 display: none;
979 }
980 }
981 .qtyboxright{
982 float : right;
983 }
984 @@media screen and (max-width: 700px) and (min-width: 350px) and (max-height: 700px) {
985 .qtyboxright{
986 float : unset;
987 }
988 }
989 .tab-pane {
990 display: none;
991 }
992 .active {
993 display: block;
994 }
995 #addtocartLink {
996 margin-top:10px;
997 }
998 .nav-tabs > li{
999 margin-bottom:5px;
1000 }
1001 .spaceheight{
1002 height:25px;
1003 }
1004 .shoplist{
1005 max-height:400px;
1006 overflow-x:hidden;
1007 <!--overflow-y:scroll;-->
1008 margin:0px;
1009 }
1010 ul.sidenavi{
1011 width: 230px;
1012 }
1013
1014 @@media screen and (max-width: 800px) and (min-width: 765px) and (max-height: 1200px) {
1015 .whenNotiMainPg {
1016 margin-top: 60px !important;
1017 }
1018 }
1019 </style>
1020 @using DWAPAC.PLC.Services
1021 @{
1022 string path="/Admin/Public/Getimage.ashx?width=300&height=300&compression=60&Crop=5&image=";
1023 string imgpath="/Files/Images/Ecom/Products/";
1024 var birthday = false;
1025 bool showBirthdayPrice = false;
1026 bool userHasVIPCard = false;
1027 bool userHasValidVipCard = false;
1028 DateTime expDate = new DateTime();
1029 DateTime today = DateTime.Now;
1030 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
1031 {
1032 int i = Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID"));
1033 Dynamicweb.Security.UserManagement.User u = Dynamicweb.Security.UserManagement.User.GetUserByID(i);
1034
1035 foreach (CustomFieldValue val in u.CustomFieldValues)
1036 {
1037 CustomField field = val.CustomField;
1038 string fieldName = field.Name;
1039
1040 if(fieldName == "DOB")
1041 {
1042 DateTime bDay = new DateTime();
1043 if(val.Value != null)
1044 {
1045 bDay = (DateTime)val.Value;
1046 if(bDay.Month == today.Month)
1047 {
1048 birthday = true;
1049 }
1050 }
1051 }
1052 if(fieldName == "ExpryDate")
1053 {
1054 expDate = (DateTime)val.Value;
1055 }
1056 switch (fieldName.ToUpper())
1057 {
1058 case "VIP CARD NO":
1059 userHasVIPCard = !string.IsNullOrEmpty((val.Value).ToString());
1060 break;
1061 case "EXPRYDATE":
1062 userHasValidVipCard = expDate.Date < today.Date;
1063 break;
1064 default:
1065 break;
1066 }
1067 }
1068 }
1069 showBirthdayPrice = birthday && userHasVIPCard && userHasValidVipCard;
1070 string firstCategory = GetString("Ecom:Product:Field.FirstCategory");
1071 string secondCategory = GetString("Ecom:Product:Field.SecondCategory");
1072 string thirdCategory = GetString("Ecom:Product:Field.ThirdCategory");
1073 string pid = GetString("Ecom:Product.ID");
1074
1075 string Image = GetString("Ecom:Product.ImageMedium.Default.Clean");
1076 string imgpathjpg = imgpath+pid+".jpg";
1077 string imgpathpng = imgpath+pid+".png";
1078 var absolutePathsjpg = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpathjpg);
1079 var absolutePathpng = System.Web.HttpContext.Current.Server.MapPath("~/"+ imgpathpng);
1080 if(System.IO.File.Exists(absolutePathsjpg))
1081 {
1082 Image = imgpathjpg;
1083 }
1084 else if(System.IO.File.Exists(absolutePathpng))
1085 {
1086 Image = imgpathpng;
1087 }
1088
1089 var ProdImgLargePath = "/Files/Images/Ecom/Products/Large/";
1090 string ProdImgLarge = GetString("Ecom:Product.ImageLarge.Default.Clean");
1091 ProdImgLargePath = ProdImgLargePath+pid+".jpg";
1092 var absolutePathjpg = System.Web.HttpContext.Current.Server.MapPath("~/"+ ProdImgLargePath);
1093 if(System.IO.File.Exists(absolutePathjpg))
1094 {
1095 ProdImgLarge=ProdImgLargePath;
1096 }
1097
1098 string ProdName = GetString("Ecom:Product.Name");
1099 string ProdBarCode = GetString("Ecom:Product:Field.ProductBarCode");
1100 string pathproduct = "/Files/Images/plc";
1101 string productNumber = GetString("Ecom:Product.Number");
1102 string pageID = GetString("Ecom:Product:Page.ID");
1103 string skuCode = GetString("Ecom:Product:Field.SKUCode");
1104 string productSize = GetString("Ecom:Product:Field.Size");
1105 string productFlavour = GetString("Ecom:Product:Field.Flavour");
1106 string productColor = GetString("Ecom:Product:Field.Color");
1107
1108 bool hasSize = !string.IsNullOrEmpty(GetString("Ecom:Product:Field.Size"));
1109 bool hasFlavour = !string.IsNullOrEmpty(GetString("Ecom:Product:Field.Flavour"));
1110 bool hasColor = !string.IsNullOrEmpty(GetString("Ecom:Product:Field.Color"));
1111 int hasVariantCount = 0;
1112 hasVariantCount += hasSize ? 1 : 0;
1113 hasVariantCount += hasFlavour ? 1 : 0;
1114 hasVariantCount += hasColor ? 1 : 0;
1115
1116 string ProdStock = GetString("Ecom:Product.Stock");
1117 string ProdRating = GetString("Comments.Rating.Rounded2");
1118 string ProdLongDesc = GetString("Ecom:LongDescription");
1119 string ProdBrand = GetString("Ecom:Product:Field.ProductBrand");
1120 string ProdBrandEncode = System.Web.HttpUtility.UrlEncode(GetString("Ecom:Product:Field.ProductBrand"));
1121 string ProdInfo = GetString("Ecom:Product:Field.ProductInfo");
1122 string ProdActualPrice = GetString("Ecom:Product.Price");
1123 string ProdAvilableAmount = GetString("Ecom:Product.AvilableAmount");
1124 string ProdDiscount = GetString("Ecom:Product.Discount.Price");
1125 string ProdReview = GetString("Comments.TotalCount");
1126 string ProductVideoUrl = GetString("Ecom:Product:Field.Product_Video_Url");
1127 var ProdSMemberPrice = GetDouble("Ecom:Product:Field.ProductSMemberPrice");
1128 var ProdBDPrice = GetDouble("Ecom:Product:Field.ProductSBirthdayPrice");
1129 string ProdSCost = GetString("Ecom:Product:Field.ProductSCodt");
1130 string CurrencyCode = GetString("Ecom:Product.Price.Currency.Code");
1131 string ProdPubBrand = GetString("Ecom:Product:Field.PublicBrand");
1132 var productDetails = GetString("Ecom:Product:Field.ProductInfo");
1133 Boolean ProdRepackitems = GetBoolean("Ecom:Product:Field.RepackedItems");
1134 double productWeight = GetDouble("Ecom:Product.Weight");
1135 string repackProductId = "";
1136 double repackPrice = 0.00;
1137 var promoItems = "";
1138 var promoDescription = "";
1139 var internetPrice = Math.Floor((GetDouble("Ecom:Product:Field.ProductSInternetPrice"))*1000/5)/200;
1140 var price = 9.95;
1141
1142 if(price == GetDouble("Ecom:Product:Field.ProductSInternetPrice"))
1143 {
1144 internetPrice= GetDouble("Ecom:Product:Field.ProductSInternetPrice");
1145 }
1146
1147 var sellingPrice = Math.Floor((GetDouble("Ecom:Product:Field.ProductSPrice"))*1000/5)/200;
1148 Boolean inventoryDiscount = GetBoolean("Ecom:Product:Field.ProductInventoryDiscountFlag");
1149 var discountPercentage = GetDouble("Ecom:Product:Field.ProductInventoryDiscount");
1150 var birthdayPrice = Math.Floor((GetDouble("Ecom:Product:Field.ProductSBirthdayPrice"))*1000/5)/200;
1151 var memberPrice = Math.Floor((GetDouble("Ecom:Product:Field.ProductSMemberPrice"))*1000/5)/200;
1152 var promotion=0.00;
1153 var discountType="";
1154 foreach (LoopItem item in GetLoop("ProductDiscounts"))
1155 {
1156 if(item.GetString("Ecom:Product.Discount.Type")=="PERCENT")
1157 {
1158 discountType = "PERCENT";
1159 promotion = item.GetDouble("Ecom:Product.Discount.PercentWithoutVATFormatted");
1160 }
1161 else
1162 {
1163 discountType = "AMOUNT";
1164 promotion = item.GetDouble("Ecom:Product.Discount.AmountWithoutVATFormatted");
1165 }
1166 }
1167
1168 var storeLocationId = WebServices.getProductLocationServiceResponse(pid);
1169
1170 List<string> storeNameList = new List<string>();
1171 Dictionary<string, string> storeAddress1List = new Dictionary<string,string>();
1172 Dictionary<string, string> storeAddress2List = new Dictionary<string,string>();
1173 Dictionary<string, string> storePhoneNumberList = new Dictionary<string,string>();
1174 var storeLocationList ="0";
1175
1176 if( !string.IsNullOrWhiteSpace(storeLocationId))
1177 {
1178 var status = storeLocationId.Split(';')[0].Split('=')[1];
1179 if(status == "200")
1180 {
1181 storeLocationList = storeLocationId.Split(new string[] { "GetProductLocationResult=" }, StringSplitOptions.None)[1];
1182 storeLocationList = storeLocationList.Substring(1);
1183 storeLocationList = storeLocationList.Remove(storeLocationList.Length -1).Replace("\"","");
1184 }
1185 }
1186
1187 if(storeLocationList!="0"){
1188 var storeLocationNoList = storeLocationList.Split(',').Distinct().ToList();
1189
1190
1191 foreach(var storeNo in storeLocationNoList){
1192 var sqlString = "Select * from PLCStoreLocations where Storeid='" + storeNo + "'";
1193 using(System.Data.IDataReader myReader2 = Dynamicweb.Data.Database.CreateDataReader(sqlString))
1194 {
1195 while (myReader2.Read())
1196 {
1197 storeNameList.Add(myReader2["WebName"].ToString());
1198 storeAddress1List.Add(myReader2["WebName"].ToString(),myReader2["StoreAdd1"].ToString());
1199 storeAddress2List.Add(myReader2["WebName"].ToString(),myReader2["StoreAdd2"].ToString());
1200 storePhoneNumberList.Add(myReader2["WebName"].ToString(),myReader2["StoreTel"].ToString());
1201 }
1202 }
1203 }
1204
1205 storeNameList =storeNameList.OrderBy(q => q).ToList();
1206
1207 }
1208 //Start of variant selection
1209
1210 string variantSelector = "";
1211
1212 if(!string.IsNullOrEmpty(productSize))
1213 {
1214 variantSelector = "size";
1215 }
1216 if(!string.IsNullOrEmpty(productColor))
1217 {
1218 variantSelector = "color";
1219 }
1220 if(!string.IsNullOrEmpty(productFlavour))
1221 {
1222 variantSelector = "flavour";
1223 }
1224 if(!string.IsNullOrEmpty(productSize) && !string.IsNullOrEmpty(productFlavour)){
1225 variantSelector = "flavour";
1226 }
1227 else if(!string.IsNullOrEmpty(productSize) && !string.IsNullOrEmpty(productColor)){
1228 variantSelector = "color";
1229 }
1230 else if( string.IsNullOrEmpty(productColor) && string.IsNullOrEmpty(productFlavour)){
1231 variantSelector = "size";
1232 }
1233
1234 List<string> sizeList=new List<string>();
1235 List<string> flavourList=new List<string>();
1236 List<string> colorList=new List<string>();
1237
1238 if(variantSelector == "color")
1239 {
1240 String SQL = "SELECT DISTINCT(Size) FROM EcomProducts WHERE SKUCodes IN (SELECT SkuCodes FROM EcomProducts WHERE ProductId='" + pid + "'AND ProductlanguageId='LANG2') AND Size IS NOT NULL";
1241 using(System.Data.IDataReader myReader = Dynamicweb.Data.Database.CreateDataReader(SQL))
1242 {
1243 while (myReader.Read())
1244 {
1245 string size = myReader["Size"].ToString();
1246 sizeList.Add(size);
1247 }
1248 }
1249 String SQL2 = "SELECT DISTINCT(Color) FROM EcomProducts WHERE SKUCodes = (SELECT DISTINCT(SkuCodes) FROM EcomProducts WHERE ProductId='"+pid+"'AND ProductlanguageId='LANG2') AND Size='"+productSize+"'";
1250 using(System.Data.IDataReader myReader2 = Dynamicweb.Data.Database.CreateDataReader(SQL2))
1251 {
1252 while (myReader2.Read())
1253 {
1254 string color1 = myReader2["Color"].ToString();
1255 colorList.Add(color1);
1256 }
1257 }
1258 }
1259 else if(variantSelector == "flavour")
1260 {
1261 String SQL = "SELECT DISTINCT(Size) FROM EcomProducts WHERE SKUCodes IN (SELECT SkuCodes FROM EcomProducts WHERE ProductId='"+pid+"'AND ProductlanguageId='LANG2') AND Size IS NOT NULL";
1262 using(System.Data.IDataReader myReader = Dynamicweb.Data.Database.CreateDataReader(SQL))
1263 {
1264 while (myReader.Read())
1265 {
1266 string size= myReader["Size"].ToString();
1267 sizeList.Add(size);
1268 }
1269 }
1270
1271 String SQL2 = "SELECT DISTINCT(Flavor) FROM EcomProducts WHERE SKUCodes = (SELECT DISTINCT(SkuCodes) FROM EcomProducts WHERE ProductId='"+pid+"'AND ProductlanguageId='LANG2') AND Size='"+productSize+"'";
1272 using(System.Data.IDataReader myReader2 = Dynamicweb.Data.Database.CreateDataReader(SQL2))
1273 {
1274 while (myReader2.Read())
1275 {
1276 string flavour1= myReader2["flavor"].ToString();
1277 flavourList.Add(flavour1);
1278 }
1279 }
1280 }
1281 else if(variantSelector =="size")
1282 {
1283 String SQL = "SELECT DISTINCT(Size) FROM EcomProducts WHERE SKUCodes IN (SELECT SkuCodes FROM EcomProducts WHERE ProductId='"+pid+"'AND ProductlanguageId='LANG2') AND ProductActive = 1 AND Size IS NOT NULL";
1284 using(System.Data.IDataReader myReader = Dynamicweb.Data.Database.CreateDataReader(SQL))
1285 {
1286 while (myReader.Read())
1287 {
1288 string size= myReader["Size"].ToString();
1289 sizeList.Add(size);
1290 }
1291 }
1292 }
1293 //End of Variant
1294
1295 //Start of repack
1296 if(ProdRepackitems)
1297 {
1298 if(productWeight == 0)
1299 {
1300 String SQL = "SELECT FieldValueProductId FROM EcomProductCategoryFieldValue WHERE FieldValueFieldId='Is_Default'";
1301 using(System.Data.IDataReader myReader = Dynamicweb.Data.Database.CreateDataReader(SQL))
1302 {
1303 while (myReader.Read())
1304 {
1305 repackProductId=myReader["FieldValueProductId"].ToString();
1306 }
1307 }
1308 }
1309 else
1310 {
1311 List<string> WeightList=new List<string>();
1312 List<string> RepackProductIdList=new List<string>();
1313 String SQL1 = "SELECT * FROM EcomProductCategoryFieldValue WHERE FieldValueFieldCategoryId='Repack' AND FieldValueFieldId='From_Weight' OR FieldValueFieldId='To_Weight' ";
1314 using(System.Data.IDataReader myReader1 = Dynamicweb.Data.Database.CreateDataReader(SQL1))
1315 {
1316 while (myReader1.Read())
1317 {
1318 WeightList.Add(myReader1["FieldValueValue"].ToString());
1319 RepackProductIdList.Add(myReader1["FieldValueProductId"].ToString());
1320 }
1321 }
1322 for(int i=0; i<WeightList.Count;i++)
1323 {
1324 if(productWeight > Double.Parse(WeightList[i]))
1325 {
1326 if(productWeight <= Double.Parse(WeightList[i+1]))
1327 {
1328 repackProductId=RepackProductIdList[i+1].ToString();
1329 }
1330 }
1331 }
1332 }
1333
1334 string SQL4="SELECT ProductSInternetPrice FROM EcomProducts WHERE ProductId='"+repackProductId+"'";
1335 using(System.Data.IDataReader myReader4 = Dynamicweb.Data.Database.CreateDataReader(SQL4))
1336 {
1337 while (myReader4.Read())
1338 {
1339 repackPrice = Double.Parse(myReader4["ProductSInternetPrice"].ToString());
1340 }
1341 }
1342 }
1343
1344 }
1345
1346 <script>
1347 function setCookie(cname, cvalue, exdays) {
1348 var d = new Date();
1349 d.setTime(d.getTime() + (exdays*24*60*60*1000));
1350 var expires = "expires="+ d.toUTCString();
1351 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
1352 }
1353 function getCookie(cname) {
1354 var name = cname + "=";
1355 var ca = document.cookie.split(';');
1356 for(var i = 0; i <ca.length; i++) {
1357 var c = ca[i];
1358 while (c.charAt(0)==' ') {
1359 c = c.substring(1);
1360 }
1361 if (c.indexOf(name) == 0) {
1362 return c.substring(name.length,c.length);
1363 }
1364 }
1365 return "";
1366 }
1367
1368 </script>
1369
1370 <div hidden>hasSize: @hasSize | hasFlavour: @hasFlavour | hasColor: @hasColor | hasVariantCount: @hasVariantCount</div>
1371
1372 <div id="get_@pid">
1373 <div id="dvLoading" style="
1374 width: 100%;
1375 height: 100%;
1376 background: rgba(0,0,0,0.2);
1377 background-image:url('/Files/Images/plc/images/bx_loader.gif');
1378 background-repeat:no-repeat;
1379 background-position:center;
1380 z-index:10000000;
1381 position: fixed;
1382 top: 0px;
1383 left: 0px;
1384 display: none;
1385 ">
1386
1387 </div>
1388 <div align="center" class="col-1-3" style="margin-top:15px;">
1389
1390 <script>
1391 window.DY = window.DY || {};
1392 DY.recommendationContext = { type : "PRODUCT" , data : ["@productNumber"] };
1393 </script>
1394
1395 <form id="@pid" style="display:none" method="post" >
1396
1397 <input type="" name='ProductLoopCounter@(GetString("Ecom:Product.LoopCounter"))' value='@GetString("Ecom:Product.LoopCounter")' />
1398 <input type="" name='ProductID@(GetString("Ecom:Product.LoopCounter"))' value='@GetString("Ecom:Product.ID")' />
1399 <input type="number" name="Quantity@(GetString("Ecom:Product.LoopCounter"))" id="productFormQuantity" value="1" />
1400
1401 <input type="" name='ProductLoopCounter2' value='2' />
1402 <input type="" name='ProductID2' id="repackProductId" value='@repackProductId' />
1403 <input type="number" id="repackFormQuantity" name="Quantity2" value="1" />
1404 <input name= "EcomOrderLineFieldInput_ParentProductId2" value="@GetString("Ecom:Product.ID")"/>
1405 <button id="multiFormSubmit" type="submit" name="CartCmd" value="AddMulti" title="add to cart Repack">Add all</button>
1406 </form>
1407 <div class="product-box">
1408 <div class="prod-img">
1409 @if(promotion != 0){
1410 if(discountType=="PERCENT")
1411 {
1412 <div class="ribbon-P"><span>Pro @promotion% Off</span></div>
1413 }
1414 else{
1415 <div class="ribbon-P"><span>Pro @GetString("Ecom:Product.Currency.Symbol")@promotion Off</span></div>
1416 }
1417
1418 }
1419 else
1420 {
1421 //add ERP discount ribbon
1422 if(inventoryDiscount){
1423 if(discountPercentage != 0)
1424 {
1425 <div class="ribbon-D"><span>@discountPercentage% Off</span></div>}
1426 }
1427 }
1428 </div>
1429
1430
1431 <img id="zoom_product" src='@path@Image' data-zoom-image="@ProdImgLarge" alt="@pid"/>
1432
1433 </div>
1434 <p align="center" class="smallText">@Translate("Rollover image to view larger image","Rollover image to view larger image")</p>
1435 @*<div class="clearfix spaceheight"><p> </p></div>*@
1436 @if(GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
1437 {
1438 <ul id="ImmediateAvailabilityAtDesktop" class="sidenavi">
1439 @if(storeNameList.Count != 0)
1440 {
1441 <li class="current curSub"><a style="background: #e6e6e6;text-align: left;">@Translate("Immediate Availability At","Immediate Availability At")</a>
1442 <ul id="leftnavigation" class="sidenavi shoplist">
1443 @foreach(var string1 in storeNameList)
1444 {
1445 <li class="text-left">
1446 <a href="#@string1.Replace(" ","_")" data-toggle="collapse">@string1</a>
1447 <div id="@string1.Replace(" ","_")" class="collapse" style="padding-left: 35px;">
1448 <p><i class="fa fa-map-marker"></i> @storeAddress1List[string1] @Translate(",",",") @storeAddress2List[string1] </p>
1449 <p><i class="fa fa-phone"></i> @storePhoneNumberList[string1]</p>
1450 </div>
1451 </li>
1452 }
1453 </ul>
1454 </li>
1455 }
1456 </ul>
1457 }
1458 else
1459 {
1460 if(storeNameList.Count != 0)
1461 {
1462 <!--<p>storeNameList count: @storeNameList.Count()</p>-->
1463 <ul id="ImmediateAvailabilityAtDesktop" class="sidenavi">
1464 <li class="current curSub"><a style="background: #e6e6e6;text-align: left;">@Translate("Immediate Availability At","Immediate Availability At")</a>
1465 <ul id="leftnavigation" class="sidenavi shoplist"><div style="color:#ff8c00; text-align: left;font-weight: 600; margin: 10px;">@Translate("Please call to reserve").</div>
1466 @foreach(var string1 in storeNameList)
1467 {
1468 <li class="text-left">
1469 <a href="#@string1.Replace(" ","_").Replace(".","")" data-toggle="collapse">@string1</a>
1470 <div id="@string1.Replace(" ","_").Replace(".","")" class="collapse" style="padding-left: 35px;">
1471 <p><i class="fa fa-map-marker"></i> @storeAddress1List[string1] @Translate(",",",") @storeAddress2List[string1] </p>
1472 <p><i class="fa fa-phone"></i> @storePhoneNumberList[string1]</p>
1473 </div>
1474 </li>
1475 }
1476 </ul>
1477 </li>
1478 </ul>
1479 }
1480 else
1481 {
1482 <ul id="ImmediateAvailabilityAtDesktop_Onlinebtn" class="sidenavi">
1483 <li class="current curSub">
1484 <a style="background: #e6e6e6;text-align: center;margin: 20px -14px;padding:0;">@Translate("Currently Unavailable in Stores","Currently Unavailable in Stores")</a>
1485 </li>
1486 </ul>
1487 }
1488 }
1489
1490 </div>
1491 @foreach(var promoItem in GetLoop("AllDiscounts"))
1492 {
1493 promoItems += promoItem.GetString("Ecom:AllDiscounts.Discount.Name") + "<br>";
1494 }
1495
1496 <div class="col-2-3">
1497 <div class="prod-details-top col-1-1">
1498 <p class="small-name" style="color: #808080;font-size: large;">@ProdBrand</p>
1499 <h1>@ProdName </h1>
1500 @if(promoName != "")
1501 {
1502 <div style="color:#ff8c00;font-weight: 600;font-size: medium;">@promoName</div>
1503 <!--<div style="color:#ff8c00;font-weight: 600;font-size: small;">@promoD</div>-->
1504 }
1505 <div class="">
1506 @*<div style="padding-right:0px !important;color : #c8c8c8;" class="item col-md-3">@Translate("SKU :","SKU :") @productNumber</div>*@
1507 <div style="color : #c8c8c8;">@Translate("SKU :","SKU :") @productNumber</div>
1508 @{
1509 var getProductMultiStatusAdvServiceResponse = WebServices.getProductMultiStatusAdvServiceResponse("{[" + pid + "]}");
1510 var getProductMultiStatusAdvServiceResponseSplit = getProductMultiStatusAdvServiceResponse.Split(';');
1511 string productStockStatus = getProductMultiStatusAdvServiceResponseSplit[2].Split('{')[1].Replace("}","").Split(':')[1].Replace("]", "");
1512
1513 string tipsoMessage = "no Message Available!";
1514 switch (productStockStatus.ToUpper())
1515 {
1516 case "AVAILABLE" :
1517 tipsoMessage = Translate("Stocks are available, with the earliest delivery within 3 working days from the date of order.");
1518 break;
1519 case "SPECIAL ORDER" :
1520 //tipsoMessage = "Stocks are subject to supplier’s availability. For more details, please contact Customer Care hotline: 02-170-7979 / Line OA : @plcthailand";
1521 tipsoMessage = Translate("SPECIAL ORDER Tooltip_Message");
1522 break;
1523 case "IN STOCK" :
1524 tipsoMessage = Translate("Stocks are available at our retail stores for delivery within 7 working days upon receipt of payment.");
1525 break;
1526 default :
1527 tipsoMessage = "no Message Available!";
1528 break;
1529 }
1530 tipsoMessage = tipsoMessage.Replace("\'", "'");
1531 }
1532 <div>
1533 @if(!GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
1534 {
1535 <br/>
1536 @Translate(productStockStatus)
1537 <span class="top tipso_style" data-tipso='@tipsoMessage' style="vertical-align: text-bottom;">
1538 <img src="/Files/Images/plc/images/icon_question_mark.png" alt="icon info" title="" style="width:12px;">
1539 </span>
1540 }
1541 </div>
1542 <div class="prod-star col-md-4">
1543 <p style="margin:-7px 0px;padding:0px;float:left;display:none;" class="rating">
1544 <input type="radio" id="star5" name="rating" value="5" /><label class = "full" for="=" title="Awesome - 5 stars"></label>
1545 <input type="radio" id="star4half" name="rating" value="4.5" /><label class="half" for="=" title="Pretty good - 4.5 stars"></label>
1546 <input type="radio" id="star4" name="rating" value="4" /><label class = "full" for="=" title="Pretty good - 4 stars"></label>
1547 <input type="radio" id="star3half" name="rating" value="3.5" /><label class="half" for="=" title="Meh - 3.5 stars"></label>
1548 <input type="radio" id="star3" name="rating" value="3" /><label class = "full" for="=" title="Meh - 3 stars"></label>
1549 <input type="radio" id="star2half" name="rating" value="2.5" /><label class="half" for="=" title="Kinda bad - 2.5 stars"></label>
1550 <input type="radio" id="star2" name="rating" value="2" /><label class = "full" for="=" title="Kinda bad - 2 stars"></label>
1551 <input type="radio" id="star1half" name="rating" value="1.5" /><label class="half" for="=" title="Meh - 1.5 stars"></label>
1552 <input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="=" title="Sucks big time - 1 star"></label>
1553 <input type="radio" id="starhalf" name="rating" value="0.5" /><label class="half" for="=" title="Sucks big time - 0.5 stars"></label>
1554 </p>
1555 </div>
1556 <script>
1557
1558
1559
1560 $(document).ready(function() {
1561 $("#toggleReview").click(function() {
1562 $("#reviewButton").click();
1563 $('body, html').animate({
1564 scrollTop: $("#cmtContainer").offset().top
1565 }, 1000);
1566 });
1567 $("#toggleWrite").click(function() {
1568 $("#reviewButton").click();
1569 $('body, html').animate({
1570 scrollTop: $(".formContact").offset().top
1571 }, 1000);
1572 });
1573
1574 var ratingStars = document.getElementsByName('rating');
1575
1576 for(var i = 0; i<ratingStars.length;i++){
1577
1578 if(ratingStars[i].value == "@ProdRating"){
1579
1580 ratingStars[i].click();
1581 }
1582 }
1583
1584 });
1585
1586 </script>
1587
1588 <!--<div class="clearfix upper-review"></div>
1589 <div class="review col-md-5">
1590 @*<a id="toggleReview" href="javascript:void(0)">@Translate("Read reviews","Read reviews")</a>
1591 (@ProdReview)|
1592 <a id="toggleWrite" href="javascript:void(0)">Write review</a>*@
1593 </div> -->
1594
1595 </div>
1596 </div>
1597
1598 <hr class="grey">
1599
1600 <div class="prod-details-left col-5-12">
1601 @{
1602 string sellingPriceStr = ((sellingPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice) : string.Format("{0:0}", sellingPrice);
1603 string internetPriceStr = ((internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", internetPrice) : string.Format("{0:0}", internetPrice);
1604 string savePriceStr = ((sellingPrice-internetPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", sellingPrice-internetPrice) : string.Format("{0:0.00}", sellingPrice-internetPrice);
1605 string memberPriceStr = ((memberPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", memberPrice) : string.Format("{0:0}", memberPrice);
1606 string birthdayPriceStr = ((birthdayPrice * 100) % 100) > 0 ? string.Format("{0:0.00}", birthdayPrice) : string.Format("{0:0}", birthdayPrice);
1607 }
1608 @if(inventoryDiscount)
1609 {
1610 if(sellingPrice!=internetPrice)
1611 {
1612 <div class="prod-price">
1613 <p class="op">@GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
1614 <p class="np">@GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
1615 <p class="save-price">Save @GetString("Ecom:Product.Currency.Symbol")@savePriceStr @*@string.Format("{0:0}", sellingPrice-internetPrice)*@</p>
1616 </div>
1617 }
1618 else if(sellingPrice == internetPrice)
1619 {
1620 <div class="prod-price">
1621 <p class="np">@GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
1622 </div>
1623 }
1624 }
1625 else{
1626 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
1627 <div class="prod-price">
1628 <p class="np">@GetString("Ecom:Product.Currency.Symbol")@sellingPriceStr</p>
1629 </div>
1630 <div class="member-price">
1631 @if(memberPrice > 0)
1632 {
1633 <div id="proId" style="display:none"></div>
1634 <div class="title" id="memberId">@Translate("VIP Member")
1635 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and log in to your online account to enjoy this price")">
1636 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
1637 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
1638 </div>
1639 <div class="title" id="birthdayId">@Translate("VIP Birthday")
1640 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and log in to your online account to enjoy this price on your birthday month")">
1641 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
1642 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
1643 </div>
1644 }
1645 @if(birthdayPrice > 0 && showBirthdayPrice){
1646 <div class="title">@Translate("VIP Birthday")
1647 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and enjoy this price on your birthday month")">
1648 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
1649 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
1650 </div>
1651 }
1652 </div>
1653 }else if(Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
1654 <div class="prod-price">
1655 <p class="np">@GetString("Ecom:Product.Currency.Symbol")@internetPriceStr</p>
1656 </div>
1657 if(userHasVIPCard){
1658 if(userHasValidVipCard)
1659 {
1660 <div id="proId" style="display:none"></div>
1661 <div class="member-price">
1662 <div class="title" id="memberId" >@Translate("VIP Member")
1663 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and enjoy this price")">
1664 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
1665 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
1666 </div>
1667 <div class="title" id="birthdayId">@Translate("VIP Birthday")
1668 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and enjoy this price on your birthday month")">
1669 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
1670 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
1671 </div>
1672 </div>
1673 }
1674
1675 if(!birthday){
1676 if(!userHasValidVipCard){
1677 <div class="member-price">
1678 @if(memberPrice > 0)
1679 {
1680 <div class="title" id="memberId">@Translate("VIP Member")
1681 <span class="top tipso_style" data-tipso=" As a VIP member, you get to enjoy this price">
1682 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
1683 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
1684 </div>
1685 }
1686 </div>
1687 }
1688 }
1689 else if (birthday){
1690 if(!userHasValidVipCard){
1691 <div class="member-price">
1692 <div class="title" id="birthdayId">@Translate("VIP Birthday")
1693 <span class="top tipso_style" data-tipso="As a VIP member, you get to enjoy this price on your birthday month">
1694 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon_info"></span>
1695 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
1696 </div>
1697 </div>
1698 }
1699 }
1700 }else{
1701 if(memberPrice > 0)
1702 {
1703 <div id="proId" style="display:none"></div>
1704 <div class="member-price">
1705 <div class="title" id="memberId">@Translate("VIP Member")
1706 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and enjoy this price")">
1707 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info" title=""></span>
1708 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@memberPriceStr</p>
1709 </div>
1710 <div class="title" id="birthdayId">@Translate("VIP Birthday")
1711 <span class="top tipso_style" data-tipso="@Translate("Become a VIP member for only") @GetString("Ecom:Product.Currency.Symbol")100 @Translate("and enjoy this price on your birthday month")">
1712 <img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon info"></span>
1713 <p class="price">@GetString("Ecom:Product.Currency.Symbol")@birthdayPriceStr</p>
1714 </div>
1715 </div>
1716 }
1717 }
1718 }
1719 }
1720
1721
1722 </div>
1723 @if(birthday){
1724 <div class="info-box" style="background:none;">
1725 @*<h3>That's because it's your birthday this month!</h3>*@
1726 </div>
1727 }
1728 @*
1729 <p><span class="bold">Spend @CurrencyCode 100, Save @CurrencyCode 20</span></p>
1730 <p><span class="bold">@Translate("Free delivery on all Online Orders","Free delivery on all Online Orders")</span></p>
1731 *@
1732 </div>
1733
1734 @if(GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
1735 {
1736 showHide = "hidden";
1737 <div class="prod-details-right pull-right col-8-12">
1738 <div style="padding: 10px;">
1739 <p style="background-color: darkgray; padding: 2px 30px; width: fit-content; color: #ffffff;">Available in Store Only</p>
1740 <strong style="font-size: 16px; color: #952203;">
1741 <label id="ctl00_ContentPlaceHolder1_ASPxLabel92">Remarks :</label>
1742 </strong>
1743 <div style="font-size: 12px; margin-left: -25px;">
1744 <ul>
1745 <li>Clearance Sale items are limited and valid for in-store purchase only, while stocks
1746 last.
1747 </li>
1748 <li>VIP members can call respective stores to place a reservation for Clearance Sale
1749 items, limited to a maximum of 5 items and up to 3 days.
1750 </li>
1751 </ul>
1752 </div>
1753 <strong style="font-size: 16px; color: #952203;">
1754 <label id="ctl00_ContentPlaceHolder1_ASPxLabel94">Terms & Conditions :</label>
1755 </strong>
1756 <div style="font-size: 12px; padding-top: 5px;">
1757 <span style="color: #000000;"><a href="/clearance-sales-terms-conditions"><span style="text-decoration: underline;">
1758 Click here</span></a> to view the Clearance Sale's Terms & Conditions
1759 </span>
1760 </div>
1761 </div>
1762 </div>
1763
1764 }
1765 <div class="prod-details-right col-8-12 " @showHide>
1766 <div class="detailsform" style="display: table !important;width:100% !important; ">
1767 @if(!string.IsNullOrEmpty(productSize))
1768 {
1769 <div class="col-md-12 col-sm-12 col-xs-12" style="">
1770 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-size" style="margin-top: -13px;">Size:</label>
1771 <select id="sizeInput" class="col-md-12 col-sm-12 col-xs-12 selectbox-size" name="size" >
1772 @{
1773 if(!string.IsNullOrWhiteSpace(skuCode))
1774 {
1775 if(sizeList.Count != 0)
1776 {
1777 foreach(var item in sizeList)
1778 {
1779 if(productSize == item)
1780 {
1781 <option selected value="@item"> @item</option>
1782 }
1783 else
1784 {
1785 <option value="@item"> @item</option>
1786 }
1787 }
1788 }
1789 }
1790 else
1791 {
1792 <option value="@productSize">@productSize</option>
1793 }
1794 }
1795 </select>
1796 </div>
1797 <br><br>
1798 if(!string.IsNullOrWhiteSpace(productFlavour))
1799 {
1800 <div class="col-md-12 col-sm-12 col-xs-12">
1801 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-flavour">Flavour:</label>
1802 <select id="flavourInput" class="col-md-12 col-sm-12 col-xs-12 selectbox-flavour" name="flavour">
1803 @{
1804 if(!string.IsNullOrWhiteSpace(skuCode))
1805 {
1806 if(flavourList.Count != 0)
1807 {
1808 foreach(var item in flavourList)
1809 {
1810 if(productFlavour == item){
1811 <option selected value="@item"><span style="word-wrap: break-word;">@item.Replace(" and "," & ")</span></option>
1812 }
1813 else
1814 {
1815 <option value="@item"><span style="word-wrap: break-word;">@item.Replace(" and "," & ")</span></option>
1816 }
1817 }
1818 }
1819 }
1820 else
1821 {
1822 <option value="@productFlavour">@productFlavour</option>
1823 }
1824 }
1825 </select>
1826 </div>
1827 <br><br>
1828 }
1829 if(!string.IsNullOrWhiteSpace(productColor))
1830 {
1831 <div class="col-md-12 col-sm-12 col-xs-12">
1832 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-color">Color:</label>
1833 <select id="colorInput" class="col-md-12 col-sm-12 col-xs-12 selectbox-color" name="color">
1834 @{
1835 if(!string.IsNullOrWhiteSpace(skuCode))
1836 {
1837 if(colorList.Count !=0)
1838 {
1839 foreach(var item in colorList)
1840 {
1841 if(productColor==item)
1842 {
1843 <option selected value="@item"> @item</option>
1844 }
1845 else
1846 {
1847 <option value="@item"> @item</option>
1848 }
1849 }
1850 }
1851 }
1852 else
1853 {
1854 <option value="@productColor">@productColor</option>
1855 }
1856 }
1857 </select>
1858 </div>
1859 <br><br>
1860 }
1861 }
1862 else if(!string.IsNullOrEmpty(productColor))
1863 {
1864 <div class="col-md-12 col-sm-12 col-xs-12">
1865 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-size">Color:</label>
1866 <select id="onlycolorInput" class="col-md-12 col-sm-12 col-xs-12 selectbox-size" name="color" >
1867 @{
1868 if(!string.IsNullOrWhiteSpace(skuCode))
1869 {
1870 if(colorList.Count !=0)
1871 {
1872 foreach(var item in colorList)
1873 {
1874 if(productColor==item)
1875 {
1876 <option selected value="@item"> @item</option>
1877 }
1878 else
1879 {
1880 <option value="@item"> @item</option>
1881 }
1882 }
1883 }
1884 }
1885 else
1886 {
1887 <option value="@productColor">@productColor</option>
1888 }
1889 }
1890 </select>
1891 </div>
1892 }
1893 else if(!string.IsNullOrEmpty(productFlavour))
1894 {
1895 <div class="col-md-12 col-sm-12 col-xs-12">
1896 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-size">Flavour:</label>
1897 <select id="onlyflavourInput" class="col-md-12 col-sm-12 col-xs-12 selectbox-size" name="flavour" >
1898 @{
1899 if(!string.IsNullOrWhiteSpace(skuCode))
1900 {
1901 if(flavourList.Count !=0)
1902 {
1903 foreach(var item in flavourList)
1904 {
1905 if(productFlavour==item)
1906 {
1907 <option selected value="@item"> @item</option>
1908 }
1909 else
1910 {
1911 <option value="@item"> @item</option>
1912 }
1913 }
1914 }
1915 }
1916 else
1917 {
1918 <option value="@productFlavour">@productFlavour</option>
1919 }
1920 }
1921 </select>
1922 </div>
1923 }
1924
1925 @if(!GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
1926 {
1927 <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top: -10px;">
1928 <label class="col-md-3 col-sm-12 col-xs-12 lbl-pd-qty" style="margin-top: 10px;" >@Translate("Qty"):</label>
1929 <div id="customSelectElement" class="col-md-12 col-sm-12 col-xs-12 qty-div">
1930 <div id="selectBox" style="width: 100% !important;">
1931 <input type="number" class="col-md-12 col-sm-12 col-xs-12 selectbox-qty form-control" onkeydown='QtyKeyControl("quantityInput_@pid", "keydown");' onkeyup='QtyKeyControl("quantityInput_@pid", "keyup");' onfocusout='return QtyKeyControl("quantityInput_@pid", "focusout");' id="quantityInput_@pid" value="1" min="1" max="9999" />
1932 </div>
1933 <div id="navigator">
1934 </div>
1935 </div>
1936 </div>
1937
1938 <br><br><br>
1939 }
1940
1941 <div class="col-md-12 col-sm-12 col-xs-12">
1942 @if(ProdRepackitems)
1943 {
1944 @*<div class="col-md-12 col-sm-12 col-xs-12">
1945 <input id="requireRepack" name="" type="checkbox" value=""> @Translate("Require repacking","Require repacking")
1946 </div>*@
1947
1948 <br><br><hr><br>
1949
1950 @*<div id="repackChoose" style="display:none;margin-top:-15px">
1951 <p>Choose Repack Quantity</p>
1952 <input type="number" id="repackQuantity" value="1" max="1" min="1" style="width:85px" ><span style="padding-left:20px" id="repackProductPrice">@if(repackProductId=="PROD1"){<text>$2.00</text>}else{<text>$4.00</text>}</span>
1953 <input type="number" id="repackQuantity" value="1" max="1" min="1" style="width:85px" ><span style="padding-left:20px" id="repackProductPrice">@if(productWeight<1000){<text>$2.00</text>}else{<text>$4.00</text>}</span>
1954 <br><br>
1955 <p class="hide" id="repackError" style="color:red;"> repack qty cannot exceed product qty</p>
1956 </div>*@
1957
1958 }
1959
1960 @if(!GetBoolean("Ecom:Product:Field.ProductClassic.Value")){
1961 if(productStockStatus!="SPECIAL ORDER"){
1962 if(@userAgent.Contains("android"))
1963 {
1964 <div class="btn-addto-cart fixsize" style="padding: 0; margin: auto;">
1965 @*<a id="addtocartLink" onclick='AjaxAddToCart("?cartcmd=add&productid=@pid&quantity=", "@pid"); showaddedItem(" ", "@pid", $("#quantityInput_" + "@pid").val(), true);' href='javascript:void(0)' ><i class="fa fa-shopping-cart"></i> Add to cart</a>*@
1966 <a id="addtocartLink" onclick='CheckVariantSelected();' href='javascript:void(0)' ><i class="fa fa-shopping-cart"></i> @Translate("Add to cart")</a>
1967 </div>
1968 }else{
1969
1970 <div class="btn-addto-cart fixsize" style="padding: 0; margin: auto;">
1971 @*<a id="addtocartLink" onclick='AjaxAddToCart("?cartcmd=add&productid=@pid&quantity=", "@pid"); showaddedItem(" ", "@pid", $("#quantityInput_" + "@pid").val(), true);' href='javascript:void(0)' ><i class="fa fa-shopping-cart"></i> Add to cart</a>*@
1972 <a id="addtocartLink" class="txtcenter" onclick='CheckVariantSelected();' href='javascript:void(0)' ><i class="fa fa-shopping-cart"></i> @Translate("Add to cart")</a>
1973 </div>
1974 }
1975 }else{
1976 <div class="btn-addto-cart fixsize" style="padding: 0; margin: auto;">
1977
1978 <a id="addtocartLink" class="txtcenter" style="cursor:not-allowed;" href='javascript:void(0)' ><i class="fa fa-shopping-cart"></i> @Translate("Not Available Online")</a>
1979 </div>
1980 }
1981 }
1982 <!---------------------------------------------------------------------------------------Wishlists-------------------------------------------------------------------------------------------->
1983 <div id="wishlistSelect" class="modal fade" role="dialog">
1984 <div class="modal-dialog">
1985
1986 <div class="modal-content">
1987 <div class="modal-body">
1988 <div class="modal-header">
1989
1990 <h2 class="modal-title">Choose wish list</h2>
1991 </div>
1992 <div class="row">
1993 <div class="col-md-6 col-md-offset-3">
1994 <select id="addtolists" style="width: 100%">
1995 <option value='default'>Default Wishlist</option>
1996 @foreach (LoopItem test1 in GetLoop("CustomerCenter.Lists.Type.Wishlist")){
1997 @test1.GetString("Ecom:CustomerCenter.List.Select.ID")
1998
1999 foreach(LoopItem test2 in test1.GetLoop("CustomerCenter.ListTypes.Lists")){
2000 <option value='@test2.GetString("Ecom:CustomerCenter.ListTypes.List.ID")' >@test2.GetString("Ecom:CustomerCenter.ListTypes.List.Name") </option>
2001 }
2002 }
2003 </select>
2004 </div>
2005 </div>
2006
2007 <div class="modal-footer">
2008
2009 <button id="dismissModel" type="button" class="btn btn1 pull-right" data-dismiss="modal" style="width: 100px;">Close</button>
2010 <button id="addToListButton" type="button" class="btn btn1 pull-right" style="width: 100px; margin-right: 10px;">Add to list</button>
2011 </div>
2012 </div>
2013 </div>
2014 </div>
2015 </div>
2016 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) {
2017 if(@userAgent.Contains("android"))
2018 {
2019 // blocked with display:none, because of App 9.3.15 Add to wish list issue
2020 <div class="btn-addto-cart fixsize" style="padding: 0; margin: auto; margin-top: 20px; display:none;">
2021 <a href='#' data-toggle="modal" data-target="#wishlistSelect">
2022 <i class="fa fa-list-ul"></i>Add to wish list
2023 </a>
2024 <a id="wishlistLink" style="display:none" href='/Default.aspx?ID=137&productid=@GetString("Ecom:Product.ID")&CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=@GetString("Ecom:Product.VariantID")&CCAddToListLanguageID=LANG2'>Link</a>
2025 </div>
2026 }else{
2027 // blocked with display:none, because of App 9.3.15 Add to wish list issue
2028 <div class="btn-addto-cart fixsize" style="padding: 0; margin: auto; margin-top: 20px; display:none;">
2029 <a href='#' class="txtcenter" data-toggle="modal" data-target="#wishlistSelect">
2030 <i class="fa fa-list-ul"></i>Add to wish list
2031 </a>
2032 <a id="wishlistLink" style="display:none" href='/Default.aspx?ID=137&productid=@GetString("Ecom:Product.ID")&CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=@GetString("Ecom:Product.VariantID")&CCAddToListLanguageID=LANG2'>Link</a>
2033 </div>
2034 }
2035 }
2036 </div>
2037 <script>
2038 var defaultLink = '/Default.aspx?ID=137&productid=@GetString("Ecom:Product.ID")&CCAddToMyLists=@GetString("Ecom:Product.ID")&CCAddToListVariantID=@GetString("Ecom:Product.VariantID")&CCAddToListLanguageID=LANG2';
2039 var newLink = defaultLink;
2040
2041 $( "#addToListButton" ).click(function() {
2042 var href = document.getElementById("wishlistLink").href;
2043 AddToFavorites(href);
2044 });
2045
2046 $( "#addtolists" ).change(function() {
2047 if(this.value!="default"){
2048 newLink += "&CCAddToListID="+this.value+"&CCListType=Wishlist";
2049 $( "#wishlistLink" ).attr("href", newLink );
2050 }
2051 else{
2052 $( "#wishlistLink" ).attr("href", defaultLink );
2053 }
2054 });
2055
2056 function AddToFavorites(favUrl){
2057 $("#dvLoading").show();
2058 $.ajax(
2059 {
2060 url: favUrl,
2061 type: 'POST',
2062 success: function (data)
2063 {
2064 document.getElementById("dismissModel").click();
2065 $("#dvLoading").hide();
2066 },
2067 error: function (jqXHR, textStatus, errorThrown)
2068 {
2069 $("#dvLoading").hide();
2070 }
2071 });
2072 }
2073 </script>
2074 <!------------------------------------------------------------------------------------End Wishlists---------------------------------------------------------------------------------------------->
2075
2076
2077
2078 </div>
2079
2080 </div>
2081
2082
2083 <div class="col-1-1">
2084 <div>
2085 <ul id="tabDivMain" class="nav nav-tabs">
2086 <li><a data-toggle='tab' class="details-tab" href="#details" style="width:160px;">@Translate("Details")</a></li>
2087 <li style="display:none;"><a data-toggle='tab' class="details-tab" id="reviewButton" href="#review">@Translate("Reviews")</a></li>
2088 <!-- <li><a data-toggle='tab' class="details-tab" href="#about" style="width: 157px;">About The Brand</a></li>-->
2089 @if(ProductVideoUrl != "")
2090 {
2091 <li><a data-toggle='tab' class="details-tab" href="#videoUrl" style="width: 157px;">@Translate("Watch Video")</a></li>
2092 }
2093 </ul>
2094
2095 <div id="tabContainer" class="resp-tabs-container">
2096 <div id="details" class="tab-pane fade active in" id="details">
2097 <p style="margin-top:25px;">@productDetails</p>
2098 </div>
2099 <div id="about" class="tab-pane fade" id="aboutBrand">
2100 <p>@ProdPubBrand</p>
2101 </div>
2102 @if(ProductVideoUrl != "")
2103 {
2104 <div id="videoUrl" class="tab-pane fade" style="text-align: center; padding: 20px;">
2105 @ProductVideoUrl
2106 </div>
2107 }
2108 </div>
2109 <div id="cmtContainer" class="resp-tabs-container">
2110 <div id="review" class="tab-pane fade" id="reviews">
2111 <a name="Comments"></a>
2112 @if(Dynamicweb.Core.Converter.ToBoolean(GetValue("Ecom:Product.Rating"))){<text>
2113 <h3>Reviews</h3>
2114 @foreach (LoopItem i in GetLoop("Comments")){
2115
2116 if(Dynamicweb.Core.Converter.ToBoolean(i.GetValue("Website"))){<text>
2117 <a href="@i.GetValue("Website")">@i.GetValue("Name")</a>
2118 </text>}
2119 if(!Dynamicweb.Core.Converter.ToBoolean(i.GetValue("Website"))){<text>
2120 @i.GetValue("Name")
2121 </text>}
2122
2123 <span style="color:#c5c5c5;">@i.GetValue("CreatedDate.LongDate") @i.GetValue("EditedDate.ShortTime")</span><br />
2124 var rating = i.GetInteger("Rating");
2125 for(var j=0;j<rating;j++){
2126 <label class="starSelected"></label>
2127 }
2128 if(rating < 5){
2129 for(var k = 0;k<5-rating;k++){
2130 <label class="starUnselected"></label>
2131 }
2132 }
2133 <br />
2134 @i.GetValue("Text")
2135 <hr />
2136 }
2137 </text>}
2138
2139 <script type="text/javascript">
2140
2141 function validateEmail(email) {
2142 var re = (/^[^-\0-9][+a-zA-Z0-9._-]+@@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i);
2143 return re.test(email);
2144 }
2145
2146 function comment_validate() {
2147 var radioChecked = false;
2148 var radioRatings = document.getElementsByName("Comment.Rating");
2149 var validated = false;
2150
2151
2152 var loopCounter = 1;
2153 for(var i = 0; i < radioRatings.length;i++){
2154 if(radioRatings[i].checked==true){
2155 radioChecked = true;
2156
2157 }
2158 }
2159
2160 if (radioChecked == false) {
2161 console.log('please rate');
2162 alert("Please rate the product.");
2163 return false;
2164
2165 }
2166
2167 if (document.getElementById("Comment.Name").value.length < 1) {
2168 alert("Specify your name.");
2169 document.getElementById("Comment.Name").focus();
2170 return false;
2171 }
2172
2173 if (document.getElementById("Comment.Text").value.length < 1) {
2174 alert("Specify your comment");
2175 document.getElementById("Comment.Text").focus();
2176 return false;
2177 }
2178 if (document.getElementById("Comment.Email").value.length < 1) {
2179 alert("Please Enter Email");
2180 document.getElementById("Comment.Text").focus();
2181 return false;
2182 }
2183
2184 if(!validateEmail(document.getElementById('Comment.Email').value))
2185 {
2186 alert("Email is invalid");
2187 return false;
2188 }
2189
2190
2191 //document.getElementById("commentform").action = '/Default.aspx?ID=7';
2192 document.getElementById("commentform").action = '@System.Web.HttpContext.Current.Request.Url.PathAndQuery';
2193
2194 document.getElementById("Comment.Command").value = "create";
2195 return true;
2196
2197 }
2198
2199 </script>
2200 <style type="text/css">
2201
2202 @@media only screen and (max-width: 600px){
2203 #commentform .labelComment{
2204 width: 100% !important;
2205 }
2206 #commentform input[type=text], #commentform select, #commentform option{
2207 width: 100% !important;
2208 }
2209 #commentform textarea{
2210 width: 100% !important;
2211 }
2212 }
2213
2214 #commentform { margin: 15px 0 0 0; }
2215 #commentform .labelComment { position:relative; vertical-align: top; display:inline; width: 23%; padding: 11px 10px 8px; display:inline-block; margin:0 30px 0 0; font-size: 18px; font-weight: bold; color: #000; }
2216 #commentform .labelComment .bg { position: absolute; top: 0; right: -15px; height: 38px; width: 15px; display: block; }
2217 #commentform input[type=text], #commentform textarea { font:14px/14px Arial, Helvetica, sans-serif; background: #fff; border: none; border: 1px solid #d8d8d8;}
2218 #commentform input[type=text], #commentform select, #commentform option { color:#666; width: 300px; margin: 0 5px 20px 0px; padding: 10px 7px; }
2219 #commentform textarea { color:#666; width: 300px; margin: 0 5px 20px 0px; padding: 5px 7px; }
2220 #commentform input[type=submit] { margin: 15px 0 0 180px; cursor: pointer; }
2221
2222 </style>
2223 <p> </p>
2224 <div class="dottedBoxGrey form">
2225 <form method="post" action="/Default.aspx?ID=7" id="commentform" onsubmit="return comment_validate()">
2226 <div class="formContact">
2227 <input type="hidden" name="Comment.Command" id="Comment.Command" value="" />
2228
2229 <input type="hidden" name="Comment.ItemType" value="ecomProduct" />
2230
2231 <input type="hidden" name="Comment.ItemID" value="@GetValue("Ecom:Product.ID")" />
2232 <input type="hidden" name="Comment.LangID" value="@GetValue("Ecom:Product.LanguageID")" />
2233 <div class="product-detailComment">
2234
2235 </div>
2236 <label class="labelComment pull-left" for="Comment.Rating">Your rating</label>
2237 <div class="prod-star pull-left">
2238 <p style="" class="ratingSubmit">
2239 <input type="radio" id="star5a" name="Comment.Rating" value="5" /><label class = "full" for="star5a" title="Awesome - 5 stars"></label>
2240
2241 <input type="radio" id="star4a" name="Comment.Rating" value="4" /><label class = "full" for="star4a" title="Pretty good - 4 stars"></label>
2242
2243 <input type="radio" id="star3a" name="Comment.Rating" value="3" /><label class = "full" for="star3a" title="Meh - 3 stars"></label>
2244
2245 <input type="radio" id="star2a" name="Comment.Rating" value="2" /><label class = "full" for="star2a" title="Kinda bad - 2 stars"></label>
2246
2247 <input type="radio" id="star1a" name="Comment.Rating" value="1" /><label class = "full" for="star1a" title="Sucks big time - 1 star"></label>
2248 </p>
2249 </div>
2250 <div class="clearfix"></div>
2251 <label class="labelComment" for="Comment.Name">Name</label>
2252 <input type="text" name="Comment.Name" id="Comment.Name" value="" /><br />
2253 <label class="labelComment" for="Comment.Email">E-mail</label>
2254 <input type="text" name="Comment.Email" id="Comment.Email" value="" /><br />
2255 <label class="labelComment" for="Comment.Text">Comment</label>
2256 <textarea name="Comment.Text" id="Comment.Text" rows="10" cols="50"></textarea><br />
2257
2258 <input type="submit" value="Send" />
2259 </div>
2260 </form>
2261 </div>
2262 <p> </p>
2263 </div>
2264 </div>
2265 <ul id="ImmediateAvailabilityAtMobile" class="sidenavi">
2266 @if(storeNameList.Count != 0)
2267 {
2268 <li class="current curSub"><a style="background: #e6e6e6;">@Translate("Immediate Availability At","Immediate Availability At")</a>
2269 <ul id="leftnavigation" class="sidenavi shoplist" style="padding-bottom: 30px;">
2270 @foreach(var string1 in storeNameList)
2271 {
2272 <li class="text-left">
2273 <a href="#@string1.Replace(" ","_").Replace(".","")" data-toggle="collapse" data-value="#@string1.Replace(" ","_").Replace(".","")" onclick="collapseMobile('@string1.Replace(" ","_").Replace(".","")')">@string1</a>
2274 <div id="mb_@string1.Replace(" ","_").Replace(".","")" class="collapse" style="padding-left: 35px;">
2275 <p><i class="fa fa-map-marker"></i> @storeAddress1List[string1] @Translate(",",",") @storeAddress2List[string1] </p>
2276 <p><i class="fa fa-phone"></i> @storePhoneNumberList[string1]</p>
2277 </div>
2278 </li>
2279 }
2280 </ul>
2281 </li>
2282 }
2283 else
2284 {
2285 <ul id="ImmediateAvailabilityAtMobile_Onlinebtn" class="sidenavi">
2286 <li class="current curSub"><a style="background: #e6e6e6; width: 100% !important;">@Translate("Currently Unavailable in Stores","Currently Unavailable in Stores")</a></li>
2287 </ul>
2288 }
2289 </ul>
2290 </div>
2291 </div>
2292 </div>
2293 </div>
2294 <div>
2295 </div>
2296
2297 <hr style="width:100%">
2298
2299 <div align="center" class="grid">
2300 @if (GetString("Ecom:Product.RelatedCount") != "0")
2301 {
2302
2303 foreach(LoopItem related in GetLoop("ProductRelatedGroups"))
2304 {
2305 if(related.GetString("Ecom:Product:RelatedGroup.Name")=="Similar Products")
2306 {
2307 if(related.GetLoop("RelatedProducts").Count != 0)
2308 {
2309 <div class="row-bestseller">
2310 <div class="row-bestseller" style="margin:30px 0 70px 0;">
2311 <h1>@Translate("Similar Products", "Similar Products")</h1>
2312
2313 <ul class="bxslider-bestseller">
2314 @foreach(LoopItem products in related.GetLoop("RelatedProducts"))
2315 {
2316
2317 var relatedRating = products.GetDouble("Ecom:Product.Rating");
2318 var sellingPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSPrice");
2319 var internetPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSInternetPrice");
2320 Boolean inventoryDiscountRelated = products.GetBoolean("Ecom:Product:Field.ProductInventoryDiscountFlag");
2321 var discountPercentageRelated = products.GetDouble("Ecom:Product:Field.ProductInventoryDiscount");
2322 var birthdayPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSBirthdayPrice");
2323 var memberPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSMemberPrice");
2324 var disableRelated=products.GetBoolean("Ecom:Product:Field.Disable");
2325 // var promotionRelated=products.GetDouble("Ecom:Product.Discount.TotalPercentWithoutVATFormatted");
2326 var pidrelated = products.GetString("Ecom:Product.ID");
2327 string GroupLinkRelated = products.GetString("Ecom:Product.LinkGroup.Clean");
2328 var promotionRelated=0.00;
2329 var discountTypeRelated="";
2330 foreach (LoopItem item1 in products.GetLoop("ProductDiscounts")) {
2331
2332 if(item1.GetString("Ecom:Product.Discount.Type")=="PERCENT")
2333 {
2334 discountTypeRelated="PERCENT";
2335 promotionRelated=item1.GetDouble("Ecom:Product.Discount.PercentWithoutVATFormatted");
2336 }
2337 else{
2338 discountTypeRelated="AMOUNT";
2339 promotionRelated=item1.GetDouble("Ecom:Product.Discount.AmountWithoutVATFormatted");
2340 }
2341 }
2342 <li id="get_@pidrelated">
2343 @* @if(promotionRelated != 0){ <div class="ribbon-P"><span>Pro @promotionRelated% Off</span></div>}
2344 else
2345 {
2346 //add ERP discount ribbon
2347 if(inventoryDiscountRelated){
2348 if(discountPercentageRelated != 0){
2349 <div class="ribbon-D"><span>Dis @discountPercentageRelated% Off</span></div>}
2350 }
2351 }
2352 *@
2353 @if(promotionRelated != 0){
2354 if(discountTypeRelated=="PERCENT")
2355 {
2356 <div class="ribbon-P"><span>Pro @promotionRelated% Off</span></div>
2357 }
2358 else{
2359 <div class="ribbon-P"><span>Pro $@promotionRelated Off</span></div>
2360 }
2361
2362 }
2363 else
2364 {
2365 //add ERP discount ribbon
2366 if(inventoryDiscount){
2367 if(discountPercentage != 0)
2368 {
2369 <div class="ribbon-D"><span>Dis @discountPercentage% Off</span></div>}
2370 }
2371 }
2372 <a href="@GroupLinkRelated"><img src="@path@Image" alt="@Image"/></a>
2373 @if(inventoryDiscountRelated){
2374 if(sellingPriceRelated != internetPriceRelated){
2375 <text><p class="prod-promo2">Save @string.Format("{0:0.00}", sellingPriceRelated-internetPriceRelated)</p></text>
2376 }
2377 }
2378 else{
2379 <text><p class="prod-promo"> </p></text>
2380 }
2381
2382 <p class="prod-name">@products.GetString("Ecom:Product:Field.PublicBrand")</p>
2383 <p class="prod-name">@products.GetString("Ecom:Product.Name")</p>
2384 <div class="prod-star">
2385 @if(@relatedRating == 0){
2386 <label class = "starUnselected"></label>
2387 <label class = "starUnselected"></label>
2388 <label class = "starUnselected"></label>
2389 <label class = "starUnselected"></label>
2390 <label class = "starUnselected"></label>
2391 }
2392 @for(var i =1;i<@relatedRating;i++){
2393 <label class = "starSelected"></label>
2394 }
2395 @if(relatedRating % 1 != 0){
2396 <label class = "starSelected half"></label>
2397 }
2398 </div>
2399 <div class="prod-priceBox">
2400 @if(inventoryDiscountRelated){
2401 if(sellingPriceRelated != internetPriceRelated){
2402 <div class="prod-price">
2403 <p class="op">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2404 <p class="np">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2405
2406 </div>
2407 <div class="member-price"></div>
2408 }
2409 else if(sellingPriceRelated == internetPriceRelated){
2410 <div class="prod-price">
2411 <p class="np">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2412 </div>
2413
2414 }
2415 }
2416 @*inventoryDiscount false*@
2417 else{
2418 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
2419 <div class="prod-price">
2420 <p class="np">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2421 </div>
2422 <div class="member-price">
2423 <div class="title">Member
2424 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop"></span>
2425 <p class="price">$@string.Format("{0:0.00}", memberPriceRelated)</p>
2426 </div>
2427
2428 <div class="title">Birthday
2429 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop"></span>
2430 <p class="price">$@string.Format("{0:0.00}", birthdayPriceRelated)</p>
2431 </div>
2432 </div>
2433 }
2434 else if(Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
2435 <div class="prod-price">
2436 <p class="np">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2437 </div>
2438 if(!birthday){
2439 <div class="member-price">
2440 <div class="title">Member
2441 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop"></span>
2442 <p class="price">$@string.Format("{0:0.00}", memberPriceRelated)</p>
2443 </div>
2444 </div>
2445 }
2446 else{
2447 <div class="member-price">
2448 <div class="title">Birthday
2449 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop"></span>
2450 <p class="price">$@string.Format("{0:0.00}", birthdayPriceRelated)</p>
2451 </div>
2452 </div>
2453 }
2454 @*<div class="prod-price">
2455 <p class="op">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2456 </div>
2457 *@
2458
2459
2460 }
2461 }
2462 </div>
2463 <!--<div class="btn-addto-cart">
2464 <a href="Default.aspx?ID=7&productid=@pidrelated&cartcmd=add&quantity=1"><i class="fa fa-shopping-cart"></i> Add to cart</a>
2465 </div>-->
2466
2467
2468 @if(products.GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
2469 {
2470 <ul class="info">
2471 <li>*In Store Only</li>
2472 </ul>
2473 }
2474
2475 @if(!products.GetBoolean("Ecom:Product:Field.ProductClassic.Value")){
2476 <div class="btn-addto-cart" style="margin-bottom:5px;">
2477 <a class="fancybox" href="javascript:showaddedItem('?productid=@pidrelated&cartcmd=add&quantity=1',@pidrelated,true)"><i class="fa fa-shopping-cart"></i> @Translate("Add to cart")</a>
2478 </div>
2479 }
2480 <!--<div class="btn-addto-cart">
2481 <a href="@GroupLinkRelated"><i class="fa fa-search-plus"></i> View products details </a>
2482 </div>-->
2483 </li>
2484 }
2485
2486 </ul>
2487
2488 </div>
2489 </div>
2490 }
2491
2492 }
2493 }
2494
2495 }
2496 @if (GetString("Ecom:Product.RelatedCount") != "0")
2497 {
2498
2499
2500 foreach(LoopItem related in GetLoop("ProductRelatedGroups")){
2501
2502 if(related.GetString("Ecom:Product:RelatedGroup.Name")=="Similar Brand"){
2503
2504 if(related.GetLoop("RelatedProducts").Count != 0)
2505 {
2506 <div class="row-bestseller">
2507 <div class="row-bestseller" style="margin:30px 0 70px 0;">
2508 <h2>@Translate("Similar Brands", "Similar Brands")</h2>
2509
2510 <ul class="bxslider-bestseller">
2511 @foreach(LoopItem products in related.GetLoop("RelatedProducts")) {
2512
2513 var relatedRating = products.GetDouble("Ecom:Product.Rating");
2514 var sellingPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSPrice");
2515 var internetPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSInternetPrice");
2516 Boolean inventoryDiscountRelated = products.GetBoolean("Ecom:Product:Field.ProductInventoryDiscountFlag");
2517 var discountPercentageRelated = products.GetDouble("Ecom:Product:Field.ProductInventoryDiscount");
2518 var birthdayPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSBirthdayPrice");
2519 var memberPriceRelated = products.GetDouble("Ecom:Product:Field.ProductSMemberPrice");
2520 var disableRelated=products.GetBoolean("Ecom:Product:Field.Disable");
2521 // var promotionRelated=products.GetDouble("Ecom:Product.Discount.TotalPercentWithoutVATFormatted");
2522 var pidrelated = products.GetString("Ecom:Product.ID");
2523 string GroupLinkRelated = products.GetString("Ecom:Product.LinkGroup.Clean");
2524 var promotionRelated=0.00;
2525 var discountTypeRelated="";
2526 foreach (LoopItem item1 in products.GetLoop("ProductDiscounts")) {
2527
2528 if(item1.GetString("Ecom:Product.Discount.Type")=="PERCENT")
2529 {
2530 discountTypeRelated="PERCENT";
2531 promotionRelated=item1.GetDouble("Ecom:Product.Discount.PercentWithoutVATFormatted");
2532 }
2533 else{
2534 discountTypeRelated="AMOUNT";
2535 promotionRelated=item1.GetDouble("Ecom:Product.Discount.AmountWithoutVATFormatted");
2536 }
2537 }
2538 <li id="get_@pidrelated">
2539 @* @if(promotionRelated != 0){ <div class="ribbon-P"><span>Pro @promotionRelated% Off</span></div>}
2540 else
2541 {
2542 //add ERP discount ribbon
2543 if(inventoryDiscountRelated){
2544 if(discountPercentageRelated != 0){
2545 <div class="ribbon-D"><span>Dis @discountPercentageRelated% Off</span></div>}
2546 }
2547 }
2548 *@
2549 @if(promotionRelated != 0){
2550 if(discountTypeRelated=="PERCENT")
2551 {
2552 <div class="ribbon-P"><span>Pro @promotionRelated% Off</span></div>
2553 }
2554 else{
2555 <div class="ribbon-P"><span>Pro $@promotionRelated Off</span></div>
2556 }
2557
2558 }
2559 else
2560 {
2561 //add ERP discount ribbon
2562 if(inventoryDiscount){
2563 if(discountPercentage != 0)
2564 {
2565 <div class="ribbon-D"><span>Dis @discountPercentage% Off</span></div>}
2566 }
2567 }
2568 <a href="@GroupLinkRelated"><img src="@path@Image" alt="@Image"/></a>
2569 @if(inventoryDiscountRelated){
2570 if(sellingPriceRelated != internetPriceRelated){
2571 <text><p class="prod-promo2">Save @string.Format("{0:0.00}", sellingPriceRelated-internetPriceRelated)</p></text>
2572 }
2573 }
2574 else{
2575 <text><p class="prod-promo"> </p></text>
2576 }
2577 <p class="prod-name">@products.GetString("Ecom:Product:Field.PublicBrand")</p>
2578 <p class="prod-name">@products.GetString("Ecom:Product.Name")</p>
2579 <div class="prod-star">
2580 @if(@relatedRating == 0){
2581 <label class = "starUnselected"></label>
2582 <label class = "starUnselected"></label>
2583 <label class = "starUnselected"></label>
2584 <label class = "starUnselected"></label>
2585 <label class = "starUnselected"></label>
2586 }
2587 @for(var i =1;i<@relatedRating;i++){
2588 <label class = "starSelected"></label>
2589 }
2590 @if(relatedRating % 1 != 0){
2591 <label class = "starSelected half"></label>
2592 }
2593 </div>
2594 <div class="prod-priceBox">
2595 @if(inventoryDiscountRelated){
2596 if(sellingPriceRelated != internetPriceRelated){
2597 <div class="prod-price">
2598 <p class="op">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2599 <p class="np">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2600
2601 </div>
2602 <div class="member-price"></div>
2603 }
2604 else if(sellingPriceRelated == internetPriceRelated){
2605 <div class="prod-price">
2606 <p class="np">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2607 </div>
2608
2609 }
2610 }
2611 @*inventoryDiscount false*@
2612 else{
2613 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
2614 <div class="prod-price">
2615 <p class="np">$@string.Format("{0:0.00}", sellingPriceRelated)</p>
2616 </div>
2617 <div class="member-price">
2618 <div class="title">Member
2619 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon"></span>
2620 <p class="price">$@string.Format("{0:0.00}", memberPriceRelated)</p>
2621 </div>
2622
2623 <div class="title">Birthday
2624 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon"></span>
2625 <p class="price">$@string.Format("{0:0.00}", birthdayPriceRelated)</p>
2626 </div>
2627 </div>
2628 }
2629 else if(Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))){
2630 <div class="prod-price">
2631 <p class="np">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2632 </div>
2633 if(!birthday){
2634 <div class="member-price">
2635 <div class="title">Member
2636 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon"></span>
2637 <p class="price">$@string.Format("{0:0.00}", memberPriceRelated)</p>
2638 </div>
2639 </div>
2640 }
2641 else{
2642 <div class="member-price">
2643 <div class="title">Birthday
2644 <span class="top tipso_style" data-tipso="Become a member for only $6 and get it for $@string.Format("{0:0.00}", memberPrice). Get it for $@string.Format("{0:0.00}", birthdayPrice) on your birthday month."><img src="@pathproduct/images/icon_info.png" width="20" align="texttop" alt="icon"></span>
2645 <p class="price">$@string.Format("{0:0.00}", birthdayPriceRelated)</p>
2646 </div>
2647 </div>
2648 }
2649 @*<div class="prod-price">
2650 <p class="op">$@string.Format("{0:0.00}", internetPriceRelated)</p>
2651 </div>
2652 *@
2653
2654
2655 }
2656 }
2657 </div>
2658 <!--<div class="btn-addto-cart">
2659 <a href="Default.aspx?ID=7&productid=@pidrelated&cartcmd=add&quantity=1"><i class="fa fa-shopping-cart"></i> Add to cart</a>
2660 </div>-->
2661
2662
2663 @if(products.GetBoolean("Ecom:Product:Field.ProductClassic.Value"))
2664 {
2665 <ul class="info">
2666 <li>*In Store Only</li>
2667 </ul>
2668 }
2669
2670 @if(!products.GetBoolean("Ecom:Product:Field.ProductClassic.Value")){
2671 <div class="btn-addto-cart" style="margin-bottom:5px;">
2672 <a class="fancybox" href="javascript:showaddedItem('?productid=@pidrelated&cartcmd=add&quantity=1',@pidrelated,true)"><i class="fa fa-shopping-cart"></i> @Translate("Add to cart")</a>
2673 </div>
2674 }
2675 <!--<div class="btn-addto-cart">
2676 <a href="@GroupLinkRelated"><i class="fa fa-search-plus"></i> View products details </a>
2677 </div>-->
2678 </li>
2679
2680 }
2681
2682 </ul>
2683
2684 </div>
2685 </div>
2686 }
2687
2688 }
2689 }
2690
2691
2692 }
2693 </div>
2694 @using DWAPAC.PLC.Services.PLCPSWS;
2695 @using DWAPAC.PLC.Services;
2696 @using DWAPAC.PLC;
2697 @{
2698 DWAPAC.PLC.Services.PLCPSWS.PS_Service service_1 = new DWAPAC.PLC.Services.PLCPSWS.PS_Service();
2699 var productLocation_1 = service_1.GetProductLocation("dynamicweb", "{_0rfJ39sw", pid);
2700 }
2701 <script>
2702 //Start of variant selection
2703 var firstChange = "";
2704 var secondVariant = "@variantSelector";
2705
2706 $( "#flavourInput" ).change(function() {
2707 if(firstChange ==""){
2708 firstChange="FLAVOUR";
2709 }
2710
2711 if(firstChange == "SIZE") {
2712 var size = $( "#sizeInput" ).val();
2713 var data = $(this).serialize();
2714
2715 data+="&skuCode=@(skuCode)";
2716 data+="&size=" + size + "&firstSelect=" + firstChange + "&secondVariant=" + secondVariant;
2717 //alert(data);
2718 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2719 $.ajax({
2720 type : 'POST',
2721 url : '@plcUrl' + '/Default.aspx?ID=191',
2722 data : data,
2723 success : function(data)
2724 {
2725 var firstSplit = data.split('<script type="text/javascript">');
2726 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2727 }
2728 });
2729 return false;
2730 }
2731 else
2732 {
2733 var data = $(this).serialize();
2734 data+="&pid=@(pid)&firstSelect="+firstChange;
2735 var options = document.getElementById('sizeInput');
2736 while (options.hasChildNodes()) {
2737 options.removeChild(options.lastChild);
2738 }
2739 $("#sizeInput").append("<option>Please select size</option>");
2740 $.ajax({
2741 type : 'POST',
2742 url : '@plcUrl' + '/Default.aspx?ID=191',
2743 data : data,
2744 success : function(data)
2745 {
2746 var firstSplit = data.split('<script type="text/javascript">');
2747 $("#sizeInput").append(firstSplit[0]);
2748 }
2749 });
2750 return false;
2751 }
2752 });
2753
2754 $( "#sizeInput" ).change(function() {
2755 if(firstChange ==""){
2756 firstChange="SIZE";
2757 }
2758 if(firstChange=="SIZE" && secondVariant != "size") {
2759 var data = $(this).serialize();
2760 data+="&pid=@(pid)&firstSelect="+firstChange+"&secondVariant="+secondVariant;
2761 var options = document.getElementById(secondVariant+'Input');
2762 while (options.hasChildNodes()) {
2763 options.removeChild(options.lastChild);
2764 }
2765 $("#"+secondVariant+"Input").append("<option>Please select "+secondVariant+"</option>");
2766 $.ajax({
2767 type : 'POST',
2768 url : '@plcUrl' + '/Default.aspx?ID=191',
2769 data : data,
2770 success : function(data)
2771 {
2772 var firstSplit = data.split('<script type="text/javascript">');
2773 $("#"+secondVariant+"Input").append(firstSplit[0]);
2774 }
2775 });
2776 return false;
2777 }
2778 else if(firstChange == "SIZE" && secondVariant == "size"){
2779 var variant2 = $( "#"+secondVariant+"Input" ).val();
2780 var data = $(this).serialize();
2781 data += "&skuCode=@(skuCode)";
2782 data += "&secondVariant=" + secondVariant + "&firstSelect=" + firstChange;
2783 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2784 $.ajax({
2785 type : 'POST',
2786 url : '@plcUrl' + '/Default.aspx?ID=191',
2787 data : data,
2788 success : function(data)
2789 {
2790 var firstSplit = data.split('<script type="text/javascript">');
2791 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2792 }
2793 });
2794 return false;
2795 }
2796 else if(firstChange!="SIZE") {
2797 var variant2 = $( "#"+secondVariant+"Input" ).val();
2798 var data = $(this).serialize();
2799 data+="&skuCode=@(skuCode)";
2800 data+="&"+secondVariant+"="+variant2+"&firstSelect="+firstChange;
2801 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2802 $.ajax({
2803 type : 'POST',
2804 url : '@plcUrl' + '/Default.aspx?ID=191',
2805 data : data,
2806 success : function(data)
2807 {
2808 var firstSplit = data.split('<script type="text/javascript">');
2809 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2810 }
2811 });
2812 return false;
2813 }
2814 });
2815
2816 $( "#onlyflavourInput" ).change(function() {
2817 if(firstChange ==""){
2818 firstChange="FLAVOUR";
2819 }
2820
2821 if(firstChange=="FLAVOUR" && secondVariant != "flavour"){
2822 var data = $(this).serialize();
2823 data+="&pid=@(pid)&firstSelect=" + firstChange + "&secondVariant=" + secondVariant;
2824
2825 var options = document.getElementById(secondVariant+'Input');
2826 while (options.hasChildNodes()) {
2827 options.removeChild(options.lastChild);
2828 }
2829 $("#"+secondVariant+"Input").append("<option>Please select "+secondVariant+"</option>");
2830 $.ajax({
2831 type : 'POST',
2832 url : '@plcUrl' + '/Default.aspx?ID=191',
2833 data : data,
2834 success : function(data)
2835 {
2836 var firstSplit = data.split('<script type="text/javascript">');
2837 $("#"+secondVariant+"Input").append(firstSplit[0]);
2838 }
2839 });
2840 return false;
2841 }
2842 else if(firstChange=="FLAVOUR" && secondVariant == "flavour"){
2843 var variant2 = $( "#"+secondVariant+"Input" ).val();
2844 var data = $(this).serialize();
2845 data += "&skuCode=@(skuCode)";
2846 data += "&secondVariant=" + secondVariant + "&firstSelect=" + firstChange;
2847 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2848 $.ajax({
2849 type : 'POST',
2850 url : '@plcUrl' + '/Default.aspx?ID=191',
2851 data : data,
2852 success : function(data)
2853 {
2854 var firstSplit = data.split('<script type="text/javascript">');
2855 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2856 }
2857 });
2858 return false;
2859 }
2860 else if(firstChange!="FLAVOUR"){
2861 var variant2 = $( "#"+secondVariant+"Input" ).val();
2862 var data = $(this).serialize();
2863 data += "&skuCode=@(skuCode)";
2864 data += "&" + secondVariant + "=" + variant2 + "&firstSelect=" + firstChange;
2865 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2866 $.ajax({
2867 type : 'POST',
2868 url : '@plcUrl' + '/Default.aspx?ID=191',
2869 data : data,
2870 success : function(data)
2871 {
2872 var firstSplit = data.split('<script type="text/javascript">');
2873 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2874 }
2875 });
2876 return false;
2877 }
2878 else
2879 {
2880 var data = $(this).serialize();
2881 data += "&pid=@(pid)&firstSelect=" + firstChange + "&secondVariant=" + secondVariant;
2882 var options = document.getElementById('sizeInput');
2883 while (options.hasChildNodes()) {
2884 options.removeChild(options.lastChild);
2885 }
2886 $("#onlyflavourInput").append("<option>Please select flavour</option>");
2887 $.ajax({
2888 type : 'POST',
2889 url : '@plcUrl' + '/Default.aspx?ID=191',
2890 data : data,
2891 success : function(data)
2892 {
2893 var firstSplit = data.split('<script type="text/javascript">');
2894 $("#onlyflavourInput").append(firstSplit[0]);
2895 }
2896 });
2897 return false;
2898 }
2899 });
2900
2901 $( "#onlycolorInput" ).change(function() {
2902 if(firstChange ==""){
2903 firstChange="COLOR";
2904 }
2905 if(firstChange=="COLOR" && secondVariant != "color"){
2906
2907 var data = $(this).serialize();
2908 data+="&pid=@(pid)&firstSelect="+firstChange+"&secondVariant="+secondVariant;
2909
2910 var options = document.getElementById(secondVariant+'Input');
2911 while (options.hasChildNodes()) {
2912 options.removeChild(options.lastChild);
2913 }
2914 $("#"+secondVariant+"Input").append("<option>Please select "+secondVariant+"</option>");
2915 $.ajax({
2916
2917 type : 'POST',
2918 url : '@plcUrl' + '/Default.aspx?ID=191',
2919 data : data,
2920 success : function(data)
2921 {
2922
2923 var firstSplit = data.split('<script type="text/javascript">');
2924 $("#"+secondVariant+"Input").append(firstSplit[0]);
2925
2926 }
2927 });
2928
2929 return false;
2930 }
2931 else if(firstChange=="COLOR" && secondVariant == "color"){
2932 var variant2 = $( "#"+secondVariant+"Input" ).val();
2933 var data = $(this).serialize();
2934 data+="&skuCode=@(skuCode)";
2935 data+="&secondVariant="+secondVariant+"&firstSelect="+firstChange;
2936 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2937 $.ajax({
2938
2939 type : 'POST',
2940 url : '@plcUrl' + '/Default.aspx?ID=191',
2941 data : data,
2942 success : function(data)
2943 {
2944
2945 var firstSplit = data.split('<script type="text/javascript">');
2946 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2947 }
2948 });
2949
2950 return false;
2951 }
2952 else if(firstChange!="COLOR"){
2953 var variant2 = $( "#"+secondVariant+"Input" ).val();
2954 var data = $(this).serialize();
2955 data+="&skuCode=@(skuCode)";
2956 data+="&"+secondVariant+"="+variant2+"&firstSelect="+firstChange;
2957 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
2958 $.ajax({
2959
2960 type : 'POST',
2961 url : '@plcUrl' + '/Default.aspx?ID=191',
2962 data : data,
2963 success : function(data)
2964 {
2965 var firstSplit = data.split('<script type="text/javascript">');
2966 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
2967 }
2968 });
2969
2970 return false;
2971 }
2972
2973 else
2974 {
2975 var data = $(this).serialize();
2976 data+="&pid=@(pid)&firstSelect="+firstChange+"&secondVariant="+secondVariant;
2977 var options = document.getElementById('sizeInput');
2978 while (options.hasChildNodes()) {
2979 options.removeChild(options.lastChild);
2980 }
2981 $("#onlycolorInput").append("<option>Please select color</option>");
2982 $.ajax({
2983
2984 type : 'POST',
2985 url : '@plcUrl' + '/Default.aspx?ID=191',
2986 data : data,
2987 success : function(data)
2988 {
2989 var firstSplit = data.split('<script type="text/javascript">');
2990 $("#onlycolorInput").append(firstSplit[0]);
2991 }
2992 });
2993
2994 return false;
2995 }
2996 });
2997 $( "#colorInput" ).change(function() {
2998 if(firstChange ==""){
2999 firstChange="COLOR";
3000 }
3001 if(firstChange=="SIZE"){
3002 var size = $( "#sizeInput" ).val();
3003 var data = $(this).serialize();
3004 data+="&skuCode=@(skuCode)";
3005 data+="&size="+size+"&firstSelect="+firstChange+"&secondVariant="+secondVariant;
3006 $.blockUI({message : $('#addingToCart'), css: { border: 'none', background: 'none'}});
3007 $.ajax({
3008
3009 type : 'POST',
3010 url : '@plcUrl' + '/Default.aspx?ID=191',
3011 data : data,
3012 success : function(data)
3013 {
3014
3015 var firstSplit = data.split('<script type="text/javascript">');
3016 window.location = '@plcUrl' + '/default.aspx?id=@(pageID)&productid='+firstSplit[0];
3017 }
3018 });
3019
3020 return false;
3021 }
3022 else
3023 {
3024 var data = $(this).serialize();
3025 data+="&pid=@(pid)&firstSelect="+firstChange+"&secondVariant="+secondVariant;
3026 var options = document.getElementById('sizeInput');
3027 while (options.hasChildNodes()) {
3028 options.removeChild(options.lastChild);
3029 }
3030 $("#sizeInput").append("<option>Please select size</option>");
3031 $.ajax({
3032
3033 type : 'POST',
3034 url : '@plcUrl' + '/Default.aspx?ID=191',
3035 data : data,
3036 success : function(data)
3037 {
3038 var firstSplit = data.split('<script type="text/javascript">');
3039 $("#sizeInput").append(firstSplit[0]);
3040 }
3041 });
3042
3043 return false;
3044 }
3045 });
3046
3047 //End of variant selector
3048
3049 $( "#quantityInput" ).change(function() {
3050 var repack='@ProdRepackitems';
3051 if(repack=='True')
3052 {
3053 document.getElementById("repackQuantity").max = this.value;
3054
3055 document.getElementById("productFormQuantity").value = this.value;
3056 if(!$('#requireRepack').prop("checked"))
3057 {
3058 var linkstring = document.getElementById("addtocartLink").href.split('quantity=');
3059 var proid= document.getElementById("addtocartLink").href.split(',');
3060 var result=linkstring[0]+"quantity="+this.value+"',"+proid[1]+","+proid[2];
3061 document.getElementById("addtocartLink").href = result;
3062
3063 }
3064 }
3065 else{
3066
3067 var linkstring = document.getElementById("addtocartLink").href.split('quantity=');
3068 var proid= document.getElementById("addtocartLink").href.split(',');
3069 var result=linkstring[0]+"quantity="+this.value+"',"+proid[1]+","+proid[2];
3070 document.getElementById("addtocartLink").href = result;
3071
3072 }
3073
3074 });
3075 //Start of repack
3076 $( "#requireRepack" ).click(function() {
3077 if($('#requireRepack').prop("checked")){
3078 document.getElementById("repackChoose").style.display="block";
3079 document.getElementById("addtocartLink").href = 'javascript:void(0)';
3080 document.getElementById("addtocartLink").setAttribute("onclick","submitRepack()");
3081 }else{
3082 document.getElementById("repackChoose").style.display="none";
3083 document.getElementById("addtocartLink").href = '?productid=@pid&cartcmd=add&quantity='+document.getElementById("quantityInput").value;
3084 document.getElementById("addtocartLink").setAttribute("onclick","");
3085
3086 }
3087 });
3088 $( "#repackQuantity" ).change(function() {
3089 document.getElementById("repackFormQuantity").value = this.value;
3090 document.getElementById("repackProductPrice").innerHTML = "$"+parseInt(this.value)*parseFloat("@repackPrice")+".00";
3091 if(parseInt($( "#quantityInput" ).val())< parseInt(this.value))
3092 {
3093 this.value=1;
3094 $("#repackError").attr("class","");
3095 }
3096 else{
3097 $("#repackError").attr("class","hide");
3098 }
3099 });
3100
3101 function submitRepack(){
3102 showaddedItem('?cartcmd=add&productid=@pid&quantity=' +document.getElementById("quantityInput").value, @pid, false);
3103 document.getElementById("multiFormSubmit").click();
3104
3105 }
3106
3107
3108 $("#repackQuantity").keyup(function (event){
3109 if(parseInt($( "#quantityInput" ).val())<parseInt(this.value))
3110 {
3111 this.value=1;
3112 $("#repackError").attr("class","");
3113 }
3114 else{
3115 $("#repackError").attr("class","hide");
3116 }
3117 }).keydown(function (event){
3118 if ( event.which == 13 ) {
3119 event.preventDefault();
3120 }
3121 });
3122 //End of repack
3123 function productDetailBreadCrumb()
3124 {
3125 $('#breadcrumb').append('<li><a href="@plcUrl/@language">Home</a><li >></li></li>');
3126 //$('#breadcrumb').append('<li><a href="@plcUrl/@GetGlobalValue("Global:Page.Name")">@GetGlobalValue("Global:Page.Name")</a><li >></li></li>');
3127 $('#breadcrumb').append('<li><a href="@plcUrl/default.aspx?id=@pageID&firstgroup=@firstCategory.ToLower()">@firstCategory</a><li >></li></li>');
3128 //$('#breadcrumb').append('<li><a href="default.aspx?id=@pageID&firstgroup=@firstCategory.ToLower()&secondgroup=@secondCategory.ToLower()">@secondCategory.Replace("-a-","&")</a><li >></li></li>');
3129 //$('#breadcrumb').append('<li><a href="default.aspx?id=@pageID&firstgroup=@firstCategory.ToLower()&secondgroup=@secondCategory.ToLower()&thirdGroup=@thirdCategory.ToLower()">@thirdCategory.Replace("-a-","&")</a><li >></li></li>');
3130 //$('#breadcrumb').append('<li><a href="@plcUrl/@GetGlobalValue("Global:Page.Name")?q=@ProdBrand">@ProdBrand</a><li >></li></li>');
3131 $('#breadcrumb').append("<li><a href='@plcUrl/@language/@GetGlobalValue("Global:Page.Name")?brands=@ProdBrandEncode.ToLower()'>@ProdBrand</a><li >></li></li>");
3132 $('#breadcrumb').append('<li class="active">@ProdName</li>');
3133 }
3134
3135 productDetailBreadCrumb();
3136
3137 $(function () {
3138 $('#tabDivMain a:first').tab('show');
3139 });
3140
3141 //addProductDetails();
3142 <!------------------- Add to Cart Begin -------------->
3143 <!------- Check all variants are selected begin ---------->
3144 function CheckVariantSelected() {
3145 var returnValue = true;
3146 if(parseInt('@hasVariantCount') > 1) {
3147 if(('@hasSize').toLowerCase() == 'true') {
3148 if($("#sizeInput").val() == "" || $("#sizeInput").val().toLowerCase() == "please select size") {
3149 alert("Please select size.");
3150 returnValue = false;
3151 }
3152 }
3153 if(('@hasFlavour').toLowerCase() == 'true') {
3154 if($("#flavourInput").val() == "" || $("#flavourInput").val().toLowerCase() == "please select flavour") {
3155 alert("Please select flavour.");
3156 returnValue = false;
3157 }
3158 }
3159 if(('@hasColor').toLowerCase() == 'true') {
3160 if($("#colorInput").val() == "" || $("#colorInput").val().toLowerCase() == "please select color") {
3161 alert("Please select color.");
3162 returnValue = false;
3163 }
3164 }
3165 }
3166 if(returnValue) {
3167 //showaddedItem(" ", "@pid", "@ProdBrand", "@GetString("Ecom:Product.Name")", "@GetString("Ecom:Product.Price.PriceWithVAT")", "@GetString("Ecom:Product.Price.Currency.Symbol")", $("#quantityInput_" + "@pid").val(), true);
3168 //AjaxAddToCart("?cartcmd=add&productid=@pid&quantity=", "@pid");
3169
3170 ShowAddedItem_Then_AjaxAddToCart(" ", "@pid", "@ProdBrand.Replace(" & ", " myAND ")", '@GetString("Ecom:Product.Name").Replace(" & ", " myAND ")', "@GetString("Ecom:Product.Price.PriceWithVAT")", "@GetString("Ecom:Product.Price.Currency.Symbol")", $("#quantityInput_" + "@pid").val(), true, "&cartcmd=add&productid=@pid&quantity=")
3171 }
3172 }
3173 <!------- Check all variants are selected end ---------->
3174 <!------------------- Add to Cart End -------------->
3175 </script>
3176 <script src='/files/Templates/Designs/PLC/js/jquery.elevatezoom.js'></script>
3177 <script>
3178 // var $j = jQuery.noConflict();
3179 $('#zoom_product').elevateZoom({
3180 zoomType: "inner",
3181 cursor: "crosshair",
3182 zoomWindowFadeIn: 500,
3183 zoomWindowFadeOut: 750
3184 });
3185 </script>
3186 <script src='/files/Templates/Designs/PLC/js/jquery.bxslider.js'></script>
3187
3188 <!--Scrollbar -->
3189
3190 <!-- <link rel="stylesheet" href="/Files/Templates/Designs/PLC/assets/css/tinyscrollbar.css" type="text/css" media="screen"/>
3191 <script type="text/javascript" src="/Files/Templates/Designs/PLC/js/tinyscrollbar.js"></script>
3192
3193 <script type="text/javascript">
3194 $(document).ready(function()
3195 {
3196 var $scrollbar = $("#scrollbar1");
3197
3198 $scrollbar.tinyscrollbar();
3199 });
3200 </script> -->
3201
3202 <!-- Scrollbar -->
3203 @* ----- qty controller Begin----- *@
3204 <script type="text/javascript" src="/Files/Templates/Designs/PLC/js/PLCAddToCartQtyController.js?v=1.3"></script>
3205 @* ----- qty controller End------- *@
3206 <script>
3207 function collapseMobile(val){
3208 if($("#mb_"+val)[0].classList.contains("in")){
3209 $("#mb_"+val).removeClass("in");
3210 }else{
3211 $("#mb_"+val).addClass("in");
3212 }
3213 }
3214 </script>