我正试图通过api电话获取客户名单&我收到了客户详细信息列表,但返回了与客户相关的所有属性,但我只想要检索 customer name,employee_id,email
。在magento api wiki中,我发现customer.list接受两组参数(array filters & filter list
)有人可以告诉我区别b / w我尝试使用下面的代码只检索customer_id,email& firstname但var_dump();
显示所有客户信息我如何只检索我想要的属性?
提前谢谢。
<?php
$proxy = new SoapClient('http://www.localhost/magento/index.php/api/soap/?wsdl');
$sessionId = $proxy->login('test', '123456');
// Get new customer info
$filters=array('employee_id'=>array('eq'=>'234567'));
$filter_list=array('customer_id','email','firstname');
$results= $proxy->call($sessionId, 'customer.list',array($filters),array($filter_list));
var_dump($results);
?>
答案 0 :(得分:0)
过滤器仅用于检索与这些特定属性匹配的客户记录。
您有几种选择:
添加自定义端点
基本上你必须创建一个扩展核心api的新模块,并不难做到以下指南详细介绍
http://www.magentocommerce.com/wiki/doc/webservices-api/custom-api