Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save redesigned/5805459 to your computer and use it in GitHub Desktop.
Save redesigned/5805459 to your computer and use it in GitHub Desktop.
Magento Create Category Attribute
// ## Note: If not in a module sql setup use the following 2 lines
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
// ## Note: Setup the new category attribute
$installer = new Mage_Sales_Model_Mysql4_Setup;
$installer->startSetup();
$installer->addAttribute('catalog_category', 'additional_css', array(
'type' => 'text',
'backend' => '',
'frontend' => '',
'label' => 'Custom CSS',
'input' => 'textarea',
'class' => '',
'source' => '',
'global' => false,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => false,
'filterable' => true,
'comparable' => false,
'visible_on_front' => false,
'unique' => false,
'wysiwyg' => true,
'position' => 0,
'group' => 'Display Settings',
));
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment