开发者

3 Questions about Magento XML RPC API

开发者 https://www.devze.com 2023-03-02 13:08 出处:网络
API: Is it possible to filter sale orders by full customer name? I need to do this instead of against first/last name

API:

  1. Is it possible to filter sale orders by full customer name? I need to do this instead of against first/last name
  2. Is it possible to get store name/ID pairs via the API?
  3. Is it possible to filter order开发者_如何学Cs by shipping_country?


1) Looking over: http://svn.magentocommerce.com/source/branches/1.5/app/code/core/Mage/Sales/Model/Order/Api/V2.php

public function items($filters = null)
{
    //TODO: add full name logic

However the logic does seem to be present:

        ->addExpressionFieldToSelect(
                'billing_name',
                "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
                array('billing_firstname'=>"$billingAliasName.firstname", 'billing_lastname'=>"$billingAliasName.lastname")
        )
        ->addExpressionFieldToSelect(
                'shipping_name',
                'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
                array('shipping_firstname'=>"$shippingAliasName.firstname", 'shipping_lastname'=>"$shippingAliasName.lastname")
        );

2) From my understanding the short answer is no. However there is a get/set currentStore for Categories and Products but I don't think it will give you the pairs you're looking for.

http://svn.magentocommerce.com/source/branches/1.2-trunk/app/code/core/Mage/Catalog/Model/Api/Resource.php

3) You SHOULD be able to use addFieldToFilter but I think the country list may be an integer. Optional filters you might want to use - more available operations in method _getConditionSql in Varien_Data_Collection_Db.

http://www.yireo.com/tutorials/magento/magento-programming/631-connecting-to-magento-with-soap-part-3

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消