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