static attribute not handled by csv importer
-
30-10-2019 - |
Question
I created a static product attribute with corresponding source model:
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn(
$installer->getTable('catalog/product'), 'my_attribute', array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'comment' => 'Delivery Point ID'
)
);
$installer->getConnection()->addIndex(
$installer->getTable('catalog/product'),
$installer->getConnection()->getIndexName(
$installer->getTable('catalog/product'), array('my_attribute',)
),
array('my_attribute')
);
$installer->endSetup();
$installer->addAttribute(
Mage_Catalog_Model_Product::ENTITY,
'my_attribute',
array(
'group' => 'General',
'sort_order' => 20,
'type' => 'static',
'label' => 'My Attribute',
'input' => 'select',
'source' => 'my_module/entity_attribute_source_mysource',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => true,
'user_defined' => false,
'visible_on_front' => true,
'unique' => false,
'is_configurable' => false,
'used_in_product_listing' => true,
)
);
From the admin panel everything works fine, but when I use the csv import, no data is written to the column my_attribute
in catalog_product_entity
table.
Here is the csv:
sku,_store,_type,_attribute_set,name,description,short_description,my_attribute,status,visibility,weight,price,tax_class_id,_product_websites
test,,simple,Default,Test,Test,Test,"My Value",1,4,0,0,0,base
The source model gives the correct values, otherwise the validation of the csv file would fail.
Is this case supported by the Mage_ImportExport module at all?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange