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";
Update: I apologize for the typo. the script IS in blizzardlabs_customer_setup
code_resource table:
+-------------------------------------+---------+
| code | version |
+-------------------------------------+---------+
| adminnotification_setup | 1.0.0 |
| admin_setup | 0.7.1 |
| amazonpayments_setup | 0.1.2 |
| api_setup | 0.8.1 |
| backup_setup | 0.7.0 |
| bundle_setup | 0.1.8 |
| catalogindex_setup | 0.7.10 |
| cataloginventory_setup | 0.7.5 |
| catalogrule_setup | 0.7.7 |
| catalogsearch_setup | 0.7.6 |
| catalog_setup | 0.7.69 |
| checkout_setup | 0.9.3 |
| chronopay_setup | 0.1.0 |
| cms_setup | 0.7.8 |
| compiler_setup | 0.1.0 |
| contacts_setup | 0.8.0 |
| core_setup | 0.8.13 |
| cron_setup | 0.7.1 |
| customer_setup | 0.8.11 |
| cybermut_setup | 0.1.0 |
| cybersource_setup | 0.7.0 |
| dataflow_setup | 0.7.4 |
| directory_setup | 0.8.5 |
| downloadable_setup | 0.1.15 |
| eav_setup | 0.7.13 |
| enterprise_admingws_setup | 0.0.1 |
| enterprise_catalogevent_setup | 0.0.4 |
| enterprise_catalogpermissions_setup | 0.0.6 |
| enterprise_customerbalance_setup | 0.0.10 |
| enterprise_enterprise_setup | 0.0.1 |
| enterprise_giftcardaccount_setup | 0.0.12 |
| enterprise_giftcard_setup | 0.0.8 |
| enterprise_invitation_setup | 0.0.3 |
| enterprise_logging_setup | 0.1.8 |
| enterprise_pci_setup | 0.0.3 |
| enterprise_staging_setup | 0.1.10 |
| enterprise_websiterestriction_setup | 0.0.1 |
| eway_setup | 0.1.0 |
| flo2cash_setup | 0.1.1 |
| giftmessage_setup | 0.7.2 |
| googleanalytics_setup | 0.1.0 |
| googlebase_setup | 0.1.1 |
| googlecheckout_setup | 0.7.3 |
| googleoptimizer_setup | 0.1.2 |
| ideal_setup | 0.1.0 |
| log_setup | 0.7.6 |
| newsletter_setup | 0.8.0 |
| oscommerce_setup | 0.8.10 |
| paybox_setup | 0.1.3 |
| paygate_setup | 0.7.0 |
| payment_setup | 0.7.0 |
| paypaluk_setup | 0.7.0 |
| paypal_setup | 0.7.2 |
| poll_setup | 0.7.2 |
| productalert_setup | 0.7.2 |
| protx_setup | 0.1.0 |
| rating_setup | 0.7.2 |
| reports_setup | 0.7.7 |
| review_setup | 0.7.4 |
| salesrule_setup | 0.7.7 |
| sales_setup | 0.9.38 |
| sendfriend_setup | 0.7.2 |
| shipping_setup | 0.7.0 |
| sitemap_setup | 0.7.2 |
| strikeiron_setup | 0.9.1 |
| tag_setup | 0.7.2 |
| tax_setup | 0.7.8 |
| usa_setup | 0.7.0 |
| weee_setup | 0.13 |
| wishlist_setup | 0.7.4 |
+-------------------------------------+---------+
<blizzardlabs_customer_setup> </blizzardlabs_customer_setup>
Needed to be:<blizzardlabscustomer_setup> </blizzardlabscustomer_setup>
I am not sure if this is a magento version issue or something old but you can't have any underscores before _setup. Thanks!