chesspiece423 Posted June 10, 2014 Share Posted June 10, 2014 (edited) I'm trying to add the value within the new column of cart_product table When I click the add to cart button... I use this code which adds the product to the cart: ajaxCart.add('sample_id', 'sample_attr', true, null, qty, null, group_id); Which files should I modify to add additional parameter to the function? I tried to modify ajax-cart.js, classes/cart.php, controller/CartController.php.. Which particular line of the files above should I edit? $.ajax({ type: 'POST', headers: { "cache-control": "no-cache" }, url: baseUri + '?rand=' + new Date().getTime(), async: true, cache: false, dataType : "json", data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''), success: function(jsonData,textStatus,jqXHR) The green texts are the values to be passed in the controllers/CartController.php file, right? How can I add the id_group? I've already added id_group to the parameters of "add: " from ajax-cart.js AND 'updateQty( )' from classes/Cart.php files EDIT:I can get the value of id_group... my main problem is that, I can't pass it to controllers/CartController.php file... please help Edited June 11, 2014 by chesspiece423 (see edit history) Link to comment Share on other sites More sharing options...
chesspiece423 Posted June 10, 2014 Author Share Posted June 10, 2014 bump! added more info.. please help Link to comment Share on other sites More sharing options...
chesspiece423 Posted June 11, 2014 Author Share Posted June 11, 2014 (edited) 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): '') + '&id_group=' + id_group, this wont even work.. i've also made a "protected $id_group;" variable in the controllers/CartController.php file Edited June 11, 2014 by chesspiece423 (see edit history) Link to comment Share on other sites More sharing options...
chesspiece423 Posted June 11, 2014 Author Share Posted June 11, 2014 Bump.. still hoping for answers. If no one can help me, at least leave a post like "We can't help you for that"... so that I can stop hoping and already stop looking for this thread. Link to comment Share on other sites More sharing options...
Recommended Posts