2014-09-22 87 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); 

}