Create a Magento API product with drop-down attributes

I am trying to download products using the Magento Core API product.create method.

Magento Enterprise 1.10

I have really great success, with the exception of inserting values ​​for the attributes of the drop-down list. I understand that you simply add the attribute code and its associated value as part of the "Params" array when you call the product.create method. I set the attributes as drop-down menus so that they can be included as a filter, and I added parameters or β€œvalues” before trying to insert products through the API. No matter what I do, the value will not be selected after a successful product download.

Here are examples of my syntax:

'resolution' => '3000', 'resolution' => 1, 'resolution' => array(1), 'resolution' => array('3000'), 'resolution' => 3000, 

YES / NO values ​​are accepted for boolean attributes, and I have no problem passing values ​​to regular text fields. Any insight would be appreciated.

+4
source share
1 answer

So, after much trial and error - it seems that you should enter the attribute parameter identifier as a value when transferring information to the attributes of the drop-down list.

You can use the product_attribute.options method along with the attribute identifier to get these identifiers - or just check your database.

Su - if the attribute "test lunge" has a drop-down list of "orange", and this option identifier is "220":

'test-dropdown' => 220,

+5
source

All Articles