pawelo Posted June 12, 2015 Share Posted June 12, 2015 Hi, is it possible to create a link which add product to cart and automatically redirect user to order page? I want to use that link in other web page, and after user click on it, he should landing in shop order page with product already added into cart. Link to comment Share on other sites More sharing options...
pishkus Posted June 13, 2015 Share Posted June 13, 2015 (edited) I'm afraid it's not possible to achieve what you are looking for without custom development. For not logged in customers there is possibility to use a direct link to add to cart with a url like this: YOUR_SITE/index.php?controller=cart&add&id_product=10&qty=1 For logged in customers there must be a token parameter in the url YOUR_SITE/index.php?controller=cart&add&id_product=10&qty=1&token=8522548b65fc6d65485e47efa300698c Token is generated depending on customer id and password. See file classes/Tools.php, function getToken. And another limitation is that add to cart only works if there is already a prestashop cookie created for a visitor, as the code comments say. to prevent bots from creating carts. See file controllers/front/CartController.php. So for the first time visitors, coming from the direct add to cart url, the product would not be added to the cart. Anyway, please make your own tests and see how it goes. Edited June 13, 2015 by pishkus (see edit history) Link to comment Share on other sites More sharing options...
buco Posted October 15, 2015 Share Posted October 15, 2015 Hello, i have this excellent module: https://www.prestashop.com/forums/topic/263899-free-module-link-to-add-products/ I don´t know if it´s that you need. 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