I want to create a custom dropdown attribute for magento customer account.
For this I have used $installer script but it is not working for me. My script as below :
<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("customer", "track_device", array(
"label" => "Customer Device",
'input' => 'select',
'type' => 'int',
'required' => 0,
'user_defined' => 0,
'source' => 'eav/entity_attribute_source_table',
'option' => array('values' => array('Web', 'App'))
));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "track_device");
$used_in_forms=array();
$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)
->setData("is_used_for_customer_segment", true)
->setData("is_system", 0)
->setData("is_user_defined", 1)
->setData("is_visible", 1)
->setData("sort_order", 100)
;
$attribute->save();
$installer->endSetup();
?>
Is anything missing or wrong in this script?
Is any another method to create custom dropdown attribute in customer account in magento?