installer Mage getResourceModel catalog setup catalog_setup installer-

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
$installer->addAttribute('catalog_product', 'returns', array(
'label' => 'Returns',
'type' => 'int',
'input' => 'select',
//'backend' => 'eav/entity_attribute_backend_array',
'frontend' => '',
'source' => 'eav/entity_attribute_source_table',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'is_configurable' => false,
'visible' => true,
'required' => true,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => false,
'option' => array (
'values' => array(
'none' => 'Not Returnable',
'7-days' => '7 Days',
'14-days' => '14 Days',
'30-days' => '30 Days',
)
),
'visible_on_front' => true,
'visible_in_advanced_search' => false,
'unique' => false
));