You need to create file with your desired name (ex: categoryroot.php) in magento root & hit one time and remove them after hit.

Mage::app()->setCurrentStore(Mage::getModel(‘core/store’)->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;

$attribute  = array(
‘type’ => ‘text’,
‘label’=> ‘Call to Action’,
‘input’ => ‘select’,
‘global’ => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
‘visible’ => true,
‘required’ => false,
‘user_defined’ => true,
‘default’ => “”,
‘option’ => array(
‘value’ => array(‘optionone’=> array( 0 =>’Get Product Listing’),’optiontwo’=> array(0 =>’Get Subcategory Listing’) )
),
‘group’ => “General Information”
);

$installer->addAttribute(‘catalog_category’, ‘call_to_action’, $attribute);
$installer->endSetup();

Read how to get custom category attribute values: http://www.webetutorial.com/question/magento-how-to-get-custom-category-attribute-values/

 

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.