I'm trying to add an attribute through a setup script in a module but it's not showing in the admin panel.
Here's what I have:
app/etc/modules/MyCompanyName_UpgradeScripts.xml
<?xml version="1.0"?>
<config>
<modules>
<MyCompanyName_UpgradeScripts>
<active>true</active>
<codePool>local</codePool>
</MyCompanyName_UpgradeScripts>
</modules>
</config>
app/code/local/MyCompanyName/UpgradeScripts/controllers/IndexController.php
<?php
class MyCompanyName_UpgradeScripts_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$this->loadLayout();
$this->renderLayout();
}
}
app/code/local/MyCompanyName/UpgradeScripts/etc/config.xml
<?xml version="1.0"?> <config>
<modules>
<mycompanyname_upgradescripts>
<version>
0.1.0
</version>
</mycompanyname_upgradescripts>
</modules>
<global>
<resources>
<add_category_attribute>
<setup>
<module>MyCompanyName_UpgradeScripts</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
</add_category_attribute>
</resources>
</global>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>MyCompanyName_UpgradeScripts</module>
<frontName>ebayaffload</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
app/code/local/MyCompanyName/UpgradeScripts/add_category_attribute\mysql4-install-0.1.0.php
<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'mycompanyname_upgradescripts_cat', array(
'group' => 'General Information',
'input' => 'text',
'type' => 'text',
'label' => 'Category ID',
'backend' => '',
'visible' => true,
'required' => false,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$this->endSetup();