ilario Posted April 28, 2016 Share Posted April 28, 2016 I have a popup window with an product, I would like to add this item to your cart with a button how can I do? thanks Ilario Link to comment Share on other sites More sharing options...
ilario Posted April 30, 2016 Author Share Posted April 30, 2016 I found this code and it works fine, function Aggiungi_Carrello(){ $.ajax({ type: 'POST', headers: { "cache-control": "no-cache" }, url: dir_base_path, async: true, cache: false, dataType: 'json', //( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): '') data: 'controller=cart&add=1&qty=1&id_product=' + id_prodotto + '&token=' + static_token, success: function(jsonData) { } }); } but now I have to refresh to carthow can I do? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2016 Share Posted May 2, 2016 you have to share more details especially about module that you use it doesnt look like standard prestashop features so it is hard to say what to do Link to comment Share on other sites More sharing options...
ilario Posted May 3, 2016 Author Share Posted May 3, 2016 I thank you for the answerI'm finishing a module, when a customer chooses an attribute in a product, opens a popup window and populate another product related to the first, the customer will have to buy I found the function ajaxCart.add .... and it works great, it added to the product and update the cart function Aggiungi_al_Carrello(){ ajaxCart.add( id_prodotto, null, true, null, '1', null); $('.layer_prod_desc_overlay').hide(); $('#layer_prod_desc').fadeOut('fast'); } you know if there is a search function in the shopping cart?I need first to see if there is already the same product added ciao Ilario Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now