joseluistim Posted January 9, 2014 Share Posted January 9, 2014 Hello. I want to develop a routine for adding products to cart programatically, each product has different combinations. How can I add the correct product and combination. Each combination has different reference, EAN and UPC value. Any help? Thanks. Link to comment Share on other sites More sharing options...
NemoPS Posted January 10, 2014 Share Posted January 10, 2014 Do you want to create a buton in the product list page? Or somewhere else? How is the user capable of selecting a combination for each product, on this page? Link to comment Share on other sites More sharing options...
joseluistim Posted January 10, 2014 Author Share Posted January 10, 2014 Hello Nemo1. In product page I want to integrate a module with diferent customization options. According to selections, programatically I will know correct product combination and I want to add it to cart. Link to comment Share on other sites More sharing options...
NemoPS Posted January 10, 2014 Share Posted January 10, 2014 But in that case can't you simply use combinations? Prestashop already has this features (attributes and values) Link to comment Share on other sites More sharing options...
joseluistim Posted January 11, 2014 Author Share Posted January 11, 2014 Yes, I know, and thats it..but I want to know how programaticaly in jquery or php can I add a product combination to cart. Thanks. Link to comment Share on other sites More sharing options...
NemoPS Posted January 11, 2014 Share Posted January 11, 2014 Oh, the code? This is the js code, containing variables used in ajax-cart for the ajax request of adding a product 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): ''), Link to comment Share on other sites More sharing options...
joseluistim Posted January 11, 2014 Author Share Posted January 11, 2014 Thanks...I will try it. Link to comment Share on other sites More sharing options...
mauricioarango Posted April 1, 2014 Share Posted April 1, 2014 Hi, I was looking info on this topic and came across this post. Could you provide an example on how to use this: 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): ''), What would be the full query like? And what are the 'answers' this query would generate? THANK you so much for any help. 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