I am attempting to load products using the Magento Core API product.create method.
Magento Enterprise 1.10
I am actually having great success with the exception of inserting values for dropdown attributes. It's my understanding that you simply add the attribute code and it's associated value as part of the "Params" array when you call the product.create method. I have set up the attributes as dropdowns so they can be included as filter, and I have added the options or "values" before trying to insert the products via the API. No matter what I do the value is not selected after a successful product upload.
Here are examples of my attempted syntax:
'resolution' => '3000',
'resolution' => 1,
'resolution' => array(1),
'resolution' => array('3000'),
'resolution' => 3000,
Values of YES/NO are accepted for boolean attr开发者_StackOverflowibutes, and I have no problem passing values to regular text fields. Any insight would be greatly appreciated.
Ok - so after much trial and error - it appears that you must enter the Attribute Option ID as the value when passing information to dropdown attributes.
You can use the product_attribute.options method along with the attribute ID to get these IDs - or just check your database.
Soo - if attribute 'test-dropdown' has a dropdown option of 'orange' and that option's ID is '220':
'test-dropdown' => 220,
精彩评论