Welcome Guest, Not a member yet? Register   Sign In
cart codeigniter
#3

(05-08-2016, 12:36 PM)albertleao Wrote: Dude! Modularize your code! It's close to impossible to follow what is going on Smile


dear albertleao

here is the main code for increase and decrease the quantity, but its not working..

function minquantity(rowid){
var minquan = parseInt($('#txtquantity_' + rowid).val()) - 1;
if(minquan > 0) {
//alert(quan);
$.ajax({
type: "POST",
url: "<?php echo base_url();?>ajax",
data: { action: "product_model.update_cart", row_id: rowid, new_qty: minquan}
}).done(function( msg ) {
var total = parseInt(msg);
if(total > 0){
$('#cart_count').html(total);
$('#txtquantity_'+rowid).val(minquan);
}
});

}
}

function plusquantity(rowid){
var plusquan = parseInt($('#txtquantity_' + rowid).val()) + 1;
//alert(quan);
$.ajax({
type: "POST",
url: "<?php echo base_url();?>ajax",
data: { action: "product_model.update_cart", row_id: rowid, new_qty: plusquan}
}).done(function( msg ) {
var total = parseInt(msg);
if(total > 0){
$('#cart_count').html(total);
$('#txtquantity_' + rowid).val(plusquan);
}
});
}
udin_ordinary
Reply


Messages In This Thread
cart codeigniter - by udin_ordinary - 05-08-2016, 08:00 AM
RE: cart codeigniter - by albertleao - 05-08-2016, 12:36 PM
RE: cart codeigniter - by udin_ordinary - 05-09-2016, 06:55 AM
RE: cart codeigniter - by kirasiris - 01-27-2018, 05:33 PM
RE: cart codeigniter - by InsiteFX - 01-28-2018, 05:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB