Reputation: 5010
I've an e-commerce website powered by Magento but now I need to make the connection bewteen Magento and the company's management software.
The process should be this:
My problem is that I've no idea how to send a request from Magento with the order data after the checkout process. I think this is a common scenario for companies that uses e-commerce. Do you have some ideas for this? Thanks.
Upvotes: 0
Views: 1825
Reputation: 2790
You can use a observer to get the after checkout event, and on your observer you can send some kind of curl post to your external server. (Like @Prasath Albert said)
Take a look there to make a observer: http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method
You are looking for checkout_cart_save_after. Good lucky, let me know if you need something else.
Edit:
Use this tutorial to do your Observer http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method make 100% like this. Create new module to do it.
Then your observer method can be something like that:
function observermethod($observer){
$observer->getEvent->getOrder()->getData();
}
Upvotes: 2
Reputation: 1457
you can use the CURL to achieve this. for this
1) Add a page in the external server for handling the inputs from the magento.
2) Edit the Magento Cart functionality, to send a request to the External server.
Ex: you can use the CURL to make this request.
$data = "item=".$item;//input data
$url="http://External server/handler.php";
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_exec($handle);
Upvotes: 1