| Line 456... |
Line 456... |
| 456 |
var creditLimit = parseInt(localStorage.getItem('creditLimit'));
|
456 |
var creditLimit = parseInt(localStorage.getItem('creditLimit'));
|
| 457 |
var cart_details = localStorage.getItem('cart_details');
|
457 |
var cart_details = localStorage.getItem('cart_details');
|
| 458 |
var totalPayable = parseInt(localStorage.getItem('totalPayable'));
|
458 |
var totalPayable = parseInt(localStorage.getItem('totalPayable'));
|
| 459 |
|
459 |
|
| 460 |
var creditAvailable = $(this).attr('credit_available');
|
460 |
var creditAvailable = $(this).attr('credit_available');
|
| - |
|
461 |
localStorage.setItem('CreditError',$('span#CreditError').text());
|
| 461 |
if(creditAvailable=='false'){
|
462 |
if(creditAvailable=='false'){
|
| 462 |
$('button.confirmcredit').prop( "disabled", true );
|
463 |
$('button.confirmcredit').prop( "disabled", true );
|
| 463 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
464 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
| 464 |
var errorSpanText = $('span#CreditError').text();
|
- |
|
| 465 |
localStorage.setItem('CreditError',errorSpanText);
|
- |
|
| 466 |
$('span#CreditError').text('');
|
465 |
$('span#CreditError').text('');
|
| 467 |
}else{
|
466 |
}else{
|
| 468 |
var errorSpanText = localStorage.getItem('CreditError');
|
467 |
var errorSpanText = localStorage.getItem('CreditError');
|
| 469 |
if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
|
468 |
if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
|
| 470 |
$('button.confirmcredit').prop( "disabled", true );
|
469 |
$('button.confirmcredit').prop( "disabled", true );
|
| 471 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
470 |
$('button.confirmcredit').attr('style', 'background-color: #B4CAB4;');
|
| 472 |
$('span#CreditError').text(errorSpanText);
|
471 |
$('span#CreditError').text(errorSpanText);
|
| 473 |
localStorage.removeItem('CreditError');
|
- |
|
| 474 |
}else{
|
472 |
}else{
|
| 475 |
$('button.confirmcredit').prop( "disabled", false );
|
473 |
$('button.confirmcredit').prop( "disabled", false );
|
| 476 |
$('button.confirmcredit').attr('style', 'background-color: #5cb85c;color: #fff');
|
474 |
$('button.confirmcredit').attr('style', 'background-color: #5cb85c;color: #fff');
|
| 477 |
localStorage.removeItem('CreditError');
|
- |
|
| 478 |
}
|
475 |
}
|
| 479 |
}
|
476 |
}
|
| 480 |
});
|
477 |
});
|
| 481 |
|
478 |
|
| 482 |
$(document).on('click','#showmore',function(){
|
479 |
$(document).on('click','#showmore',function(){
|