Magento的SOAP API V2 - 附加属性设置为空 [英] Magento SOAP V2 API - Additional attributes sets empty

查看:296
本文介绍了Magento的SOAP API V2 - 附加属性设置为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关的几个小时我一直在试图创建通过SOAP API V2带有附加属性的产品。每当我打电话的 catalogProductCreate 的产品将被加入,但我请求发送额外的属性被设置为空。每当我不添加额外的属性这两个属性都在它们的默认设置,所以我想通了属性正在发送和接收但未正确处理?我尝试了一切,我GOOGLE了,但来到了空。

For a few hours now I've been trying to create a product via the SOAP V2 API with additional attributes. The product is being added whenever I call catalogProductCreate but the additional attributes I send with the request are set empty. Whenever I don't add the additional attributes both attributes are set on their default, so I've figured that the attributes are being send and received but not processed properly? I've tried everything, I've Googled but came up empty.

这是我的code:(C#)

This is my code: (C#)

  catalogProductCreateEntity cpce = new catalogProductCreateEntity();
  associativeEntity[] attributes = new associativeEntity[2];
  attributes[0] = new associativeEntity();
  attributes[0].key = "product_state1";
  attributes[0].value = _stateofbox;

  attributes[1] = new associativeEntity();
  attributes[1].key = "product_state2";
  attributes[1].value = _stateofproduct;

  catalogProductAdditionalAttributesEntity additionalAttributes = new catalogProductAdditionalAttributesEntity();
  additionalAttributes.single_data = attributes;
  cpce.additional_attributes = additionalAttributes;

感谢您的帮助。

推荐答案

固定它,我想我必须设置里面的pre定义属性的明文/ ID(0,1,2,3)的 associativeEntity 的值。虽然,我发现的 catalogProductAttributeOptions 的会告诉你什么ID你的价值观有。因此,你必须调用该方法,以便找出ID的,你应该使用什么。

Fixed it, I thought I had to set the plaintext/ID (0,1,2,3) of the pre-defined attributes inside the value of associativeEntity. Although, I found out that catalogProductAttributeOptions will tell you what ID your values have. Thus you have to call that method in order to find out what ID's you should use.

这篇关于Magento的SOAP API V2 - 附加属性设置为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆