iamjefjef23
Forum Guru
- Joined
- May 20, 2016
- Posts
- 4,698
- Reaction
- 3,039
- Points
- 1,381
if('<?= $available > 0 ?>' == 1){
start_loader()
$.ajax({
url:base_url+"classes/Master.php?f=save_to_cart",
method:'POST',
data:{product_id: '<?= isset($id) ? $id : "" ?>',quantity:1},
dataType:'json',
error:err=>{
console.error(err)
alert_toast("An error occured","error")
end_loader();
},
success:function(resp){
if(resp.status =='success'){
update_cart_count(resp.cart_count);
alert_toast("Product has been added to cart.",'success')
}else if(!!resp.msg){
alert_toast(resp.msg,'error')
}else{
alert_toast("An error occured","error")
}
end_loader();
}
})
}
anong idadag ko mga idol para pag 0 yung $available is mag aalert sya na "No Stock Available"
start_loader()
$.ajax({
url:base_url+"classes/Master.php?f=save_to_cart",
method:'POST',
data:{product_id: '<?= isset($id) ? $id : "" ?>',quantity:1},
dataType:'json',
error:err=>{
console.error(err)
alert_toast("An error occured","error")
end_loader();
},
success:function(resp){
if(resp.status =='success'){
update_cart_count(resp.cart_count);
alert_toast("Product has been added to cart.",'success')
}else if(!!resp.msg){
alert_toast(resp.msg,'error')
}else{
alert_toast("An error occured","error")
}
end_loader();
}
})
}
anong idadag ko mga idol para pag 0 yung $available is mag aalert sya na "No Stock Available"