通过安装脚本进行添加
需要先注册catalog/setup为模块的设置资源,或者直接在设置脚本中实例化他
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
$installer->removeAttribute('catalog_product', 'free_trial');
$installer->addAttribute('catalog_product', 'free_trial', array(
'label' => 'Free Trial',
'type' => 'int',
'input' => 'select',
'source' => 'eav/entity_attribute_source_boolean',
'visible' => true,
'required' => false,
'apply_to' => 'simple,configurable,bundle,grouped',
'group' => 'General',
'position' => 10,
));