Close
product image
Invalid email address
Close

Confirmation

Your notification request has been noted.
You will receive an email when the item becomes available in the online boutique.

Thank You

This website uses cookies to track your behavior and to improve your experience on the site. For more information, click here.

Error executing template "Designs/TWG/eCom7/CartV2/Step/showcart.cshtml"
System.FormatException: Input string was not in a correct format.
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Convert.ToDouble(String value)
   at CompiledRazorTemplates.Dynamic.RazorEngine_0faeba5c8d4341e098dbbb133a6f556a.Execute() in W:\Websites-9.6\Solutions\files\Templates\Designs\TWG\eCom7\CartV2\Step\showcart.cshtml:line 165
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web 2 @using Apac.Twg 3 @using Apac.Twg.DTO 4 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 5 @using Dynamicweb.Rendering 6 @using Dynamicweb.Ecommerce.Orders 7 @using System.Text.RegularExpressions 8 9 <style> 10 .top-cart-space { 11 padding: 0 0 20px 0!important; 12 } 13 14 .main-heading{ 15 font-size: 24px; 16 } 17 18 .cart-content .main-heading span{ 19 line-height: 17px; 20 } 21 22 #showCart_table .custom-checkbox.right-padding label{ 23 padding-top: 0px; 24 } 25 26 .qtyinput{ 27 border-radius: 0 !important; 28 } 29 30 .qtyinput:disabled{ 31 opacity: 1; 32 color: #000 !important; 33 border: 1px solid #000 !important; 34 } 35 36 /* 16-Dec-18 ACM */ 37 @@media (min-width: 768px){ 38 #showCart_table thead tr th:nth-child(1){ 39 width: 17.5%; 40 } 41 42 #showCart_table thead tr th:nth-child(2){ 43 width: 45%; 44 } 45 46 #showCart_table thead tr th:nth-child(3){ 47 width: 15%; 48 } 49 50 .product-description{ 51 margin-left: 3px; 52 } 53 54 .child_img{ 55 width: 130px; 56 } 57 58 .parent_img{ 59 width: 130px; 60 } 61 62 } 63 64 65 @@media (max-width: 768px) and (min-width: 414px) and (max-height: 1024px){ 66 #showCart_table thead tr th:nth-child(1){ 67 width: 27%; 68 } 69 70 #showCart_table thead tr th:nth-child(2){ 71 width: 35%; 72 } 73 74 #showCart_table thead tr th:nth-child(3){ 75 padding-right: 0 !important; 76 } 77 78 .child_img{ 79 width: 87px; 80 margin-right: 2px !important; 81 82 } 83 84 .firstchildrow, .childrow{ 85 padding-top: 0 !important; 86 } 87 88 .firstchildrow p > span, .childrow p > span{ 89 display: block !important; 90 margin-top: 0 !important; 91 } 92 93 .firstchildrow p > span span:first-of-type, .childrow p > span span:first-of-type{ 94 margin-left: 5px !important; 95 } 96 97 .firstchildrow p > span span:last-of-type, .childrow p > span span:last-of-type{ 98 margin-left: 117px !important; 99 } 100 101 .top-cart-space{ 102 padding-bottom: 10px !important; 103 } 104 105 .chosen-container .chosen-single span, .customSelect .customSelectInner{ 106 font-size: 16px !important; 107 } 108 109 } 110 @@media screen and (max-height: 1024px) and (max-width: 768px) and (min-width: 700px){ 111 112 #ordersubmit .btn-brown { 113 font-size: 12px !important; 114 width: 100%; 115 letter-spacing: 2px; 116 padding-top: 12px; 117 padding-bottom: 11px; 118 } 119 #ordersubmit .btn-brown-outline { 120 font-size: 12px !important; 121 width: 100%; 122 letter-spacing: 2px; 123 padding-top: 12px; 124 padding-bottom: 12px; 125 line-height: 25px; 126 } 127 .chosen-container .chosen-single span, .customSelect .customSelectInner{ 128 font-size: 16px !important; 129 } 130 } 131 132 </style> 133 134 <script> 135 var voucherScriptList=[]; 136 137 function removeorderline(uri){ 138 139 $.ajax({ 140 url: uri, 141 success: function () {}, 142 error: function () {} 143 }); 144 } 145 </script> 146 147 148 @{ 149 List<string> voidDiscountProducts= new List<string>(); 150 var productPageId=GetPageIdByNavigationTag("FindATeaPage"); 151 var loginPageId=GetPageIdByNavigationTag("LoginPage"); 152 var cartPageId=GetPageIdByNavigationTag("CartPage"); 153 var productDeatilPageId=GetPageIdByNavigationTag("ProductDetailPage"); 154 var weekendTeaPageId=GetPageIdByNavigationTag("WeekendTeaPage"); 155 string selfCollectionProduct = ""; 156 Order myorder = new OrderService().GetOrder(GetString("Ecom:Order.ID")); 157 //var totalOrderAmount = Convert.ToDouble(GetString("Ecom:Order.Price.Price")); 158 var totalOrderAmount = 0.00; 159 if (!string.IsNullOrEmpty(GetString("Ecom:Order.Price.Price"))) 160 { 161 totalOrderAmount = Convert.ToDouble(GetString("Ecom:Order.Price.Price")) - myorder.ShippingFee.PriceWithoutVAT ;//Convert.ToDouble(GetString("Ecom:Order.ShippingFee")); 162 } 163 else 164 { 165 totalOrderAmount = Convert.ToDouble(GetString("Ecom:Order.Price.Price")); 166 } 167 168 Dynamicweb.Frontend.PageView pw= Dynamicweb.Frontend.PageView.Current(); 169 pw.AreaSettings.GetDouble("Minimum_Order_Amount"); 170 171 double minimumOrderAmount = pw.AreaSettings.GetDouble("Minimum_Order_Amount"); 172 string minimumOrderMessage = pw.AreaSettings.GetString("Minimum_Order_Message"); 173 174 string hideGiftOption="False"; 175 if(pw.AreaSettings.GetBoolean("HideGiftOption")){hideGiftOption="True";} 176 string TrackingID= pw.AreaSettings.GetString("DC_code"); 177 bool PersonalizeMessage = pw.AreaSettings.GetBoolean("Hide_Personalised_Message_Option"); 178 var customerNumber = GetGlobalValue("Global:Extranet.UserName"); 179 180 var checkAddressExit = "false"; 181 if (customerNumber != "") 182 { 183 184 if (!string.IsNullOrWhiteSpace(GetString("Ecom:Order.Customer.Address"))) 185 { 186 checkAddressExit = "true"; 187 } 188 } 189 190 var memberNumber = ""; 191 var benefitShow = false; 192 var memberResponse = new MemberResponse(); 193 var voucherName = ""; 194 var rewardName = ""; 195 List<string> voucherNameList = new List<string>(); 196 List<string> voucherCodeList = new List<string>(); 197 List<string> voucherNumberList = new List<string>(); 198 List<string> rewardList = new List<string>(); 199 List<string> promoList = new List<string>(); 200 List<string> promoNameList = new List<string>(); 201 202 203 memberResponse = MembersonIntegration.GetMemberships(customerNumber); 204 if (memberResponse.Memberships.Count > 0) 205 { 206 foreach (var membership in memberResponse.Memberships) 207 { 208 if (membership.Status == "ACTIVE") 209 { 210 memberNumber = membership.MemberNo; 211 } 212 } 213 } 214 215 if (memberNumber != "") 216 { 217 218 var AllBenefits = new BenefitResponse(); 219 AllBenefits = MembersonIntegration.GetMemberDiscounts(memberNumber); 220 221 if (AllBenefits.ResponseStatus.ErrorCode == "200") 222 { 223 benefitShow = true; 224 var today = DateTime.Now; 225 226 foreach (var benefit in AllBenefits.Benefits) 227 { 228 229 230 if (benefit.Status.ToUpper() == "Created".ToUpper() && benefit.ExpiryDate > today) 231 { 232 voucherCodeList.Add(benefit.BenefitCode); 233 voucherNumberList.Add(benefit.BenefitTypeCode); 234 rewardList.Add(benefit.BenefitName); 235 <text> 236 <script>voucherScriptList.push({'VoucherName':'@benefit.BenefitName','VoucherCode':'@benefit.BenefitCode','VoucherNumber':'@benefit.BenefitTypeCode'});</script> 237 </text> 238 } 239 } 240 } 241 242 var voucherResponse = new VoucherResponse(); 243 244 voucherResponse = MembersonIntegration.GetLWEBVouchers(customerNumber); 245 foreach (var voucher in voucherResponse.Vouchers) 246 { 247 if (voucher.VoucherSubTypeCode.ToUpper() == "REWARD") 248 { 249 voucherName=voucher.VoucherName.Replace("\"","\\\"").Replace("\'","\\\'"); 250 benefitShow = true; 251 voucherNameList.Add(voucher.VoucherName); 252 voucherCodeList.Add(voucher.VoucherCode); 253 voucherNumberList.Add(voucher.VoucherNumber); 254 rewardList.Add(voucherName); 255 256 } 257 if (voucher.VoucherSubTypeCode.ToUpper() == "PROMO") 258 { 259 260 voucherName=voucher.VoucherName.Replace("\"","\\\"").Replace("\'","\\\'"); 261 promoList.Add(voucher.VoucherCode); 262 promoNameList.Add(voucherName); 263 } 264 <text> 265 <script>voucherScriptList.push({'VoucherName':'@voucherName','VoucherCode':'@voucher.VoucherCode','VoucherNumber':'@voucher.VoucherNumber'});</script> 266 </text> 267 268 } 269 270 } 271 272 273 274 275 } 276 @****************************Added By AKS for Loading ************************************@ 277 <style> 278 .loadingClass { 279 position: fixed; 280 z-index: 999999; 281 height: 3em; 282 /*width: 2em;*/ 283 overflow: show; 284 margin: auto; 285 top: 0; 286 left: 0; 287 bottom: 0; 288 right: 0; 289 } 290 291 /* Transparent Overlay */ 292 .loadingClass:before { 293 content: ''; 294 display: block; 295 position: fixed; 296 top: 0; 297 left: 0; 298 width: 100%; 299 height: 100%; 300 background-color: rgba(0,0,0,0.3); 301 } 302 </style> 303 304 <div style="display:none" id="WaitLoading" class="loadingClass btn-link preloader" > 305 <img class="fa-spin" src="/Files/Images/TWG-Tea/ring.png" style="margin-top: -28px" alt="ring"> 306 </div> 307 @****************************Added By AKS for Loading Ends Here ************************************@ 308 309 @*Dynamicweb.Frontend.PageView.Current().Area.ItemId <br> 310 311 @GetString("GiftPackaging.Clean")*@ 312 313 <div class="row"> 314 <div class="col-12 col-sm-12 col-md-12 col-lg-12"> 315 <div class="bg-light log-content register-content cart-content m-0 p-0"> 316 317 <div style="font-family: arial; font-size: 12px; letter-spacing: 2px; font-weight: 600; color: rgb(0,0,0);">@Translate("Step One Title SHOPPING BAG","SHOPPING BAG") <text style="color: rgba(0,0,0,0.5)"> > @Translate("Step One Title CHECK OUT","CHECK OUT") > @Translate("Step One Title PAYMENT","PAYMENT") </text></div> 318 @if (string.IsNullOrWhiteSpace(GetString("Ecom:Order.IsEmpty"))) 319 { 320 321 322 323 var rowFlag = 1; 324 <form name="ordersubmit" id="ordersubmit" action="/[email protected]" onkeypress="return event.keyCode != 13" method="post"> 325 <input type="hidden" name="Id" value="@Pageview.Page.ID" /> 326 327 328 <input type="hidden" id="childOrderLineIDList" name="childOrderLineIDList" /> 329 <input type="hidden" id="parentVariant" name="parentVariant" /> 330 <input type="hidden" id="childsToEdit" name="childsToEdit" /> 331 <input type="hidden" id="mainOdlId" name="mainOdlId" /> 332 <input type="hidden" id="uniqueCartitemNo" name="uniqueCartitemNo" /> 333 334 <div class="row"> 335 <div class="col-12"> 336 <p class="main-heading showcarttitle mb-0 pb-0">@Translate("YOUR SHOPPING BAG","YOUR SHOPPING BAG") 337 <span class="mt-4 text-none"><i>@Translate("MiniumOrderAmount","Minimum purchase of S$50 is required for every transaction. Shipments to all countries except Singapore will be made on a duties unpaid (DDU) basis, which means, you as an importer or the recipient are solely responsible for payment of any applicable duties and taxes upon receipt of your order.")</i></span></p> 338 </div> 339 </div> 340 341 <div class="table-responsive mt-5" style="overflow:inherit"> 342 <table class="table" id="showCart_table"> 343 <thead> 344 <tr class="none-line-height"> 345 <th style="padding-left: 0px;">@Translate("Show Cart PRODUCT","PRODUCT")</th> 346 <th colspan="2" class="ipad-w-40p">@Translate("Show Cart DESCRIPTION","DESCRIPTION")</th> 347 <th class="text-center">@Translate("Show Cart QUANTITY","QUANTITY")</th> 348 <th ></th> 349 <th class="text-right" style="padding-right: 0px;">@Translate("Show Cart PRICE","PRICE")</th> 350 </tr> 351 </thead> 352 <tbody> 353 @{ 354 var rewardLineName = ""; 355 var rewardLinePrice = ""; 356 var promoApply = ""; 357 var promoShowPrice = ""; 358 var promoPrice = 0.00; 359 Double amountDix=0.0; 360 } 361 @********************************************************addede by AKS for Minimum order price to checkout 15 Jan 2020 ************************************@ 362 @foreach (LoopItem orderline in GetLoop("OrderLines")) 363 { 364 365 366 if(orderline.GetString("Ecom:Order:OrderLine.Type")=="1") 367 { 368 369 string discountId = Dynamicweb.Ecommerce.Orders.OrderLine.GetOrderLineById(orderline.GetString("Ecom:Order:OrderLine.Id")).DiscountId; 370 371 foreach(LoopItem dd in orderline.GetLoop("AllDiscounts")) 372 { 373 if(discountId == dd.GetString("Ecom:AllDiscounts.Discount.ID")) 374 { 375 376 if(dd.GetString("Ecom:AllDiscounts.Discount.Type")=="AMOUNT") 377 { 378 amountDix= -1 * orderline.GetDouble("Ecom:Order:OrderLine.TotalPriceWithProductDiscounts.PriceWithVAT.Value"); 379 380 381 } 382 383 } 384 } 385 386 } 387 else if(orderline.GetString("Ecom:Order:OrderLine.Type")=="0") 388 { 389 if ( Convert.ToDouble(orderline.GetString("Ecom:Order:OrderLine.Price.Price")) == 0 390 && orderline.GetString("Ecom:Order:OrderLine.ProductID")!="PROD380")//sachet 391 { 392 393 if (orderline.GetLoop("Order.OrderLineFields").Count > 0) 394 { 395 string allfields = ""; 396 foreach (LoopItem Olf in orderline.GetLoop("Order.OrderLineFields")) 397 { 398 allfields += Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName"); 399 if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "ParentProductId") 400 { 401 402 if(!string.IsNullOrWhiteSpace(Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))) 403 { 404 string ParentProductId = Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"); 405 string pp_productParent = ParentProductId.Split('_')[0]; 406 407 bool found=false; 408 foreach (LoopItem orderlineGG in GetLoop("OrderLines")) 409 { 410 if(pp_productParent== orderlineGG.GetString("Ecom:Order:OrderLine.ProductID")) 411 { 412 found=true; 413 } 414 } 415 if(!found) 416 { 417 418 <script> 419 removeorderline('/cart?CartCmd=DelOrderLine&key=' + '@orderline.GetString("Ecom:Order:OrderLine.Id")'); 420 </script> 421 } 422 } 423 else{ 424 425 <script> 426 removeorderline('/cart?CartCmd=DelOrderLine&key=' + '@orderline.GetString("Ecom:Order:OrderLine.Id")'); 427 </script> 428 } 429 430 } 431 else if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "BoxNumber" && string.IsNullOrWhiteSpace(Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))) 432 { 433 <script> 434 removeorderline('/cart?CartCmd=DelOrderLine&key=' + '@orderline.GetString("Ecom:Order:OrderLine.Id")'); 435 </script> 436 } 437 438 }//orderline field loop end 439 440 if( (!allfields.Contains("BoxNumber")) && (!allfields.Contains("ParentProductId"))){ 441 <script> 442 removeorderline('/cart?CartCmd=DelOrderLine&key=' + '@orderline.GetString("Ecom:Order:OrderLine.Id")'); 443 </script> 444 } 445 446 } 447 else{ 448 <script> 449 removeorderline('/cart?CartCmd=DelOrderLine&key=' + '@orderline.GetString("Ecom:Order:OrderLine.Id")'); 450 </script> 451 452 } 453 454 } 455 } 456 457 } 458 @********************************************************addede by AKS for Minimum order price to checkout 15 Jan 2020 end here ************************************@ 459 @foreach (LoopItem orderline in GetLoop("OrderLines")) 460 { 461 if (rewardList.Count() > 0) 462 { 463 for (int i = 0; i < rewardList.Count(); i++) 464 { 465 if (rewardList[i].Equals(orderline.GetString("Ecom:Order:OrderLine.ProductName"), StringComparison.CurrentCultureIgnoreCase)) 466 { 467 rewardLineName = orderline.GetString("Ecom:Order:OrderLine.ProductName"); 468 rewardLinePrice = orderline.GetString("Ecom:Order:OrderLine.UnitPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),GetString("Ecom:Order.Currency.Symbol")+" "); 469 } 470 } 471 } 472 if (promoList.Count() > 0) 473 { 474 475 for (int po = 0; po < promoList.Count(); po++) 476 { 477 478 if (promoList[po].Equals(GetString("Ecom:Order.Customer.VoucherCode"), StringComparison.CurrentCultureIgnoreCase)) 479 { 480 481 if (promoNameList[po].Equals(orderline.GetString("Ecom:Order:OrderLine.ProductName"), StringComparison.CurrentCultureIgnoreCase) && orderline.GetString("Ecom:Order:OrderLine.Type") != "3") 482 { 483 promoApply = promoNameList[po]; 484 promoShowPrice = orderline.GetString("Ecom:Order:OrderLine.Price.Price"); 485 promoPrice += Convert.ToDouble(orderline.GetString("Ecom:Order:OrderLine.UnitPrice").Replace("-","").Replace(GetString("Ecom:Order.Currency.Symbol"),"")); 486 487 488 } 489 } 490 491 } 492 } 493 494 /* OrderLine Information*/ 495 string image = "Files/images/TWG-Tea/Products/List290x230/" + orderline.GetString("Ecom:Product.Number").Replace("/", "").Trim() + ".jpg"; 496 int qty = orderline.GetInteger("Ecom:Order:OrderLine.Quantity"); 497 string OdlId = orderline.GetString("Ecom:Order:OrderLine.Id"); 498 string boxNumber = ""; 499 string ParentProductId = ""; 500 string looseTeaParentNo = ""; 501 string relatedorderlines = ""; 502 string relatedorderlineIDs = ""; 503 string orderlinesToUpdate = ""; 504 string isgift = ""; 505 string hamper = ""; 506 string gourment = ""; 507 string rowClass = ""; 508 509 /* If it is product line start*/ 510 if (!string.IsNullOrWhiteSpace(orderline.GetString("Ecom:Order:OrderLine.IsProduct"))) 511 { 512 if(orderline.GetBoolean("Ecom:Product:Field.voidDiscount")){ 513 voidDiscountProducts.Add(orderline.GetString("Ecom:Order:OrderLine.ProductName")); 514 } 515 /*Hamper and Gourmet and self collection*/ 516 if (orderline.GetString("Ecom:Product:Field.item_classification").Contains("hamper")) 517 { 518 hamper = "True"; 519 } 520 if (orderline.GetString("Ecom:Product:Field.item_classification").Contains("gourmet")) 521 { 522 gourment = "True"; 523 } 524 if (orderline.GetString("Ecom:Product:Field.item_classification").Contains("self collection")) 525 { 526 selfCollectionProduct = "True"; 527 } 528 /* End */ 529 /*Check Orderfield Count */ 530 if (orderline.GetLoop("Order.OrderLineFields").Count > 0) 531 { 532 foreach (LoopItem Olf in orderline.GetLoop("Order.OrderLineFields")) 533 { 534 /*Check Gift*/ 535 if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "Gift") 536 { 537 isgift = Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"); 538 } 539 /*End*/ 540 /*Check Parent Product ID*/ 541 if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "ParentProductId" && !string.IsNullOrWhiteSpace(Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))) 542 { 543 ParentProductId = Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"); 544 } 545 /*End*/ 546 /*Check box number*/ 547 if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "BoxNumber" && !string.IsNullOrWhiteSpace(Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))) 548 { 549 foreach (LoopItem ol in GetLoop("OrderLines")) 550 { 551 foreach (LoopItem relOlf in ol.GetLoop("Order.OrderLineFields")) 552 { 553 if (relOlf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "ParentProductId") 554 { 555 if (relOlf.GetString("Ecom:Order:OrderLine.OrderLineField.Value") == orderline.GetString("Ecom:Order:OrderLine.ProductID") + orderline.GetString("Ecom:Order:OrderLine.ProductVariantID") + "_" + Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value")) 556 { 557 relatedorderlines += "'" + ol.GetString("Ecom:Order:OrderLine.Id") + "," + ol.GetString("Ecom:Order:OrderLine.Quantity") + "',"; 558 relatedorderlineIDs += "'" + ol.GetString("Ecom:Order:OrderLine.ProductID") + "_" + ol.GetString("Ecom:Order:OrderLine.Quantity") + "',"; 559 orderlinesToUpdate += "'" + ol.GetString("Ecom:Order:OrderLine.Id") + "',"; 560 } 561 } 562 } 563 } 564 boxNumber = Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"); 565 } 566 /*End*/ 567 /*Check Loose Tea*/ 568 if (Olf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "LooseTeaParentNo" && !string.IsNullOrWhiteSpace(Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))) 569 { 570 571 foreach (LoopItem ol in GetLoop("OrderLines")) 572 { 573 foreach (LoopItem relOlf in ol.GetLoop("Order.OrderLineFields")) 574 { 575 576 if (relOlf.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "ParentProductId") 577 { 578 579 if (relOlf.GetString("Ecom:Order:OrderLine.OrderLineField.Value") == orderline.GetString("Ecom:Order:OrderLine.ProductID") + orderline.GetString("Ecom:Order:OrderLine.ProductVariantID") + "_" + Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value")) 580 { 581 relatedorderlines += "'" + ol.GetString("Ecom:Order:OrderLine.Id") + "," + ol.GetString("Ecom:Order:OrderLine.Quantity") + "',"; 582 relatedorderlineIDs += "'" + ol.GetString("Ecom:Order:OrderLine.ProductID") + "_" + ol.GetString("Ecom:Order:OrderLine.Quantity") + "',"; 583 orderlinesToUpdate += "'" + ol.GetString("Ecom:Order:OrderLine.Id") + "',"; 584 } 585 } 586 } 587 } 588 589 590 looseTeaParentNo = Olf.GetString("Ecom:Order:OrderLine.OrderLineField.Value"); 591 } 592 /*End*/ 593 } 594 } 595 596 var editLTWeight = 0; 597 var EditWeight = 0; 598 if (!String.IsNullOrEmpty(orderline.GetString("Ecom:Product.VariantText"))) 599 { 600 601 /*Testing*/ 602 /* if (orderline.GetString("Ecom:Product.VariantText").Contains("グ")) 603 { 604 EditWeight = Convert.ToInt32(orderline.GetString("Ecom:Product.VariantText").Replace("グ", "")) * 1000; 605 }*/ 606 /*Testing*/ 607 if (orderline.GetString("Ecom:Product.VariantText").Contains("kg")) 608 { 609 EditWeight = Convert.ToInt32(orderline.GetString("Ecom:Product.VariantText").Replace("kg", "")) * 1000; 610 } 611 else 612 { 613 EditWeight = Convert.ToInt32(orderline.GetString("Ecom:Product.VariantText").Replace("g", "")); 614 } 615 var EditQty = Convert.ToInt32(orderline.GetString("Ecom:Order:OrderLine.Quantity")); 616 editLTWeight = EditWeight * EditQty; 617 } 618 /*start child product*/ 619 if (!string.IsNullOrWhiteSpace(ParentProductId)) 620 { 621 622 if (rowFlag == 1) 623 { 624 rowClass = "firstchildrow"; 625 rowFlag = 0; 626 } 627 else 628 { 629 rowClass = "childrow"; 630 } 631 <tr> 632 <td class="@rowClass"> 633 634 </td> 635 <td class="@rowClass top-cart-space"> 636 <div style="margin-left: 4px;"> 637 <img src="@image" alt="" class="img-fluid float-left mr-4 child_img" width="130px"> 638 <input type="hidden" id='@orderline.GetString("Ecom:Order:OrderLine.Id")' name='[email protected](orderline.GetString("Ecom:Order:OrderLine.Id"))' value='@qty'/> 639 <p> 640 <span class="d-inline-block mr-3" style="margin-top: 23px;font-family: Adobe Garamond Pro;">@qty x 641 <span style="font-family: Adobe Garamond Pro;margin-left: 12px;">@orderline.GetString("Ecom:Order:OrderLine.ProductNumber")</span> 642 <span class="d-block shopcartproductname" style="/*color:#000;font-family: Adobe Garamond Pro; */ margin-left: 37px;">@orderline.GetString("Ecom:Order:OrderLine.ProductName")</span> 643 </span> 644 </p> 645 <div class="float-left pt-4 product-child"> 646 647 <!--div class="row"> 648 <div class="col-4"><span>@qty x</span></div> 649 <div class="col-8"><span>@orderline.GetString("Ecom:Order:OrderLine.ProductNumber")</span></div> 650 </div> 651 <div class="row"> 652 <div class="col-4"></div> 653 <div class="col-8"><span class="color-black">@orderline.GetString("Ecom:Order:OrderLine.ProductName")</span></div> 654 </div--> 655 </div> 656 <div class="clearfix"></div> 657 </div> 658 659 </td> 660 <td class="@rowClass"> 661 662 </td> 663 <td class="text-right @rowClass" colspan="3"> 664 <div class="product-price"> 665 <p class="color-black"> 666 <b> 667 @if (orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0.00" && orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0") 668 { 669 <span><span style="font-family: Adobe Garamond Pro Regular;">@orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),GetString("Ecom:Order.Currency.Symbol")+" ")</span></span> 670 } 671 </b> 672 </p> 673 674 </div> 675 </td> 676 </tr> 677 }/*end child product*/ 678 else 679 { 680 string giftinputname = "OrderLineFieldValue_" + @OdlId + "_Gift"; 681 682 rowFlag = 1; 683 <tr> 684 <td class="table-spacing" colspan="6"></td> 685 </tr> 686 <tr> 687 <td class="@rowClass" width=""> 688 <div class="product-large"> 689 <img src="@image" alt="" class="img-fluid parent_img" width="130px"> 690 </div> 691 </td> 692 <td class="@rowClass" colspan="2"> 693 <div class="product-description mb-3"> 694 <p class="mb-0">@orderline.GetString("Ecom:Order:OrderLine.ProductNumber")</p> 695 <span class="mb-0 shopcartproductname">@orderline.GetString("Ecom:Order:OrderLine.ProductName")</span><br> 696 <small style = "color:#393331"> @orderline.GetString("Ecom:Order:OrderLine.ProductVariantText")</small> 697 <small class="br-color">@orderline.GetString("Ecom:Product:Field.product_capacity")</small> 698 </div> 699 <div class="Parent_Gift custom-checkbox"> 700 701 @if (string.IsNullOrWhiteSpace(gourment)) 702 { 703 704 if(hideGiftOption=="False") 705 { 706 <input type="hidden" name="@giftinputname" value="@isgift" /> 707 <div class="custom-checkbox right-padding" style="margin-left:4px"> 708 <input id="[email protected]" class="giftcheck" type="checkbox" @isgift > 709 <label for="[email protected]">@Translate("Show Cart IS THIS A GIFT?","IS THIS A GIFT?")</label> 710 </div> 711 } 712 } 713 </div> 714 </td> 715 <td class="@rowClass"> 716 <!--div class="row"> 717 <div class="col-4"--> 718 <div class="custom-select-box"> 719 <!--<select class="form-control"> 720 <option>2</option> 721 </select>--> 722 <input readonly 723 onfocus="inputFocus(this)" 724 onfocusout="inputFocusOut(this)" 725 type='number' 726 id='@OdlId' 727 name='[email protected](OdlId)' 728 min='1' 729 style="width:85px; font-size:16px !important;" 730 class="mx-auto d-block 731 @if (string.IsNullOrWhiteSpace(looseTeaParentNo)) { <text> 732 qtydownarrow 733 </text> } 734 qtyinput" 735 @if (!string.IsNullOrWhiteSpace(looseTeaParentNo)) { <text> 736 loose_tea="1" 737 disabled 738 </text> } 739 @if (!string.IsNullOrWhiteSpace(boxNumber)) { <text> 740 mix_match="1" 741 </text> } 742 actual='@qty' 743 value='@qty' /> 744 745 <ul class="numb_drop list-unstyled cart-qty-dropdown"> 746 747 @if (orderline.GetInteger("Ecom:Product:Field.maxQty") > 0) 748 { 749 for (int i = 1; i <= orderline.GetInteger("Ecom:Product:Field.maxQty"); i++) 750 { 751 <li onclick='input_drop_click(this,@i)'>@i</li> 752 } 753 } 754 else 755 { 756 for (int i = 1; i <= 20; i++) 757 { 758 <li onclick='input_drop_click(this,@i)'>@i</li> 759 } 760 } 761 </ul> 762 </div> 763 <!--/div> 764 765 <div class="col-8 align-self-center pl-5"> 766 @if (!string.IsNullOrWhiteSpace(boxNumber) || !string.IsNullOrWhiteSpace(looseTeaParentNo)) 767 { 768 string mainProductID = orderline.GetString("Ecom:Order:OrderLine.ProductID"); 769 string boxorLoosetea = boxNumber.ToString() + looseTeaParentNo.ToString(); 770 string mixMatch = "0"; 771 if (!string.IsNullOrWhiteSpace(boxNumber)) { mixMatch = "1"; } 772 <a href="javascript:void(0)" class="link d-block" onclick="DeleteBox( @qty,'@OdlId',[@relatedorderlines])" id='[email protected]' rel_odls=[@relatedorderlines]>REMOVE</a> 773 <a href="javascript:void(0)" class="link d-block" onclick="editSetOrLoosetea('@mainProductID','@OdlId',[@relatedorderlineIDs],[@orderlinesToUpdate],'@orderline.GetString("Ecom:Order:OrderLine.ProductVariantID")','@boxorLoosetea','@mixMatch', '@editLTWeight' )">EDIT</a> 774 } 775 else 776 { 777 778 <a class="link d-block" href='@orderline.GetString("Ecom:Order:OrderLine.DeleteLink")' id='[email protected]'> REMOVE </a> 779 } 780 781 </div> 782 </div--> 783 </td> 784 <td class="@rowClass"> 785 @if (!string.IsNullOrWhiteSpace(boxNumber) || !string.IsNullOrWhiteSpace(looseTeaParentNo)) 786 { 787 string mainProductID = orderline.GetString("Ecom:Order:OrderLine.ProductID"); 788 string boxorLoosetea = boxNumber.ToString() + looseTeaParentNo.ToString(); 789 string mixMatch = "0"; 790 if (!string.IsNullOrWhiteSpace(boxNumber)) { mixMatch = "1"; } 791 <a href="javascript:void(0)" class="link d-block" style="font-size:12px !important;" onclick="DeleteBox( @qty,'@OdlId',[@relatedorderlines]); " id='[email protected]' rel_odls=[@relatedorderlines]>@Translate("Show Cart REMOVE","REMOVE")</a> 792 <a href="javascript:void(0)" class="link d-block" style="font-size:12px !important;" onclick="editSetOrLoosetea('@mainProductID','@OdlId',[@relatedorderlineIDs],[@orderlinesToUpdate],'@orderline.GetString("Ecom:Order:OrderLine.ProductVariantID")','@boxorLoosetea','@mixMatch', '@editLTWeight' )">@Translate("Show Cart EDIT","EDIT")</a> 793 } 794 else 795 { 796 797 <a class="link d-block" style="font-size:12px !important;" href='@orderline.GetString("Ecom:Order:OrderLine.DeleteLink")' id='[email protected]'> @Translate("Show Cart REMOVE","REMOVE") </a> 798 } 799 </td> 800 <td class="text-right @rowClass"> 801 <div class="product-price"> 802 <p class="color-black"> 803 <b> 804 @if (orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0.00" && orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0") 805 { 806 <span><span style="font-family: Adobe Garamond Pro Regular;">@orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),GetString("Ecom:Order.Currency.Symbol")+" ") </span></span> 807 } 808 809 </b> 810 </p> 811 </div> 812 </td> 813 814 </tr> 815 } 816 817 } 818 /*product line end*/ 819 else 820 { 821 822 /*If it is discount line*/ 823 if (orderline.GetString("Ecom:Order:OrderLine.ProductName") != rewardLineName && orderline.GetString("Ecom:Order:OrderLine.ProductName") != promoApply) 824 { 825 826 string discountId = Dynamicweb.Ecommerce.Orders.OrderLine.GetOrderLineById(orderline.GetString("Ecom:Order:OrderLine.Id")).DiscountId; 827 string discountName = string.Empty; 828 if (discountId != null) 829 { 830 discountName=Dynamicweb.Ecommerce.Orders.Discounts.Discount.GetDiscountById(Convert.ToInt32(discountId)).Name; 831 } 832 833 <tr> 834 <td style="padding: 10px 0px !important;"></td> 835 <td colspan="2" style="padding: 10px 0px !important;"> 836 @if (!string.IsNullOrEmpty(orderline.GetString("Ecom:Order:OrderLine.ProductName"))){ 837 if (orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0.00" && orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0") 838 { 839 <p class="mb-0 font-futura" style="color: #000; font-family: 'FuturaMedium';"><b>@orderline.GetString("Ecom:Order:OrderLine.ProductName") </b></p> 840 } 841 else{ 842 if(orderline.GetString("Ecom:Order:OrderLine.ProductName").ToLower().Contains("shipping")){ 843 <p class="mb-0 font-futura" style="color: #000; font-family: 'FuturaMedium';"><b>@orderline.GetString("Ecom:Order:OrderLine.ProductName")</b></p> 844 } 845 else{ 846 <p class="mb-0 font-futura" style="color: #000; font-family: 'FuturaMedium';"><b>@orderline.GetString("Ecom:Order:OrderLine.ProductName") @Translate("Gift with Purchase"," Gift with Purchase")</b></p> 847 } 848 } 849 } 850 else 851 { 852 <p class="mb-0 font-futura" style="color: #000; font-family: 'FuturaMedium';"><b>@discountName</b></p> 853 } 854 </td> 855 <td colspan="3" class="text-right" style="padding: 10px 0px !important;"> 856 <div class="product-price"> 857 @if (orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0.00" && orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace(GetString("Ecom:Order.Currency.Symbol"),"") != "0") 858 { 859 <p class="mb-0" style="color: #000;"><b><span>(<span style="font-family: Adobe Garamond Pro Regular;">@orderline.GetString("Ecom:Order:OrderLine.TotalPrice").Replace("-","").Replace(GetString("Ecom:Order.Currency.Symbol"),GetString("Ecom:Order.Currency.Symbol")+" ")</span>)</span></b></p> 860 } 861 862 </div> 863 </td> 864 865 866 867 </tr> 868 } 869 } 870 } 871 872 </tbody> 873 874 <tfoot class="table-reward-section"> 875 @if (!string.IsNullOrWhiteSpace(rewardLineName)) 876 { 877 <tr> 878 <td></td> 879 <td colspan="2"> 880 <p class="mb-0 font-futura">@rewardLineName</p> 881 </td> 882 <td class="text-right" colspan="3"> 883 <div class="product-price"> 884 <p class="mb-0"><b>(<span><span style="font-family: Adobe Garamond Pro Regular;">@rewardLinePrice.Replace("-","").Replace(GetString("Ecom:Order.Currency.Symbol"),GetString("Ecom:Order.Currency.Symbol")+" ")</span></span>)</b></p> 885 886 </div> 887 </td> 888 </tr> 889 } 890 @if (!string.IsNullOrWhiteSpace(promoApply)) 891 { 892 <tr> 893 <td></td> 894 <td colspan="2"> 895 <p class="mb-0 font-futura"><b>@promoApply</b></p> 896 </td> 897 <td class="text-right" colspan="3"> 898 <div class="product-price"> 899 <p class="mb-0"><b>(@GetString("Ecom:Order.Currency.Symbol") <span><span style="font-family: Adobe Garamond Pro Regular;">@promoShowPrice.Replace("(", "").Replace(")", "").Replace("-","")</span> </span>)</b></p> 900 901 </div> 902 </td> 903 </tr> 904 } 905 </tfoot> 906 </table> 907 908 </div> 909 @{ 910 var totalOrderValue = Convert.ToDouble(GetString("Ecom:Order.PriceWithoutDiscounts.Price")) - Convert.ToDouble(GetString("Ecom:Order.ShippingFee.Price")); 911 var subtotalPrice = Convert.ToDouble(GetString("Ecom:Order.OrderLines.TotalPriceWithoutSymbol")) - Convert.ToDouble(GetString("Ecom:Order.ShippingFee.Price")) ;//+ promoPrice; 912 913 914 } 915 <div> 916 <input class="form-control" type="hidden" name="VoucherNumber" id="VoucherNumber" value="@GetString("VoucherNumber.Clean")" /> 917 <input class="form-control" type="hidden" name="EcomOrderVoucherCode" id="EcomOrderVoucherCode" value="@GetString("Ecom:Order.Customer.VoucherCode")" /> 918 </div> 919 <div class="row mt-5" style="padding-top: 14px;"> 920 <div class="col-12 col-lg-6"> 921 <ul class="list-unstyled border-list personalized-content"> 922 <li> 923 924 <div class="custom-checkbox"> 925 <input name="GiftPackaging" type="hidden" /> 926 <input id="GiftPackaging" name="GiftPackaging" type="checkbox" onclick="changechecked(this);" /> 927 <label for="GiftPackaging" class="text-uppercase font-20px"><span> @Translate("giftPackaging", "Gift Packaging For All Items (Optional)")</span></label> 928 </div> 929 <p class="mb-0 labelfontsize">@Translate("giftPackagingService", "Our gift packing service incudes a signature TWG Tea gift wrap, finished with a hand-tied ribbon.")</p> 930 <p class="mb-0 labelfontsize"><small>@Translate("giftPackagingNote", "Please note that we may not able to provide gift packing for certain items.")</small></p> 931 </li> 932 <li class="mt-4 tbl-cart-msg-padding"> 933 @if(!PersonalizeMessage){ 934 <div class="custom-checkbox" > 935 <input type="hidden" name="AddPersonalMessage"> 936 <input id="AddPersonalMessageChk" name="AddPersonalMessage" type="checkbox" @if(GetString("AddPersonalMessage").Contains("checked=\"checked\"")){<text>checked='checked'</text>} onclick="changechecked(this);"> 937 <label for="AddPersonalMessageChk" class="text-uppercase font-20px showCartPersonalMessage"><span id="personalMessage">@Translate("Add a Personalised Message", "Add a Personalised Message")</span></label> 938 <!--<input id="AddPersonalMessageChk" name="" type="checkbox" onclick="changechecked(this);" >--> 939 </div> 940 } 941 <div class="check-slide-content" id="form_placeholder" style="display:none"> 942 943 <div class="form-group"> 944 <input class="form-control " style="height:2.3em;" name="ToPersonalisedMessage" id="ToPersonalisedMessage" placeholder='@Translate("To:","To:")' type="text" value="@GetString("ToPersonalisedMessage.Clean")"> 945 </div> 946 <div class="form-group" style="margin-top:-5px;"> 947 <textarea maxlength="150" class="form-control " name="PersonalisedMessage" id="PersonalisedMessage" style="height:124px;font-size: 16px;" rows="5" placeholder='@Translate("Please enter a gift message of up to 150 characters.","Please enter a gift message of up to 150 characters.")'>@GetString("PersonalisedMessage.Clean").Replace("<br />","\r\n")</textarea> 948 </div> 949 <div class="form-group"> 950 <input class="form-control " style="height: 38px;" name="FromPersonalisedMessage" id="FromPersonalisedMessage" placeholder='@Translate("From:","From:")' type="text" value="@GetString("FromPersonalisedMessage.Clean")"> 951 </div> 952 953 </div> 954 </li> 955 </ul> 956 </div> 957 958 <div class="col-12 col-lg-5 ml-auto sm-orderSummary-mt" > 959 <div class="row total-amount mb-3" style="padding-top: 5px;"> 960 <div class="col-7 align-self-end"><p class="text-capitalize color-black"><b>@Translate("Show Cart total order value","total order value")</b></p></div> 961 <div class="col-5 text-right"><p class="color-black"><b><span class="amount" style="font-family: Adobe Garamond Pro Regular;">@GetString("Ecom:Order.Currency.Symbol") @totalOrderValue.ToString("F")</span></b></p></div> 962 </div> 963 @if (benefitShow) 964 { 965 <div class="row justify-content-end"> 966 <div class="col-7 RewardSelectionBlock"> 967 <div class="custom-select-box"> 968 <select class="form-control text-center" name="EcomOrderVoucherCodeShow" id="EcomOrderVoucherCodeShow" onchange="rewardchange();"> 969 <option value=''>@Translate("Show Cart SELECT YOUR REWARD","SELECT YOUR REWARD")</option> 970 971 972 @for (int i = 0; i < rewardList.Count(); i++) 973 { 974 if (GetString("Ecom:Order.Customer.VoucherCode") == voucherCodeList[i] && GetString("VoucherNumber.Clean") == voucherNumberList[i]) 975 { 976 <option value="@voucherCodeList[i]|@voucherNumberList[i]" selected style="padding:10px;">@rewardList[i]</option> 977 } 978 else 979 { 980 <option value="@voucherCodeList[i]|@voucherNumberList[i]" style="padding:10px;">@rewardList[i]</option> 981 } 982 } 983 </select> 984 </div> 985 </div> 986 </div> 987 } 988 <div class="row total-amount mb-3 mt-5 margin-top-wrap" style="padding-bottom: 12px;"> 989 <div class="col-7 align-self-end "> 990 <p class="text-capitalize color-black"><b>@Translate("Show Cart Sub Total","Sub Total")</b></p> 991 </div> 992 <div class="col-5 text-right sm-pr-0"> 993 <p class="color-black"><b><span class="amount" style="font-family: Adobe Garamond Pro Regular;">@GetString("Ecom:Order.Currency.Symbol") @subtotalPrice.ToString("F")</span></b></p> 994 </div> 995 </div> 996 <div class="row"> 997 @if (customerNumber == "") 998 { 999 <div class="col-12 text-right"> 1000 <div class="row"> 1001 <div class="col-lg-7 col-md-6 col-sm-6 col-xs-12"> 1002 <button class="btn-brown-outline w-100 mb-2 mr-2" type="button" id="gotoProduct" >@Translate("Show Cart Continue Shopping","Continue Shopping")</button> 1003 1004 </div> 1005 <div class="col-lg-5 col-md-6 col-sm-6 col-xs-12"> 1006 <button class="btn-brown w-100" type="button" id="checkLogin">@Translate("Show Cart Check Out","Check Out")</button> 1007 1008 </div> 1009 </div> 1010 </div> 1011 1012 1013 } 1014 @* else if(voidDiscountProducts.Count>0 && GetDouble("Ecom:Order.TotalDiscount.PriceWithVAT.Value")<0){ 1015 <div class="col-12 text-right"> 1016 <span style="color:red"> 1017 Discount Not allowed for following Products <br> @string.Join(",", voidDiscountProducts) <br> 1018 </span> 1019 </div> 1020 }*@ 1021 else 1022 { 1023 <div class="col-12 text-right"> 1024 <div class="row"> 1025 <div class="col-lg-7 col-md-6 col-sm-6 col-xs-12"> 1026 <button class="btn-brown-outline w-100 mb-2 mr-2" type="button" id="gotoProduct">@Translate("Show Cart Continue Shopping","Continue Shopping")</button> 1027 </div> 1028 <div class="col-lg-5 col-md-6 col-sm-6 col-xs-12"> 1029 @if (totalOrderAmount + amountDix < minimumOrderAmount) 1030 { 1031 <button class="btn-brown w-100 " type="button" onclick="return ShowPopUp();">@Translate("Show Cart Check Out","Check Out")</button> 1032 } 1033 else 1034 { 1035 <button class="btn-brown w-100" type=" submit" onclick="return updateCart();" name="@GetString("CartV2.NextStepButtonName")" id="cartnext">@Translate("Show Cart Check Out","Check Out")</button> 1036 } 1037 </div> 1038 </div> 1039 </div> 1040 } 1041 1042 </div> 1043 </div> 1044 </div> 1045 </form> 1046 1047 } 1048 else 1049 { 1050 string redirectUrl="/default.aspx?Id="+GetPageIdByNavigationTag("MasterPage"); 1051 HttpContext.Current.Response.Redirect(redirectUrl, false); 1052 } 1053 1054 <div style="float:right;margin-top:20px"> 1055 <ul style="list-style:none"> 1056 <li style="float:left"><img class="payIcon" src="/files/Images/TWG-Tea/Footer Menu/visa.png"></li> 1057 <li style="float:left"><img class="payIcon" src="/files/Images/TWG-Tea/Footer Menu/MC.png"></li> 1058 <li style="float:left"><img class="payIcon" src="/files/Images/TWG-Tea/Footer Menu/AM.png"></li> 1059 <li style="float:left"><img class="payIcon" src="/files/Images/TWG-Tea/Footer Menu/Paypal.png"></li> 1060 </ul> 1061 </div> 1062 1063 <style> 1064 .payIcon{ 1065 width:80px 1066 } 1067 </style> 1068 1069 1070 1071 </div> 1072 </div> 1073 </div> 1074 <script> 1075 1076 $(document).ready(function() 1077 { 1078 document.cookie = "Cartpage= ; expires = Thu, 01 Jan 2050 00:00:00 GMT;path=/;" 1079 }); 1080 1081 1082 document.getElementById("gotoProduct").onclick = function () { 1083 var formData = new FormData(); 1084 $('.giftcheck').each(function () { 1085 1086 formData.append($(this).closest('.custom-checkbox').siblings('input[name*=OrderLineFieldValue_]').attr('name'),$(this).closest('.custom-checkbox').siblings('input[name*=OrderLineFieldValue_]').val()); 1087 1088 }); 1089 1090 1091 1092 $('.Fav-circle-bg').show(); 1093 1094 $.ajax({ 1095 url: "/[email protected]", 1096 type: 'POST', 1097 dataType: "html", 1098 data: formData, 1099 mimeType: "multipart/form-data", 1100 contentType: false, 1101 cache: false, 1102 processData: false, 1103 success: function (data, textStatus, jqXHR) { 1104 1105 location.href = "/[email protected]"; 1106 }, 1107 error: function (jqXHR, textStatus, errorThrown) { 1108 ////alert("Form Submit Error"); 1109 } 1110 }); 1111 1112 1113 }; 1114 1115 if ( $( "#checkLogin" ).length ) { 1116 document.getElementById("checkLogin").onclick = function () { 1117 1118 console.log("AddPersonalMessage :"+$("#AddPersonalMessage").val()); 1119 var formData = new FormData(); 1120 $('.giftcheck').each(function () { 1121 1122 formData.append($(this).closest('.custom-checkbox').siblings('input[name*=OrderLineFieldValue_]').attr('name'),$(this).closest('.custom-checkbox').siblings('input[name*=OrderLineFieldValue_]').val()); 1123 1124 }); 1125 console.log("AddPersonalMessage :"+$("#AddPersonalMessage").attr('checked')); 1126 if($("#AddPersonalMessageChk").prop('checked') == false) 1127 { 1128 $("#AddPersonalMessageChk").prop('checked', false); 1129 $("#ToPersonalisedMessage").val(""); 1130 $("#PersonalisedMessage").val(""); 1131 $("#FromPersonalisedMessage").val(""); 1132 } 1133 $.ajax({ 1134 url: "/[email protected]", 1135 type: 'POST', 1136 dataType: "html", 1137 data: formData, 1138 mimeType: "multipart/form-data", 1139 contentType: false, 1140 cache: false, 1141 processData: false, 1142 success: function (data, textStatus, jqXHR) { 1143 location.href = "/[email protected]"; 1144 document.cookie = 'Cartpage=on; expires=Sat, 31 Dec 2050 12:00:00 GMT; path=/;'; 1145 }, 1146 error: function (jqXHR, textStatus, errorThrown) { 1147 ////alert("Form Submit Error"); 1148 } 1149 }); 1150 1151 }; 1152 } 1153 1154 1155 1156 1157 1158 function inputFocus(control){ 1159 $(control).closest('td').find('ul').show(); 1160 1161 } 1162 1163 function inputFocusOut(control){ 1164 //$(control).closest('td').find('ul').hide(); 1165 setTimeout(function() {$(control).closest('td').find('ul').hide();}, 250); 1166 1167 } 1168 1169 function input_drop_click(cont,num){ 1170 $(cont).closest('td').find('.qtyinput').attr("value",parseInt(num)); 1171 updateLines($(cont).closest('td').find('.qtyinput')); 1172 $('#ordersubmit').submit(); 1173 } 1174 1175 function updateLines(control){ 1176 1177 if( $(control).attr("mix_match")=="1") 1178 { 1179 1180 var previous = $(control).attr('actual'); 1181 var boxcount = $(control).val(); 1182 1183 var delbutton = $(control).closest("tr").find("#del_"+$(control).attr("id")); 1184 1185 var arr=JSON.parse(($(delbutton).attr("rel_odls").replace(/'/g, '"')).replace(",]","]")); 1186 1187 for(var i=0;i<arr.length;i++) 1188 { 1189 var rel_odl_inp_ID=(arr[i].split(","))[0]; 1190 1191 var childval=$("#"+rel_odl_inp_ID).val(); 1192 var quotient=parseInt(childval)/parseInt(previous) 1193 1194 $("#"+rel_odl_inp_ID).val(parseInt(quotient)*parseInt(boxcount)); 1195 1196 } 1197 1198 1199 } 1200 1201 } 1202 //document.getElementsByClassName("qtyinput").addEventListener('keypress', custom_keyup, true); 1203 1204 //document.addEventListener('keydown', custom_keyup, true); 1205 1206 function custom_keyup(e) { 1207 if (e.which == 13) { 1208 if( $(e.target).attr("mix_match")=="1" || $(e.target).attr("loose_tea")=="1") 1209 { 1210 1211 var previous = $(e.target).attr('actual'); 1212 var boxcount = $(e.target).val(); 1213 var delbutton = $(e.target).closest("tr").find("#del_"+$(e.target).attr("id")); 1214 1215 var arr=JSON.parse(($(delbutton).attr("rel_odls").replace(/'/g, '"')).replace(",]","]")); 1216 1217 for(var i=0;i<arr.length;i++) 1218 { 1219 var rel_odl_inp_ID=(arr[i].split(","))[0]; 1220 1221 var childval=$("#"+rel_odl_inp_ID).val(); 1222 var quotient=parseInt(childval)/parseInt(previous) 1223 1224 $("#"+rel_odl_inp_ID).val(parseInt(quotient)*parseInt(boxcount)); 1225 } 1226 1227 1228 } 1229 $('#ordersubmit').submit(); 1230 return false; 1231 } 1232 } 1233 1234 function IncreaseBox(boxqty,boxOlid,relatedOlids){ 1235 $("#WaitLoading").show(); 1236 $.ajax({ 1237 type: "POST", 1238 url: "?CartCmd=IncOrderLine&key="+boxOlid, 1239 success: function(data){ } 1240 }); 1241 DeleteChild(0,relatedOlids,boxqty,"+",boxOlid); 1242 } 1243 function DecreaseBox(boxqty,boxOlid,relatedOlids){ 1244 $("#WaitLoading").show(); 1245 $.ajax({ 1246 type: "POST", 1247 url: "?CartCmd=DecOrderLine&key="+boxOlid, 1248 success: function(data){ } 1249 }); 1250 DeleteChild(0,relatedOlids,boxqty,"-",boxOlid); 1251 } 1252 1253 function DeleteBox(boxqty,boxOlid,relatedOlids){ 1254 $("#WaitLoading").show(); 1255 // alert("Related Products:"+relatedOlids); 1256 $.ajax({ 1257 type: "POST", 1258 url: "?CartCmd=DelOrderLine&key="+boxOlid, 1259 success: function(data){ DeleteChild(0,relatedOlids,boxqty,"delete",boxOlid); } 1260 }); 1261 1262 } 1263 1264 function DeleteChild(i,relatedOlids,boxqty,sign,boxOlid) { 1265 1266 if (i >= relatedOlids.length) { 1267 location.reload(); 1268 } 1269 var info = relatedOlids[i].split(",");//info[0]is id and info[1] is qty 1270 var baseQty = parseInt(info[1])/boxqty; 1271 var cartcmd; 1272 1273 if(sign=="+") 1274 { 1275 cartcmd="?CartCmd=UpdateOrderLines&QuantityOrderLine"+info[0]+"="+ parseInt(parseInt(info[1])+parseInt(baseQty)); 1276 } 1277 else if(sign=="-") 1278 { 1279 cartcmd="?CartCmd=UpdateOrderLines&QuantityOrderLine"+info[0]+"="+ parseInt(parseInt(info[1])-parseInt(baseQty)); 1280 } 1281 else if(sign=="delete") 1282 { 1283 cartcmd="?CartCmd=DelOrderLine&key="+info[0]; 1284 } 1285 1286 $.ajax({ 1287 type: "POST", 1288 url: cartcmd, 1289 success: function(data){ 1290 1291 DeleteRefresh(boxqty,boxOlid,relatedOlids); 1292 1293 } 1294 }); 1295 } 1296 1297 function DeleteRefresh(boxqty,boxOlid,relatedOlids){ 1298 1299 $("#"+boxOlid).val(0); 1300 1301 for(var i=0;i<relatedOlids.length;i++) 1302 { 1303 $("#"+relatedOlids[i]).val(0); 1304 1305 } 1306 $(':disabled').each(function(e) { 1307 $(this).removeAttr('disabled'); 1308 }); 1309 $('#ordersubmit').submit(); 1310 1311 } 1312 1313 function updateCart() { 1314 1315 1316 if($("#AddPersonalMessageChk").prop('checked') == true) 1317 { 1318 1319 1320 if($("#ToPersonalisedMessage").val()=="") 1321 { 1322 1323 $('#global_popup').show(); 1324 $('#c_location').show(); 1325 $('#GPbody').html('@Translate("PopMsg-Personalised Message Request Msg","Please Complete Personalised Message.")'); 1326 return false; 1327 } 1328 1329 if($("#FromPersonalisedMessage").val()=="") 1330 { 1331 1332 $('#global_popup').show(); 1333 $('#c_location').show(); 1334 $('#GPbody').html('@Translate("PopMsg-Personalised Message Request Msg","Please Complete Personalised Message.")'); 1335 return false; 1336 } 1337 } 1338 else 1339 { 1340 1341 $("#AddPersonalMessageChk").prop('checked', false); 1342 $("#ToPersonalisedMessage").val(""); 1343 $("#PersonalisedMessage").val(""); 1344 $("#FromPersonalisedMessage").val(""); 1345 } 1346 1347 1348 1349 return true; 1350 } 1351 function reset() { 1352 var form = document.getElementById('ordersubmit'); 1353 form.reset(); 1354 } 1355 1356 1357 1358 $(document).ready(function(){ 1359 /*$('input[name*=OrderLineFieldValue_]').each(function(){ 1360 if($(this).val() == 'checked'){ 1361 $(this).siblings('.custom-checkbox').find('label').click(); 1362 } 1363 }); 1364 */ 1365 1366 /*if AddPersonalMessage Check, Show PersonalMessage Form*/ 1367 if($("#AddPersonalMessageChk").prop("checked") == true) 1368 { 1369 $('#form_placeholder').show(); 1370 } 1371 /*Back, Show PersonalMessage Form*/ 1372 1373 //if ('@GetString("AddPersonalMessage")'.includes("checked=\"checked\"")) 1374 // { 1375 1376 // $('#AddPersonalMessage').prop('checked', true); 1377 // $('#form_placeholder').show(); 1378 // } 1379 /* Check Reward Expired*/ 1380 if("@GetString("VoucherNumber.Clean")" !="") 1381 { 1382 var uri = "/[email protected]("DeleteRewardOrderDiscountLinePage")&[email protected]("Ecom:Order.ID")&[email protected]&[email protected]("VoucherNumber.Clean")&[email protected]("Ecom:Order.Customer.VoucherCode")"; 1383 console.log(uri); 1384 $.ajax({ 1385 url: uri, 1386 dataType: "json", 1387 type: "get", 1388 success: function (data) { 1389 1390 //console.log('success'); 1391 if (data != null) 1392 { 1393 //console.log('Return Json :'+data[0].DeleteDiscountLine); 1394 if(data[0].DeleteDiscountLine =="true") 1395 { 1396 document.getElementById("VoucherNumber").value = ""; 1397 document.getElementById("EcomOrderVoucherCode").value = ""; 1398 var form = document.getElementById("ordersubmit"); 1399 form.submit(); 1400 } 1401 } 1402 1403 }, 1404 error: function (data) { 1405 //console.log('error'); 1406 } 1407 }); 1408 } 1409 ////////////////////////////////////////////////////// 1410 1411 1412 1413 1414 $('body').on('keydown',function(event){ 1415 /* if(event.keyCode == 13 && event.target.attributes.id.value!="PersonalisedMessage") { 1416 //console.log("enter hit"); 1417 event.preventDefault(); 1418 return false; 1419 } 1420 else */ 1421 if(event.keyCode == 13 && event.target.attributes.id.value=="PersonalisedMessage"){ 1422 $('#PersonalisedMessage').val($('#PersonalisedMessage').val()+'\r\n'); 1423 } 1424 }); 1425 1426 1427 if($('.giftcheck').length==$('.giftcheck:checked').length && !$("#GiftPackaging").is(':checked')){ 1428 $("#GiftPackaging").trigger('click'); 1429 } 1430 else if($('.giftcheck').length!=$('.giftcheck:checked').length && $("#GiftPackaging").is(':checked')){ 1431 $("#GiftPackaging").trigger('click'); 1432 } 1433 if($('.form_placeholder').html()!=""){ 1434 $("#AddPersonalMessage").trigger('click'); 1435 } 1436 if($('.giftcheck').length<=0){ 1437 if($("#GiftPackaging").is(':checked')){ 1438 $("#GiftPackaging").trigger('click'); 1439 } 1440 $("#GiftPackaging").attr('disabled','disabled'); 1441 $("#GiftPackaging").parent().parent().hide(); 1442 } 1443 $('.giftcheck').each(function(){ 1444 if($(this).is(':checked')){ 1445 $(this).closest('.cc_class').find('.giftcus_tomnotchecked').attr("class","giftcus_tomchecked"); 1446 } 1447 }); 1448 }); 1449 1450 1451 /* Gift Packing and Add Personal Message check*/ 1452 function changechecked(item){ 1453 if($(item).attr('id')=='AddPersonalMessageChk'){ 1454 console.log('hi here changechecck'); 1455 if($(item).prop("checked") == true ){ 1456 $("#AddPersonalMessageChk").attr('checked', true); 1457 $('#form_placeholder').show(); 1458 }else if($(item).prop("checked") == false ){ 1459 $('#form_placeholder').hide(); 1460 1461 $("#AddPersonalMessageChk").attr('checked', false); 1462 $("#ToPersonalisedMessage").val(""); 1463 $("#PersonalisedMessage").val(""); 1464 $("#FromPersonalisedMessage").val(""); 1465 } 1466 $("#WaitLoading").show(); 1467 $("#ordersubmit").ajaxSubmit({ 1468 success: function() { $("#WaitLoading").hide();}, 1469 error: function() { $("#WaitLoading").hide();} 1470 }); 1471 } 1472 else{ 1473 if( $(item).prop("checked") == true ){ 1474 $('.giftcheck').each(function(){ 1475 if($(this).prop("checked") == false){ 1476 $(this).prop('checked', true); 1477 $($(this).closest('.Parent_Gift').find('input[type="hidden"]')).val("checked"); 1478 } 1479 }); 1480 } 1481 $('#ordersubmit').ajaxSubmit({ 1482 type: "POST", 1483 url: '/cart', 1484 success: function (data) { }, 1485 error: function (data) { } 1486 }); 1487 1488 } 1489 } 1490 1491 /* Gift Packing and Add Personal Message check*/ 1492 1493 function ShowPopUp(){ 1494 1495 $('#global_popup').show(); 1496 $('#c_location').show(); 1497 $('#GPheader').html(""); 1498 $('#GPbody').html('@Translate("PopMsg-MiniumOrderAmount", "Minimum purchase of S$ 50 is required for every transaction.")'); 1499 1500 $("html, body").animate({ scrollTop: 0 }, "fast"); 1501 return false; 1502 } 1503 1504 1505 /*edit function for loose tea and Mix and match*/ 1506 function editSetOrLoosetea(idtoEdit,OdlId,childIDlist,childOrderLineIDList,parentVariant,boxOrLoose,isMixmatch,EditLooseTeaWeight){ 1507 $("#WaitLoading").show(); 1508 var uri; 1509 1510 if(isMixmatch=="0")//loose tea... so go to loose tea page 1511 { 1512 uri="/[email protected]&ProductID="+idtoEdit+"&boxNo="+boxOrLoose+"&editLooseTeaWeight="+EditLooseTeaWeight; 1513 1514 } 1515 else{ 1516 uri="/[email protected]&ProductID="+idtoEdit+"&boxNo="+boxOrLoose; 1517 1518 } 1519 $('#ordersubmit').attr('action',uri); 1520 $('#childsToEdit').attr('value',childIDlist); 1521 $('#childOrderLineIDList').attr('value',childOrderLineIDList); 1522 $('#parentVariant').attr('value',parentVariant); 1523 $('#mainOdlId').attr('value',OdlId); 1524 $('#uniqueCartitemNo').attr('value',boxOrLoose); 1525 1526 1527 $(':disabled').each(function(e) { 1528 $(this).removeAttr('disabled'); 1529 }); 1530 $('#ordersubmit').submit(); 1531 } 1532 /*edit function for loose tea and Mix and match end here*/ 1533 1534 $('.giftcheck').click(function(){ 1535 if($(this).is(':checked')){ 1536 $($(this).closest('.Parent_Gift').find('input[type="hidden"]')).val("checked"); 1537 } 1538 else{ 1539 $(this).removeAttr("checked"); 1540 $($(this).closest('.Parent_Gift').find('input[type="hidden"]')).val(""); 1541 } 1542 1543 $("#WaitLoading").show(); 1544 $('#ordersubmit').ajaxSubmit({ 1545 type: "POST", 1546 url: '/cart', 1547 success: function (data) {$("#WaitLoading").hide(); }, 1548 error: function (data) {$("#WaitLoading").hide(); } 1549 }); 1550 1551 if($('.giftcheck').length==$('.giftcheck:checked').length && !$("#GiftPackaging").is(':checked')){ 1552 $("#GiftPackaging").trigger('click'); 1553 } 1554 else if($('.giftcheck').length!=$('.giftcheck:checked').length && $("#GiftPackaging").is(':checked')){ 1555 $("#GiftPackaging").trigger('click'); 1556 } 1557 1558 }); 1559 1560 1561 1562 function rewardchange() { 1563 $('#EcomOrderVoucherCodeShow option:first-child').val(""); 1564 //updateCart(); 1565 var voucherCode = ""; 1566 var voucherNumber = ""; 1567 var voucherCodeID = document.getElementById('EcomOrderVoucherCodeShow'); 1568 1569 if (voucherCodeID === null) { 1570 //console.log("Voucher Code ID does not exist"); 1571 1572 } 1573 else { 1574 if (voucherCodeID.value != "") { 1575 voucherCode = voucherCodeID.value.split('|')[1]; 1576 1577 } 1578 else { 1579 document.getElementById("EcomOrderVoucherCode").value = ""; 1580 document.getElementById('VoucherNumber').value = ""; 1581 } 1582 1583 } 1584 1585 if (voucherCode != "") { 1586 1587 if (voucherScriptList.length > 0) { 1588 1589 1590 var validPromocode = "false"; 1591 for (var i = 0; i < voucherScriptList.length; i++) { 1592 1593 1594 1595 1596 if (voucherCode.toUpperCase() == voucherScriptList[i].VoucherNumber) { 1597 voucherNumber = voucherScriptList[i].VoucherNumber; 1598 validPromocode = "true"; 1599 break; 1600 1601 } 1602 } 1603 1604 if (validPromocode == "true") { 1605 //console.log("validPromocode Value :" + validPromocode); 1606 1607 document.getElementById("EcomOrderVoucherCode").value = voucherCodeID.value.split('|')[0].toUpperCase(); 1608 document.getElementById('VoucherNumber').value = voucherNumber; 1609 1610 } 1611 else { 1612 document.getElementById("EcomOrderVoucherCode").value = ""; 1613 1614 document.getElementById('VoucherNumber').value = ""; 1615 } 1616 } 1617 } 1618 1619 1620 var form = document.getElementById('ordersubmit'); 1621 form.submit(); 1622 } 1623 1624 1625 </script> 1626 1627 <!--Event snippet for Cart on https://twgtea.com/Cart: Please do not remove.Place this snippet on pages with events you’re tracking.Creation date: 07/02/2019--> 1628 <script> 1629 var product_name =""; 1630 var product_category = ""; 1631 var product_id=""; 1632 var product_value=""; 1633 @foreach (LoopItem orderline in GetLoop("OrderLines")) 1634 { 1635 if (orderline.GetBoolean("Ecom:Order:OrderLine.IsProduct")) 1636 { 1637 var prod = Dynamicweb.Ecommerce.Products.Product.GetProductById(orderline.GetString("Ecom:Order:OrderLine.ProductID")); 1638 var prodID = orderline.GetString("Ecom:Product.Number");//orderline.GetString("Ecom:Order:OrderLine.ProductID"); 1639 string itemClassification = prod.GetProductFieldValue("ItemClassification").ToString(); 1640 string name = orderline.GetString("Ecom:Order:OrderLine.ProductName"); 1641 string UnitPrice= orderline.GetString("Ecom:Order:OrderLine.UnitPrice").Replace("-","").Replace(GetString("Ecom:Order.Currency.Symbol"),""); 1642 <text> 1643 product_name += "@name ," ; 1644 product_category += "[" + "@itemClassification" + "]," ; 1645 product_id += '@prodID,'; 1646 product_value += '@UnitPrice,'; 1647 </text> 1648 1649 } 1650 } 1651 1652 1653 gtag('event', 'conversion', { 1654 'allow_custom_scripts': true, 1655 'u1': "["+ product_name +"]", 1656 'u2': "["+ product_category +"]", 1657 'u3': "["+ product_id +"]", 1658 'u4': "["+ product_value +"]", 1659 'send_to': '@TrackingID/carto0/cart00+standard' 1660 }); 1661 </script> 1662 <noscript> 1663 <img src="https://ad.doubleclick.net/ddm/activity/[email protected]("DC-","");type=carto0;cat=cart00;u1=[product_name];u2=[product_category];u3=[product_id];u4=[product_value];u5=[country];u6=[city];u7=[loyalty];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;ord=1?" width="1" height="1" alt=""/> 1664 </noscript> 1665 <!-- End of event snippet: Please do not remove -->