Guest User

Untitled

a guest
Aug 16th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. $attributeSet = $this->attributeSetFactory->create();
  2. $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);
  3.  
  4. $customerSetup->addAttribute('customer_address', 'address_email', [
  5. 'type' => 'varchar',
  6. 'label' => 'Email',
  7. 'input' => 'text',
  8. 'required' => true,
  9. 'visible' => true,
  10. 'user_defined' => true,
  11. 'sort_order' => 1000,
  12. 'position' => 1000,
  13. 'system' => 0,
  14. ]);
  15.  
  16. $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'address_email')
  17. ->addData([
  18. 'attribute_set_id' => $attributeSetId,
  19. 'attribute_group_id' => $attributeGroupId,
  20. 'used_in_forms' => ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address'],
  21. ]);
  22. $attribute->save();`
Add Comment
Please, Sign In to add comment