Magento API v2和C#-在添加产品时设置自定义属性

Magento API v2和C#-在添加产品时设置自定义属性,c#,api,magento,soap,C#,Api,Magento,Soap,我添加了自定义属性,代码为“my_price”,将“商店所有者的目录输入类型”设置为“price”,并将其分配给“Default”(仅限)属性集 现在,我想设置它的值,每次我用APIv2(C#)添加/更新产品时。以下是不起作用的代码(未设置值): 我做错了什么?试试这个,告诉我结果 AdditionalAttributes.key = "myPrice"; Magento 1.6.1.0有一个错误,导致附加属性错误 我已经将我的Magento升级到1.6.2.0,问题消失了,其他属性工作得很好

我添加了自定义属性,代码为“my_price”,将“商店所有者的目录输入类型”设置为“price”,并将其分配给“Default”(仅限)属性集

现在,我想设置它的值,每次我用APIv2(C#)添加/更新产品时。以下是不起作用的代码(未设置值):


我做错了什么?

试试这个,告诉我结果

AdditionalAttributes.key = "myPrice";

Magento 1.6.1.0有一个错误,导致附加属性错误

我已经将我的Magento升级到1.6.2.0,问题消失了,其他属性工作得很好

其工作原理的快速示例:

associativeEntity[] AdditionalAttributes = new associativeEntity[1];
associativeEntity AdditionalAttribute = new associativeEntity();
AdditionalAttribute.key = "myprice";
AdditionalAttribute.value = getOriginalPrice(prices).ToString();
AdditionalAttributes[0] = AdditionalAttribute;
catalogProductAdditionalAttributesEntity AdditionalAttributesEntity = new catalogProductAdditionalAttributesEntity();
AdditionalAttributesEntity.single_data = AdditionalAttributes;

mageProduct.additional_attributes = AdditionalAttributesEntity;
希望它能帮助别人

handler.catalogProductCreate(session_id, "simple", attributeset_id, sku, mageProduct, "default");
提供有效的storeview,而不是默认值,例如,尝试以下操作:

handler.catalogProductCreate(session_id, "simple", attributeset_id, sku, mageProduct, "1");

我的价格而不是我的价格怎么样?你试过了吗?我也有同样的问题,你解决了吗。我的CatalogProduct实体从未传递任何数据,仍然什么都没有。。。我是否需要刷新服务参考?我真的不想这样做,因为存在某种错误,Visual Studio无法正确生成所需的代码。@Spyro我会给您一个旧链接,但我确信您可以帮助获取和设置产品属性。这是另一个链接
handler.catalogProductCreate(session_id, "simple", attributeset_id, sku, mageProduct, "1");