I'm following many articles but i'm not able create multi select attribute.
and i'm getting following error.
a:5:{i:0;s:50:"Source model "" not found for attribute "exinent1"";i:1;s:3008:"#0 C:\wamp\www\magento8\app\code\core.
and my script is:
<?php
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'exinent1', array(
'input' => 'multiselect',
'type' => 'varchar',
'backend' => 'eav/entity_attribute_backend_array',
'label' => 'exinent1',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'option' => array (
'value' => array('optionone' => array('First Option'),
'optiontwo' => array('Second Option'),
'optionthree' => array('Third Option'),
)
),
));
$setup->addAttributeToGroup(
$entityTypeId,
$attributeSetId,
$attributeGroupId,
'exinent1',
'100'
);
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'exinent1');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
$setup->endSetup();
and config.xml is:
<?xml version="1.0"?>
<config>
<modules>
<Exinent_Cusatt>
<version>3.1.5.6</version>
</Exinent_Cusatt>
</modules>
<global>
<resources>
<exinent_cusatt_setup>
<setup>
<module>Exinent_Cusatt</module>
</setup>
</exinent_cusatt_setup>
</resources>
</global>
</config>
Best Answer
I think you made lot of mistakes ..Here you go,
etc/config.xml
Helper/Data.php :
Mode/Eav/Entity/Attribute/Source/Customeroptions14042122330.php
sql/customerattribute1404212233_setup/mysql4-install-0.1.0.php
Thats it.. Just enable your module declare your code pool, And dont confuse with the numbers..
<customerattribute1404212233_setup>
Its just random no for you attribute identity, for prevent duplicate entry. ..Cheers ..!