我正在使用 this code作为我的rails应用程序与Magento的API.一切都很好,除了一件事,我需要通过Magento API的参数过滤产品,但我不知道如何:( 显然我已经测试了更多的解决方案(数组,哈希等),但
显然我已经测试了更多的解决方案(数组,哈希等),但是
不成功.
钯:对不起,我的英语非常有限
链接
>相关案例(失败):Adding a product using Savon to connect to Magento API
>示例:http://www.polyvision.org/2011/10/02/using-magento-soap-api-with-ruby-and-savon.html
总而言之,如果要使用其中一个Magento SOAP API简单过滤器,则可以传递带有键和值的哈希:
api = MagentoApiWrapper::Catalog.new(magento_url: "yourmagentostore.com/index.php", magento_username: "soap_api_username", magento_api_key: "userkey123") api.product_list(simple_filters: [{key: "status", value: "processing"}, {key: created_at, value: "12/10/2013 12:00" }])
要使用复杂的过滤器,请使用键,运算符和值传递散列:
api.product_list(complex_filters: [{key: "status", operator: "eq", value: ["processing", "completed"]}, {key: created_at, operator: "from", value: "12/10/2013" }])