Magento API 版本不兼容

发布于 2024-11-03 03:31:11 字数 777 浏览 1 评论 0原文

我正在使用 Magento 的核心 API 创建目录产品。它在 Magento 版本 1.4.1.1 上运行良好,但相同的代码在 Magento 版本 1.5.0.1 上不起作用。

这是我的代码:

require 'rubygems'
require 'soap/wsdlDriver'

WSDL_URL = 'http://example.code/api/v2_soap/?wsdl=1'


soap = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver

session = soap.login('theuser','theuser123')

data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3] }

a1 = soap.call('catalogProductCreate',session,"simple",1,"black: ONT-920-B",data)

我的代码有什么问题,或者 Magento 1.5.0.1 版本中添加了任何新内容吗?

谢谢

I am creating catalog products using Magento's core API. It works fine on Magento version 1.4.1.1, but the same code doesn't work on Magento ver 1.5.0.1.

Here's my code:

require 'rubygems'
require 'soap/wsdlDriver'

WSDL_URL = 'http://example.code/api/v2_soap/?wsdl=1'


soap = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver

session = soap.login('theuser','theuser123')

data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3] }

a1 = soap.call('catalogProductCreate',session,"simple",1,"black: ONT-920-B",data)

Is there any problem with my code, or any new things added to Magento version 1.5.0.1?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2024-11-10 03:31:11

问题是日期字段中缺少一个属性

data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3],  "websites" => [1] }

需要提及 magento 1.5 中数据数组中的网站 id。

这对我有用!

The problem is missing one attribute in date field

data = { "name" => "BARRACUDA", "description" => "fill", "short_description" => "fill", "weight" => "12", "status" => 1, "visibility" => 4, "price" => 350.00 , "tax_class_id" => "2", "qty" => 10, "stock_availability" => "0", "category_ids" => [3],  "websites" => [1] }

Need to mention the websites id in the array of data in magento 1.5.

This is works for me!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文