如何用Savon gem在Rails 3中调用Magento API过滤商品?
- 内容介绍
- 文章标签
- 相关推荐
本文共计383个文字,预计阅读时间需要2分钟。
我在使用 `this code` 将我的 Rails 应用程序与 Magento API 集成。一切都进行得很好,除了一个问题:我需要通过 Magento API 的参数过滤产品,但不知道如何操作。当然,我已经测试了多种解决方案(如数组、哈希等),但效果都不理想。
我正在使用 this code作为我的rails应用程序与Magento的API.一切都很好,除了一件事,我需要通过Magento API的参数过滤产品,但我不知道如何:(显然我已经测试了更多的解决方案(数组,哈希等),但是
不成功.
钯:对不起,我的英语非常有限
链接
>相关案例(失败):Adding a product using Savon to connect to Magento API
>示例: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" }])
本文共计383个文字,预计阅读时间需要2分钟。
我在使用 `this code` 将我的 Rails 应用程序与 Magento API 集成。一切都进行得很好,除了一个问题:我需要通过 Magento API 的参数过滤产品,但不知道如何操作。当然,我已经测试了多种解决方案(如数组、哈希等),但效果都不理想。
我正在使用 this code作为我的rails应用程序与Magento的API.一切都很好,除了一件事,我需要通过Magento API的参数过滤产品,但我不知道如何:(显然我已经测试了更多的解决方案(数组,哈希等),但是
不成功.
钯:对不起,我的英语非常有限
链接
>相关案例(失败):Adding a product using Savon to connect to Magento API
>示例: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" }])

