在magento SOAP API中对客户和产品详细信息进行排序


Sort Customer and Product details in magento SOAP API

是否有任何预定义的函数/方法使用magento SOAP API来获取排序列表/数据中的客户,产品等详细信息?我想排序客户的电子邮件,姓氏,名字或其他细节使用Magento SOAP API的详细信息。

你应该签到

app/code/core/Mage/Customer/Model/Customer/Api.php

有一个名为items()的函数,它将帮助您检索包含客户信息的表。

您可以通过调用:'customer.list'并将所需的过滤器作为参数数组传递来使用它

这可以帮助你…

$collection = Mage::getModel("xxx")->getCollection()
            ->addAttributeToSelect('*')
             ->addAttributeToSort('last_name', 'ASC');
if(isset($_REQUEST['field_name']))
    {
       $collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
       $collection->setOrder($_REQUEST['field_name'],'ASC');
       $collection->load();
       $data=$collection->toArray();
}

我使用上面的代码,它的工作。我们可以将任何东西,如姓,名,电子邮件等放在field_name的位置,它将根据它缩短。