| Line 202... |
Line 202... |
| 202 |
if(!$('div.cartitemstotal').hasClass('hidden')){
|
202 |
if(!$('div.cartitemstotal').hasClass('hidden')){
|
| 203 |
$('div.scroll').attr('style', 'margin-bottom: 176px');
|
203 |
$('div.scroll').attr('style', 'margin-bottom: 176px');
|
| 204 |
}else{
|
204 |
}else{
|
| 205 |
$('div.scroll').attr('style', 'margin-bottom: 100px');
|
205 |
$('div.scroll').attr('style', 'margin-bottom: 100px');
|
| 206 |
}
|
206 |
}
|
| 207 |
|
207 |
/*
|
| 208 |
var currentShippingCharges = $('div.cartitemstotal span.shippingval').text().split(" ");
|
208 |
var currentShippingCharges = $('div.cartitemstotal span.shippingval').text().split(" ");
|
| 209 |
currentShippingCharges = parseInt(currentShippingCharges[1]);
|
209 |
currentShippingCharges = parseInt(currentShippingCharges[1]);
|
| 210 |
var currentItemTotal = $('div.cartitemstotal span.itemstotal').text().split(" ");
|
210 |
var currentItemTotal = $('div.cartitemstotal span.itemstotal').text().split(" ");
|
| 211 |
currentItemTotal = currentItemTotal[1].toString();
|
211 |
currentItemTotal = currentItemTotal[1].toString();
|
| 212 |
currentItemTotal = currentItemTotal.split(',').join("");
|
212 |
currentItemTotal = currentItemTotal.split(',').join("");
|
| Line 215... |
Line 215... |
| 215 |
if(currentItemTotal>0){
|
215 |
if(currentItemTotal>0){
|
| 216 |
var additionalAmount = 1000.0-currentItemTotal;
|
216 |
var additionalAmount = 1000.0-currentItemTotal;
|
| 217 |
additionalAmount = additionalAmount.toFixed();
|
217 |
additionalAmount = additionalAmount.toFixed();
|
| 218 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
218 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
| 219 |
$('span.cartheader').text('');
|
219 |
$('span.cartheader').text('');
|
| 220 |
$("<a class='addMoreItems' href='/category/6'><u>Add more items worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
220 |
$("<a class='addMoreItems' href='/categories/linkdeal/3?filtertype=exclusive'><u>Add more items worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
| 221 |
}else{
|
221 |
}else{
|
| 222 |
$('span.cartheader').text('');
|
222 |
$('span.cartheader').text('');
|
| 223 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
223 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
| 224 |
$('span.cartheader').text('Cart Details');
|
224 |
$('span.cartheader').text('Cart Details');
|
| 225 |
}
|
225 |
}
|
| 226 |
}else{
|
226 |
}else{
|
| 227 |
$('span.cartheader').text('');
|
227 |
$('span.cartheader').text('');
|
| 228 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
228 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
| 229 |
$('span.cartheader').text('Cart Details');
|
229 |
$('span.cartheader').text('Cart Details');
|
| 230 |
}
|
230 |
}*/
|
| 231 |
|
231 |
|
| 232 |
}
|
232 |
}
|
| 233 |
|
233 |
|
| 234 |
$(function(){
|
234 |
$(function(){
|
| 235 |
loadCartPageDetails();
|
235 |
loadCartPageDetails();
|
| Line 404... |
Line 404... |
| 404 |
itemDetail['productname']=prodname;
|
404 |
itemDetail['productname']=prodname;
|
| 405 |
itemDetail['brand']=brandname;
|
405 |
itemDetail['brand']=brandname;
|
| 406 |
itemDetail['catalogItemId'] = catalogItemId.toString();
|
406 |
itemDetail['catalogItemId'] = catalogItemId.toString();
|
| 407 |
cartItems[sku.toString()]=itemDetail;
|
407 |
cartItems[sku.toString()]=itemDetail;
|
| 408 |
jsonObjToBeStored['cartItems']=cartItems;
|
408 |
jsonObjToBeStored['cartItems']=cartItems;
|
| 409 |
if(parseInt(totalCartValue)>1000){
|
409 |
if(parseInt(totalCartQuantity)>=5){
|
| 410 |
shippingCharges = 0;
|
- |
|
| 411 |
}else if(parseInt(totalCartValue)>=500 && parseInt(totalCartValue)<500){
|
- |
|
| 412 |
shippingCharges = 50;
|
410 |
shippingCharges = 30*totalCartQuantity;
|
| 413 |
}else{
|
411 |
}else {
|
| 414 |
shippingCharges = 100;
|
412 |
shippingCharges = 60*totalCartQuantity;
|
| 415 |
}
|
413 |
}
|
| 416 |
$.each( cartItems, function(itemId,value){
|
414 |
$.each( cartItems, function(itemId,value){
|
| 417 |
if(value['quantity']>0){
|
415 |
if(value['quantity']>0){
|
| 418 |
totalSkus = totalSkus +1;
|
416 |
totalSkus = totalSkus +1;
|
| 419 |
}
|
417 |
}
|
| Line 450... |
Line 448... |
| 450 |
}
|
448 |
}
|
| 451 |
});
|
449 |
});
|
| 452 |
cartDetailsObj.totalCartValue = totalCartValue;
|
450 |
cartDetailsObj.totalCartValue = totalCartValue;
|
| 453 |
cartDetailsObj.cartItems = cartItems;
|
451 |
cartDetailsObj.cartItems = cartItems;
|
| 454 |
cartDetailsObj.totalSkus = totalSkus;
|
452 |
cartDetailsObj.totalSkus = totalSkus;
|
| 455 |
if(parseInt(totalCartValue)>1000){
|
453 |
if(parseInt(totalCartQuantity)>=5){
|
| 456 |
shippingCharges = 0;
|
- |
|
| 457 |
}else if(parseInt(totalCartValue)>=500 && parseInt(totalCartValue)<1000){
|
- |
|
| 458 |
shippingCharges = 50;
|
- |
|
| 459 |
}else if(parseInt(totalCartValue)>0 && parseInt(totalCartValue)<500){
|
- |
|
| 460 |
shippingCharges = 100;
|
454 |
shippingCharges = 30*totalCartQuantity;
|
| 461 |
}else{
|
455 |
}else {
|
| 462 |
shippingCharges = 0;
|
456 |
shippingCharges = 60*totalCartQuantity;
|
| 463 |
}
|
457 |
}
|
| 464 |
cartDetailsObj.shippingCharges = shippingCharges;
|
458 |
cartDetailsObj.shippingCharges = shippingCharges;
|
| 465 |
localStorage.setItem('cart_details',JSON.stringify(cartDetailsObj));
|
459 |
localStorage.setItem('cart_details',JSON.stringify(cartDetailsObj));
|
| 466 |
}
|
460 |
}
|
| 467 |
$('div.cartitemstotal span.itemstotal').text('₹ '+numberWithCommas(totalCartValue));
|
461 |
$('div.cartitemstotal span.itemstotal').text('₹ '+numberWithCommas(totalCartValue));
|
| Line 472... |
Line 466... |
| 472 |
$('.cartitemstotal').removeClass('hidden');
|
466 |
$('.cartitemstotal').removeClass('hidden');
|
| 473 |
var additionalAmount = 1000.0-totalCartValue;
|
467 |
var additionalAmount = 1000.0-totalCartValue;
|
| 474 |
additionalAmount = additionalAmount.toFixed();
|
468 |
additionalAmount = additionalAmount.toFixed();
|
| 475 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
469 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
| 476 |
$('span.cartheader').text('');
|
470 |
$('span.cartheader').text('');
|
| 477 |
$("<a class='addMoreItems' href='/category/6'><u>Add Items Worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
471 |
$("<a class='addMoreItems' href='/categories/linkdeal/3?filtertype=exclusive'><u>Add Items Worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
| 478 |
payable = parseInt(shippingCharges)+parseInt(totalCartValue);
|
472 |
payable = parseInt(shippingCharges)+parseInt(totalCartValue);
|
| 479 |
}else{
|
473 |
}else{
|
| 480 |
payable = 0;
|
474 |
payable = 0;
|
| 481 |
$('span.cartheader').text('');
|
475 |
$('span.cartheader').text('');
|
| 482 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
476 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
| Line 515... |
Line 509... |
| 515 |
shippingCharges = cartDetailsObj.shippingCharges;
|
509 |
shippingCharges = cartDetailsObj.shippingCharges;
|
| 516 |
}
|
510 |
}
|
| 517 |
|
511 |
|
| 518 |
if(shippingCharges>0){
|
512 |
if(shippingCharges>0){
|
| 519 |
var totalCartValue = cartDetailsObj.totalCartValue;
|
513 |
var totalCartValue = cartDetailsObj.totalCartValue;
|
| - |
|
514 |
cartDetailsObj.totalCartQuantity
|
| 520 |
var additionalAmount = 1000.0-totalCartValue;
|
515 |
var additionalAmount = 1000.0-totalCartValue;
|
| 521 |
additionalAmount = additionalAmount.toFixed();
|
516 |
additionalAmount = additionalAmount.toFixed();
|
| 522 |
window.history.pushState('forward', null, './?user_id='+me);
|
517 |
window.history.pushState('forward', null, './?user_id='+me);
|
| 523 |
$('p#shippingText').html("<span>You are paying ₹ "+ shippingCharges.toFixed()
|
518 |
if(shippingCharges/cartDetailsObj.totalCartQuantity>50){
|
| - |
|
519 |
$('p#shippingText').html("<span>You are paying ₹60 per item for shipping.<br>To pay ₹30 per item for shipping.<br> Add upto five items.</span><hr style='margin-top: 5px;margin-bottom: 5px;'>"
|
| 524 |
+" for shipping.<br> Free Shipping above ₹ 1000.<br> Add More Items.</span><hr style='margin-top: 5px;margin-bottom: 5px;'>"
|
520 |
+"<span>आप शिपिंग के लिए ₹60 प्रति आइटम का भुगतान कर रहे हैं। <br> प्रति आइटम शिपिंग ₹30 के लिए। <br> पाँच आइटम तक जोड़ें।</span>");
|
| - |
|
521 |
} else {
|
| - |
|
522 |
$('p#shippingText').html("<span>You are paying ₹ "+ shippingCharges.toFixed()
|
| - |
|
523 |
+" for shipping.<br>"
|
| 525 |
+"<span>आप शिपिंग के लिए ₹ "+ shippingCharges.toFixed()
|
524 |
+"<span>आप शिपिंग के लिए ₹ "+ shippingCharges.toFixed()
|
| 526 |
+" का भुगतान कर रहे हैं। <br> ₹ 1000 से ऊपर मुफ्त शिपिंग। <br> और आइटम जोड़ें।</span>");
|
525 |
+" का भुगतान कर रहे हैं।")
|
| - |
|
526 |
$("#addItems").find("strong").html("Cancel<br>(रद्द करें)");
|
| - |
|
527 |
}
|
| 527 |
$('#myModal').modal('show');
|
528 |
$('#myModal').modal('show');
|
| 528 |
}else{
|
529 |
}else{
|
| 529 |
$('#cartLoadingModal').modal('show');
|
530 |
$('#cartLoadingModal').modal('show');
|
| 530 |
var url = apihost + 'shippings/';
|
531 |
var url = apihost + 'shippings/';
|
| 531 |
var newForm = $('<form>', {
|
532 |
var newForm = $('<form>', {
|
| Line 542... |
Line 543... |
| 542 |
|
543 |
|
| 543 |
$(document).on('click','button#addItems',function(){
|
544 |
$(document).on('click','button#addItems',function(){
|
| 544 |
$('#myModal').modal('hide');
|
545 |
$('#myModal').modal('hide');
|
| 545 |
$("#cartloader").removeClass('hidden');
|
546 |
$("#cartloader").removeClass('hidden');
|
| 546 |
history.addItem="yes";
|
547 |
history.addItem="yes";
|
| 547 |
setTimeout(function () {history.back();}, 5000);
|
548 |
setTimeout(function () {history.back();}, 2000);
|
| 548 |
});
|
549 |
});
|
| 549 |
|
550 |
|
| 550 |
$(document).on('click','button#continueCheckout',function(){
|
551 |
$(document).on('click','button#continueCheckout',function(){
|
| 551 |
$('#myModal').modal('hide');
|
552 |
$('#myModal').modal('hide');
|
| 552 |
$("#cartloader").removeClass('hidden');
|
553 |
$("#cartloader").removeClass('hidden');
|
| Line 558... |
Line 559... |
| 558 |
'name': 'cart_details',
|
559 |
'name': 'cart_details',
|
| 559 |
'value': localStorage.getItem('cart_details'),
|
560 |
'value': localStorage.getItem('cart_details'),
|
| 560 |
'type': 'hidden'
|
561 |
'type': 'hidden'
|
| 561 |
}));
|
562 |
}));
|
| 562 |
history.form=newForm;
|
563 |
history.form=newForm;
|
| 563 |
setTimeout(function () {history.back();}, 5000);
|
564 |
setTimeout(function () {history.back();}, 2000);
|
| 564 |
});
|
565 |
});
|
| 565 |
|
566 |
|
| 566 |
$(document).on('click','.changepincode',function(){
|
567 |
$(document).on('click','.changepincode',function(){
|
| 567 |
$('#cartLoadingModal').modal('show');
|
568 |
$('#cartLoadingModal').modal('show');
|
| 568 |
var pincode = "pin_"+$('.pincodeval').val();
|
569 |
var pincode = "pin_"+$('.pincodeval').val();
|
| Line 589... |
Line 590... |
| 589 |
$(document).on('click','.checkoutbtn',function(){
|
590 |
$(document).on('click','.checkoutbtn',function(){
|
| 590 |
handleCheckout();
|
591 |
handleCheckout();
|
| 591 |
});
|
592 |
});
|
| 592 |
$(document).on('click','.backtodeals',function(){
|
593 |
$(document).on('click','.backtodeals',function(){
|
| 593 |
$('#cartLoadingModal').modal('show');
|
594 |
$('#cartLoadingModal').modal('show');
|
| 594 |
window.location.href = apihost + 'category/6';
|
595 |
window.location.href = apihost + 'categories/linkdeal/3?filtertype=exclusive';
|
| 595 |
});
|
596 |
});
|
| 596 |
|
597 |
|
| 597 |
$(document).on('click','span.clearCart',function(){
|
598 |
$(document).on('click','span.clearCart',function(){
|
| 598 |
$("#cartloader").removeClass('hidden');
|
599 |
$("#cartloader").removeClass('hidden');
|
| 599 |
$('#clearCartModel').modal('show');
|
600 |
$('#clearCartModel').modal('show');
|
| Line 686... |
Line 687... |
| 686 |
$('.cartitemstotal').removeClass('hidden');
|
687 |
$('.cartitemstotal').removeClass('hidden');
|
| 687 |
var additionalAmount = 1000.0-totalCartValue;
|
688 |
var additionalAmount = 1000.0-totalCartValue;
|
| 688 |
additionalAmount = additionalAmount.toFixed();
|
689 |
additionalAmount = additionalAmount.toFixed();
|
| 689 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
690 |
$('span.cartheader').attr('style', 'font-size: 8pt;padding-left: 18px;');
|
| 690 |
$('span.cartheader').text('');
|
691 |
$('span.cartheader').text('');
|
| 691 |
$("<a class='addMoreItems' href='/category/6'><u>Add Items Worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
692 |
$("<a class='addMoreItems' href='/categories/linkdeal/3?filtertype=exclusive'><u>Add Items Worth <span style='color:#ff0000;'>₹ "+additionalAmount+"</span> for Free Shipping</u></a>").appendTo('span.cartheader');
|
| 692 |
payable = parseInt(shippingCharges)+parseInt(totalCartValue);
|
693 |
payable = parseInt(shippingCharges)+parseInt(totalCartValue);
|
| 693 |
}else{
|
694 |
}else{
|
| 694 |
payable = 0;
|
695 |
payable = 0;
|
| 695 |
$('span.cartheader').text('');
|
696 |
$('span.cartheader').text('');
|
| 696 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|
697 |
$('span.cartheader').attr('style', 'font-size: 12pt;padding-left: 30px;');
|