【问题标题】:Sort Customer and Product details in magento SOAP API在 magento SOAP API 中对客户和产品详细信息进行排序
【发布时间】:2013-09-13 17:55:06
【问题描述】:

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

【问题讨论】:

    标签: php api magento sorting soap


    【解决方案1】:

    你应该签到

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

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

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

    【讨论】:

      【解决方案2】:

      这可以帮助你..

      $collection = Mage::getModel("xxx")->getCollection()
                  ->addAttributeToSelect('*')
                   ->addAttributeToSort('last_name', 'ASC');
      

      【讨论】:

      • 我正在使用以下代码,但它不起作用。 $collection = Mage::getModel("customer/customer")->getCollection()->addAttributeToSelect('*') ->addAttributeToSort('lastname', 'ASC');
      • addAttributeToSort('last_name', 'ASC') 应该是 last_name 而不是 lastname
      【解决方案3】:
      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,它会根据它来缩短。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-13
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多