Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails MagentoAPI:从类别中获取产品_Ruby On Rails_Ruby_Magento_Ruby On Rails 3.1 - Fatal编程技术网

Ruby on rails MagentoAPI:从类别中获取产品

Ruby on rails MagentoAPI:从类别中获取产品,ruby-on-rails,ruby,magento,ruby-on-rails-3.1,Ruby On Rails,Ruby,Magento,Ruby On Rails 3.1,嗨,我在任何地方都找不到如何在MagentoAPI中按类别id获取产品列表。我正在使用RubyXMLRPC库。当我调用product.list时,我得到了我所有的产品,每个产品都是这样的: {"product_id"=>"165", "sku"=>"mycomputer", "name"=>"My Computer", "set"=>"39", "type"=>"bundle", "category_ids"=>["27"]}, {"product_id

嗨,我在任何地方都找不到如何在MagentoAPI中按类别id获取产品列表。我正在使用RubyXMLRPC库。当我调用product.list时,我得到了我所有的产品,每个产品都是这样的:

{"product_id"=>"165", "sku"=>"mycomputer", 
"name"=>"My Computer", "set"=>"39", 
"type"=>"bundle", "category_ids"=>["27"]}, 
{"product_id"=>"166", "sku"=>"HTC Touch Diamond", "name"=>"HTC Touch Diamond", 
"set"=>"38", "type"=>"simple", "category_ids"=>["8"]}
client.call('call',session\u id,'product.list')
为我提供了每一种产品。 我尝试了
client.call('call',session_id,'product.list',[:name=>{:like=>“%%computer”}])
为我提供了名称包含计算机的产品。 我试过了

client.call('call',session_id,'product.list',[:category_ids=>{:include=>"8"}])
client.call('call',session_id,'product.list',[:category_ids=>"8"])
client.call('call',session_id,'product.list',[:category_ids=>["8"]])
所有这些都失败了。我甚至试着用“类别id”替换“类别id”

此外,以下行也不起作用。我做错了什么

client.call('call',session_id,'product.info',[:product_id=>xxx])
MagentoAPI和RubyXMLRPC API都不能告诉我正确的语法应该是什么。有人有其他建议吗?

您需要使用API方法

从文件中:

检索指定产品的列表

返回:数组

论据:

int$categoryId-类别ID混合$store-store ID或代码

别名:

类别.指定产品


谢谢我认为你是对的。您是否也知道如何正确使用id调用product.info?