I am writing a Magento extension that will export orders to a 3rd party upon cart submission.
I did an equivalent plugin for WordPress a few months ago. The way I did it was that everytime a user would submit an order, I would create a single WordPress cron job (wp_schedule_single_event
) so that there was no delay for the user (and that the export job would run in the background due to the way WP-Cron
works).
Now, this worked great, and I would like to do something similar with Magento. Magento does have a CRON, but it doesn't seem to have a way of scheduling single events. I was thinking of doing the following:
- When an order is submitted, write this order number into a table.
- Create a request to a php file that I have created which handles querying the above mentioned table and exporting the orders.
My questions are:
- How do I send a request to a php file through PHP that basically kicks off the page load, but doesn't wait for a response?
- Are there any flaws in my process that I am missing?