I added a custom attribute with the code "my_price" with "Directory entry type for the store owner" set to "Price" and assigned it to the "Default" attribute (only).
Now I want to set its value, every time I add / update a product with API v2 (C #). Here is the code that does not work (value not set):
// Connect & Auth: Mage_Api_Model_Server_V2_HandlerPortTypeClient handler = new Mage_Api_Model_Server_V2_HandlerPortTypeClient(); session_id = handler.login(username, api_key); // Getting attributes set: catalogProductAttributeSetEntity[] attributeSets; attributeSets = handler.catalogProductAttributeSetList(session_id); attributeSet = attributeSets[0]; string attributeset_id = attributeSet.set_id.ToString(); // Adding product: catalogProductCreateEntity mageProduct = new catalogProductCreateEntity(); // (...) setting product name, sku, etc. associativeEntity AdditionalAttributes = new associativeEntity(); AdditionalAttributes.key = "my_price"; AdditionalAttributes.value = "12,33"; associativeEntity[] AssociativeEntity = new associativeEntity[1]; AssociativeEntity[0] = AdditionalAttributes; mageProduct.additional_attributes = AssociativeEntity; handler.catalogProductCreate(session_id, "simple", attributeset_id, sku, mageProduct, "default");
What am I doing wrong?
source share