I'm writing an installation script in an extension that adds some new attributes. I'm using the following. I'm following and old tutorial (http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/), but it's no longer up-to-date because Mage_Eav_Model_Entity_Setup::addAttribute
does not include any of the "Frontend Properties" mapping, denoted by // X
. Is it possible to set these properties with addAttribute()
? If not, how should I go about installing a new attribute with frontend properties?
$setup->addAttribute('catalog_product', 'testatt', array(
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'input' => 'select',
'type' => 'int',
'backend' => '', // backend_model
'frontend' => '', // fronted_model
'label' => 'ATT NAME HERE',
'class' => '', ,
'user_defined' => true,
'required' => false,
// Frontend Properties start here
'visible' => true, // X
'filterable' => true, // X
);
On EE 1.13.
Update: See benmarks' answer!