update confirm box
This commit is contained in:
@@ -153,10 +153,9 @@ $("#redeem").click(function(){
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
swal ( "Oops" , "Please type valid amount!" , "warning" );
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
swal ( "Oops" , "Insufficient Amount!" , "warning" );
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @redeem_prices %>"){
|
||||
$.ajax({
|
||||
@@ -165,14 +164,20 @@ $("#redeem").click(function(){
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
});
|
||||
|
||||
}else{
|
||||
alert(result.message);
|
||||
swal ( "Information" , result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
swal ( "Oops" , "Redeem Amount is over!" , "warning" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user