Skip to content

Instantly share code, notes, and snippets.

@corpsefilth
Created March 16, 2015 11:49
Show Gist options
  • Select an option

  • Save corpsefilth/090b4048908d8a16b365 to your computer and use it in GitHub Desktop.

Select an option

Save corpsefilth/090b4048908d8a16b365 to your computer and use it in GitHub Desktop.

Revisions

  1. corpsefilth created this gist Mar 16, 2015.
    21 changes: 21 additions & 0 deletions CategoryCustomField.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <?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();
    ?>