【发布时间】:2014-05-18 18:40:40
【问题描述】:
几个小时以来,我一直在尝试通过带有附加属性的 SOAP V2 API 创建产品。每当我调用 catalogProductCreate 时都会添加产品,但我随请求发送的附加属性设置为空。每当我不添加其他属性时,这两个属性都设置为默认值,所以我认为这些属性正在发送和接收但未正确处理?我已经尝试了所有方法,我在 Google 上搜索过,但都是空的。
这是我的代码:(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;
感谢您的帮助。
【问题讨论】:
标签: c# api magento attributes