2

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.

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;

Thanks for the help.

Jevgeni Geurtsen
  • 3,133
  • 4
  • 17
  • 35

1 Answers1

2

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.

Jevgeni Geurtsen
  • 3,133
  • 4
  • 17
  • 35