Simple code (as example ÃÂ¾Ãâ¡ÃÂµÃÂ½ÃÅ ÃÂ¿Ãâ¬ÃÂ¾ÃÂÃâÃÂ¾ÃÂ¹ ÃÂºÃÂ¾ÃÂ´ (only as an example of implementation and not a guide as it should be):
In the template in the begin of success.phtml we add a code:
<?php $this->sendOrder(); ?>
in Mage_Checkout_Block_Onepage_Success we add the method itself:
public function sendOrder()
$remote_serv_url = \'http://www.myremoteserver.com/order_registration_controller/?orderinfo=\'; //url of remote server with controller
$param = json_encode(Mage::getModel(\'sales/order\')->getCollection()->addFieldToFilter(\'increment_id\', $this->getOrderId())->getLastItem()->getData());
//^^^^^^^^collecting of data for recieve
$url = $remote_serv_url . $param;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$success = curl_exec($ch); //recieving of success from remote server
Yes, in case of a big quatntity (really very big quantity) of orders it may be increased the load on the server. In this case it is possible to send data about orders via Cron (the accumulation of a number of them over time and sending all at once with one request). It may slightly reduce the load on the server.
For a very large flow of orders (for very large stores) the best variant of transfering data of the orders is through the API.
The presented implementation is the most simple and in original the question was how to organize data transfer directly after placing the order