Reputation: 96
I'm running into a problem with importing product attribute values that has custom source model (so no visible options in attribute edit page). Simply it's not working with option ID value or option label neither.
When I was trying to export product with this attribute, there has been an error
Invalid option ID specified for ceneo_category_id (2278), skipping the record. (Line 1, SKU: ...)
Can someone help me with this?
Upvotes: 1
Views: 1214
Reputation: 11
I think I've just experienced the same problem:
After some debugging this seems to be because: - Mage_ImportExport_Model_Import_Entity_Abstract#isAttributeValid(..) reports the attribute value is invalid (the case 'multiselect' line). - this is because it is checking the value from the csv file (alphanumeric code) and finding it wasn't in the list of valid options for this attribute. This is because its list of valid options contained the label. - The reason the list of options contains the label and not the value/code is because in Mage_ImportExport_Model_Import_Entity_Abstract#getAttributeOptions(..) it decides to use the label because the attribute isn't in an array of attributes that values should be used for. This array is declared in Mage_ImportExport_Model_Import_Entity_Abstract:
protected $_indexValueAttributes = array(
'status',
'tax_class_id',
'visibility',
'enable_googlecheckout',
'gift_message_available',
'custom_design'
);
So, the answer is to use in the csv file the label for the attribute. Or to overwrite Mage_ImportExport_Model_Import_Entity_Abstract to get your attribute into the array of attributes for which the value and not the label is expected during product imports.
Upvotes: 1