I have created one custom module for product attribute.I am getting this error.Can anybody tell why is this error coming?? below i have given all the files that are required.I am not getting the error please can some one help me out with this .. My code id as follows config.xml
<?xml version="1.0"?>
<config>
<modules>
<AdminModules_Brandattr>
<version>1.0.0</version>
</AdminModules_Brandattr>
</modules>
<global>
<models>
<brandattr>
<class>AdminModule_Brandattr_Model</class>
</brandattr>
</models>
<resources>
<brandattr_setup>
<setup>
<module>AdminModules_Brandattr</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</brandattr_setup>
<brandattr_write>
<connection>
<use>core_write</use>
</connection>
</brandattr_write>
<brandattr_read>
<connection>
<use>core_read</use>
</connection>
</brandattr_read>
</resources>
</global>
<adminhtml>
<events>
<catalog_product_prepare_save>
<observers>
<brandattr>
<class>brandattr/observer</class>
<method>productSave</method>
</brandattr>
</observers>
</catalog_product_prepare_save>
</events>
</adminhtml>
installer file
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('catalog_product', 'brand_pro', array(
'group' => 'General',
'input' => 'select',
'type' => 'text',
'label' => 'Brand',
'source' => 'brandattr/product_attribute_source_unit',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'searchable' => 1,
'filterable' => 0,
'comparable' => 1,
'visible_on_front' => 1,
'visible_in_advanced_search' => 0,
'is_html_allowed_on_front' => 0,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->endSetup();
unit.php
<?php
class AdminModules_Brandattr_Model_Product_Attribute_Source_Unit extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{
public function getAllOptions()
{
if ($this->_options === null) {
$this->_options = array(
array(
'value' => '',
'label' => '',
),
array(
'value' => '1',
'label' => 'Only',
),
array(
'value' => '2',
'label' => 'Vero Moda',
),
);
}
return $this->_options;
}
}
?>