Skip to content

Instantly share code, notes, and snippets.

@corpsefilth
Created March 16, 2015 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corpsefilth/090b4048908d8a16b365 to your computer and use it in GitHub Desktop.
Save corpsefilth/090b4048908d8a16b365 to your computer and use it in GitHub Desktop.
Quick hack, make sure to run only once, paste at header of theme file. Adds custom field to category. Magento.
<?php
require_once('app/Mage.php');
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'=> 'Custom Title',
'input' => 'textarea',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
'default' => "",
'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'custom_title', $attribute);
$installer->endSetup();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment