![]() |
XCart to send response back to external site
Hello all,
I am fairly new to using x-cart (v. 5) and have not done any logic/customization changes. I am adding products from an external site to the XCart solution via URL; I have successfully been able to do this, but I need some additional functionality. 1- Be able to add multiple products/qty in single URL POST method; I have a workaround that I send multiple POSTS in a delayed loop - or - 2- if (1) is not possible, I want the XCart software to send me a response back that the adding a product was successful; then I can send the next request. Sending successive requests at one time has not worked (only 1 request is added to the user's cart) 3- When a user completes and pays for an order, I want to send a URL POST/GET method FROM XCart back to my third party software so I can do some additional processing/return to the external site I really just need someone to point me in the right direction of what classes to decorate/modify... That would be most helpful! Thanks, Marty Esterman Founder, Fluency Games |
Re: XCart to send response back to external site
You should look into \XLite\Controller\Customer\Cart::doActionAdd() and add a similar method from your module by decorating that class.
If your products have no options, the logic will be pretty simple. But with options it may become a tricky one - see the getCurrentItem() and prepareOrderItem() methods. |
Re: XCart to send response back to external site
Thanks!
Any ideas on how to do #3? |
Re: XCart to send response back to external site
You can use the \XLite\Core\HTTP\Request class to send background HTTP/HTTPS requests.
Please check the source code for examples of use. Or you can add an IMG or SCRIPT tag to the "thank you" page and link it to the third-party software. |
Re: XCart to send response back to external site
Thanks, I will look into that...
Marty Esterman Fluency Games |
All times are GMT -8. The time now is 03:37 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.