Okay so I am trying to add a field to the registration with my module. Obviously I have to add an attribute. So my "install script" is really just an upgrade to the customer entity. However, the module is enabled and yet when I refresh the front end it will not run my install script. I have put a die at the front to see if its even hitting it and its not.
I have checked about 7 other stack overflow questions and each of the errors was pretty blatant. Things like the config not matching the folder it was in. Using customer_setup as the name. Errors in the setup file. Over and over i've looked at my code and i KNOW im missing something small. Some typo somewhere.....but ive wasted too much time now, so I hand it off to you great people.
Config.xml
<config>
<modules>
<BlizzardLabs_Customer>
<version>0.1.0</version>
</BlizzardLabs_Customer>
</modules>
<global>
<fieldsets>
<customer_account>
<flavour>
<create>1</create>
<update>1</update>
</flavour>
</customer_account>
</fieldsets>
<resources>
<blizzardlabs_customer_setup>
<setup>
<module>BlizzardLabs_Customer</module>
<class>BlizzardLabs_Customer_Model_Entity_Setup</class>
</setup>
</blizzardlabs_customer_setup>
</resources>
</global>
</config>
BlizzardLabs/Customer/Model/Entity/Setup.php
class BlizzardLabs_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup {
public function getDefaultEntities() {
$entities = parent::getDefaultEntities();
// Add flavour to customer attributes
$entities['customer']['attributes']['flavour'] = array(
'label' => 'Ice Cream Flavour',
'visible' => true,
'required' => true,
);
return $entities;
}
}
BlizzardLabs/Customer/sql/blizzardlabs_customer_setup/mysql4-install-0.1.0.php
Mage::log('Installing BlizzardLabs_Customer');
$installer = $this;
$installer->startSetup();
$installer->addAttribute('customer', 'flavour', array(
'label' => 'Ice Cream Flavour',
'type' => 'varchar',
'input' => 'text',
'visible' => true,
'required' => true,
'position' => 1,
));
$attrs = array('flavour');
foreach ($attrs as $item) {
$attr = Mage::getSingleton('eav/config')->getAttribute('customer', $item);
$attr->setData('used_in_forms', array('adminhtml_customer','customer_account_edit','customer_account_create'))->save();
}
$installer->endSetup();
echo "information added to database";