Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <config>
  3. <modules>
  4. <Namespace_Module>
  5. <version>0.0.1</version>
  6. </Namespace_Module>
  7. </modules>
  8. <global>
  9. <resources>
  10. <module_setup>
  11. <setup>
  12. <module>Namespace_Module</module>
  13. <class>Mage_Eav_Model_Entity_Setup</class>
  14. </setup>
  15. <connection>
  16. <use>default_setup</use>
  17. </connection>
  18. </module_setup>
  19. </resources>
  20. </global>
  21. </config>
  22.  
  23. <?php
  24. $installer = $this;
  25. $installer->startSetup();
  26. $customerEntityTypeId = $installer->getEntityTypeId('customer');
  27. $atttributeCode = 'display_name';
  28.  
  29. $installer->removeAttribute($customerEntityTypeId, $atttributeCode );
  30. $installer->addAttribute('customer', $atttributeCode, array(
  31. 'type' => 'varchar',
  32. 'input' => 'text',
  33. 'label' => 'Display Name',
  34. 'global' => true,
  35. 'visible' => true,
  36. 'required' => false,
  37. 'user_defined' => true,
  38. 'visible_on_front' => true
  39. ));
  40.  
  41. $usedInCustomerAddressForms = array(
  42. 'adminhtml_customer',
  43. 'customer_account_edit'
  44. );
  45. $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
  46. $attribute->setData('used_in_forms', $usedInCustomerAddressForms);
  47. $attribute->save();
  48. $this->endSetup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement