A-Z Hosting Posted October 22, 2010 Share Posted October 22, 2010 I have a custom service wizard that used to run under good old phpshop. I'm trying to do a rewrite so that it will work with prestashop. In a nutshell the wizard does a step by step. After step one I need it to inject a product into the cart along with a customization option. Then after step two it will inject anywhere from 1-20 smaller products that coincide with the first product. It then collects some information, stores it, and sends them on to checkout.Questions simplified: What queries should I use to add a product the cart? How can I update the id_cart value in $cart and $cookie once I've assigned the cart an id number?The latter is the one I'm having the most issues figuring out. Working with the cart tables seems easy enough but until I can get that id_cart stored it isn't going to show me the additions I made to the cart.It would be nice if prestashop had some basic ssi libraries that can be used externally. Hey a guy can wish. Link to comment Share on other sites More sharing options...
A-Z Hosting Posted October 22, 2010 Author Share Posted October 22, 2010 Solution: The queries are easy enough to figure out and now that I have a way to establish the $cart->id before injecting the product I can see the queries work just fine. Low and behold it shows up in the blockcart on the next step screen. Here is the trick to establishing id_guest and id_cart. Slap in at the top of your own script and you're in business. if (!$_SESSION[sinfo][id_guest] || !$_SESSION[sinfo][id_cart]) { ?> <iframe src="/yourprestapath/cart.php?token=<? echo Tools::getToken(); ?>&id_product=1&add=1&id;_product_attribute=&qty=1&Submit=Add+to+cart" height="1" width="1" frameborder="0"> </iframe> <? } Checks to see if it has been done already and whether the results are in my session. If either the guest id or cart id are blank it invisibly sends a shout out to the cart. Note on what product to shout out to... use one that requires a customization so that it doesn't actually add it to the cart on this first pass. Happy trails... now back to finish up my new toy. Link to comment Share on other sites More sharing options...
andyr73 Posted February 19, 2011 Share Posted February 19, 2011 i could so with a hand with this one as i have a custom pc designer that i want to implement into prestashop but everytime i submit my order i get invalid tokeni have all the files i need from my customer but i can't seem to get it to work. Link to comment Share on other sites More sharing options...
meryy84 Posted March 31, 2020 Share Posted March 31, 2020 Good moning everyone, I'm try to inject prestashop order parameter and add to cart buttom by an iframe on our website (Link "encuesta de satisfaccion on right side" on https://callejondelpozo.es/prueba) but it doesn't work. I try enable iframes and other solution but it doesn't apply: Could you help me? thanks! 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