Jump to content

Adding value to the new column of cart_product table


Recommended Posts

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

post-787487-0-54895700-1402398411_thumb.png

post-787487-0-77990600-1402398415_thumb.png

Edited by chesspiece423 (see edit history)
Link to comment
Share on other sites

'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 by chesspiece423 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...