Magento – Adding a Custom Category Attribute (EAV)

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->startSetup();

$setup->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'show_sale_icon',
    array(
        'backend'           => '',
        'default'           => 0,
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        'group'             => 'General',
        'input'             => 'select',
        'label'             => 'Show Category Sale Icon',
        'position'          => 100,
        'required'          => false,
        'source'            => 'eav/entity_attribute_source_boolean',
        'type'              => 'int',
        'user_defined'      => true,
        'visible'           => true,
        'visible_on_front'  => true,
    )
);

$setup->endSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->startSetup();

$setup->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'additional_description',
    array(
        'backend'                   => '',
        'global'                    => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        'group'                     => 'General',
        'input'                     => 'textarea',
        'is_html_allowed_on_front'  => true,
        'is_wysiwyg_enabled'        => true,
        'label'                     => 'Additional Description',
        'position'                  => 100,
        'required'                  => false,
        'type'                      => 'text',
        'user_defined'              => true,
        'visible'                   => true,
        'visible_on_front'          => true,
    )
);

$setup->endSetup();