开发者

Magento: get order id to use in outside application

I want to set up an affiliate program for an online store that uses Magento for e-commerce. How could I save the order id of a sale to be used to update my affiliate table?

Please do not recommend 'Affiliates for a开发者_如何转开发ll'. It is about as inflexible as Magento, and the reason that I am going with a custom made solution. Any help is appreciated.


When developing external applications for Magento I usually reach for the Magento API. This would minimize the amount of work you have to do on the Magento side of things (which from my experience can be frustrating at times). You can focus more on your application and less on the data you need from Magento.

To answer your question more directly, you need to use the order API calls.

Example (To get list of orders):

$proxy = new SoapClient('http://www.YOURDOMAIN.com/magento_root/api/soap/?wsdl');
$sessionId = $proxy->login('Username', 'password');

$filters = array();

$orders = $proxy->call($sessionId, 'sales_order.list', array($filters));
var_dump($orders);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜