2014-09-22 88 views
0

我正在使用magento API V1。我想检索特定的客户订单。我正在使用order.list方法。在这种方法中,我的过滤器不工作,它给我完整的订单。我不知道我错在哪里。这里是我的代码如何在magento API中检索客户订单V1

$client = new SoapClient('http://magentohost/api/soap/?wsdl'); 

$session = $client->login('apiUser', 'apiKey'); 

$filter = array('filter' => array(array('key=' => 'customer_id', 'value' => 210))); 

$result = $client->call($session, 'order.list',$filter); 
var_dump ($result); 

回答

0

最后,我有一个方法来检索客户的订单

$client = new SoapClient('http://magentohost/api/soap/?wsdl'); 

$session = $client->login('apiUser', 'apiKey'); 
$customer_id = 210; 

$result = $client->call($session, 'order.list'); 

if($result) 
{  
foreach($result as $val) 
{ 
    if($customer_id==$val['customer_id']) 
    { 
    $res[] = $val; 
    } 

var_dump ($res); 

}