Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在magento api V1中检索客户订单_Php_Magento_Soap - Fatal编程技术网

Php 如何在magento api V1中检索客户订单

Php 如何在magento api V1中检索客户订单,php,magento,soap,Php,Magento,Soap,我使用的是MagentoAPIv1。我想检索特定的客户订单。我正在使用order.list方法。在这个方法中,我的过滤器不工作。它给我完整的订单列表。我不知道我错在哪里了。这是我的密码 $client = new SoapClient('http://magentohost/api/soap/?wsdl'); $session = $client->login('apiUser', 'apiKey'); $filter = array('filter' => array(arra

我使用的是MagentoAPIv1。我想检索特定的客户订单。我正在使用
order.list
方法。在这个方法中,我的过滤器不工作。它给我完整的订单列表。我不知道我错在哪里了。这是我的密码

$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);

最后我找到了一种检索客户订单的方法

$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);

}