I have a non-Eav table. And I want to create a custom product attribute with select options whose values will be coming from the above non-eav table column. What will be the code for the sql script.
Assume the column name is brand.
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('catalog_product', 'brand', array(
'group' => 'General Information',
'input' => 'select',
'type' => 'varchar',
'label' => 'Brand',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE ,
));
Best Answer
Use below code: