ruby-on-rails-3 - 使用 Savon gem (SOAP) 在 Ruby on Rails 中使用 API Magento 过滤产品

标签 ruby-on-rails-3 magento savon

我正在使用 this code使用 Magento 的 API 为我的 Rails 应用程序。除了一件事,一切都很好,我需要通过 Magento API 的参数过滤产品,但我不知道如何:(

显然我已经测试了更多的解决方案(数组、散列等),但是 不成功。

Pd:对不起,我的英文很有限

链接

最佳答案

我知道这已经很晚了,但是如果其他人找到了这个线程,我已经创建了一个 magento_api_wrapper gem,它为 Magento SOAP API v2 实现了过滤器。您可以在此处找到代码:https://github.com/harrisjb/magento_api_wrapper

总而言之,如果您想使用一种 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" }])

关于ruby-on-rails-3 - 使用 Savon gem (SOAP) 在 Ruby on Rails 中使用 API Magento 过滤产品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8049732/

相关文章:

sql - 根据计数更新

php - 以编程方式创建 magento 订单中的 Paypal 发布错误

magento - CSS 文件的顺序。在主题的 CSS 之前加载模块的 CSS

mysql - 缺乏 SQL 经验 - 访问冲突

ruby /萨翁 : Having trouble with namespace for a soap request

Ruby Savon Gem 更改日志记录配置

ruby-on-rails - 在 Rails 中使用 unicorn、nginx 和 capistrano 设置虚拟主机

ruby-on-rails-3 - 让 select2 与事件管理员一起工作

ruby - 我如何使用 savon 嵌套属性!哈希?

ruby-on-rails-3 - Rails 3.1rc4 defaults.js 未找到