I want to create a custom address attribute, I need them visible in all the following places.
- Admin Addresses.
- My Account Address Box
- Checkout address and forms.
How can I implement to have them on billing and shipping address.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can create custom attribute from installSchema or upgrade schema.
$eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute('customer_address', 'type', array(
'type' => 'int',
'input' => 'select',
'label' => 'Address Type',
'source'=>'Web4pro\Ajaxcart\Model\Address\Type',
'global' => 1,
'visible' => 1,
'required' => 1,
'user_defined' => 1,
'system'=>0,
'group'=>'General',
'visible_on_front' => 1,
));
$eavSetup->getEavConfig()->getAttribute('customer_address','type')
->setUsedInForms(array('adminhtml_customer_address','customer_address_edit','customer_register_address'))
->save();