Guest User

Untitled

a guest
Apr 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
  2.  
  3. $customerSetup->addAttribute(MagentoCustomerModelCustomer::ENTITY, 'custom_attr', [
  4. 'type' => 'varchar',
  5. 'label' => 'Customer Position',
  6. 'input' => 'text',
  7. 'source' => '',
  8. 'required' => false,
  9. 'visible' => true,
  10. 'position' => 999,
  11. 'system' => false,
  12. 'backend' => ''
  13. ]);
  14. $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'custom_attr')
  15. ->addData(['used_in_forms' => [
  16. 'adminhtml_customer'
  17. ]]);
  18. $attribute->save();
Add Comment
Please, Sign In to add comment