andries Posted May 21, 2010 Share Posted May 21, 2010 HiI am really new to prestashop. We are developping a webshop where it is possible to create a custom product using Flash. Everything works fine, except one thing: adding it to the cart. I am able to add items to the cart, but they don't appear in the front end. In the backoffice I can see that he creates a new cart each time we save the product.The goal is of course to add this product to the current cart. At the moment I call the cart.php script with curl, and send the following parameters: token, id_product, add, quantity_wanted.I have the feeling I am missing some or many parameters (for example the current customer ID, current cart ID, ...) but I don't know where to find the correct values for this. Which method allows me to grab those IDs? And which parameters are obligatory to add correctly an item to a cart?Thanks in advance! AndriesSolution:the call from curl is an "outside" call and simply doesn't work. you have to use the Ajax call, or include the cart.php script. Link to comment Share on other sites More sharing options...
andries Posted May 21, 2010 Author Share Posted May 21, 2010 OKI actually think curl is the bitch.He calls from outside... does anyone can please help me in showing how I can call the cart.php script automatically, and sending the necessary post variables with it?thanks in advance ! Link to comment Share on other sites More sharing options...
tomerg3 Posted May 22, 2010 Share Posted May 22, 2010 Why not call the javascript command that adds to the cart? you can find the function in /modules/blockcart/ajax-cart.js Link to comment Share on other sites More sharing options...
andries Posted May 23, 2010 Author Share Posted May 23, 2010 Thanks for your reply.In the end I modified the cart.php script, so I could include it, and only used the parameters I was sending...I know this is not completely the right way to do it, but I really know nothing about JavaScript, so that was a direction I didn't want to take.Anyway got it working now ! Link to comment Share on other sites More sharing options...
rocky Posted May 24, 2010 Share Posted May 24, 2010 Please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
A-Z Hosting Posted October 22, 2010 Share Posted October 22, 2010 Thanks for your reply.In the end I modified the cart.php script, so I could include it, and only used the parameters I was sending...I know this is not completely the right way to do it, but I really know nothing about JavaScript, so that was a direction I didn't want to take.Anyway got it working now ! Any chance you can post your solution for others trying to inject products into the cart? 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