I created Custom customer attribute
:
$customerSetup->addAttribute(Customer::ENTITY, 'customer_type', [
'type' => 'int',
'label' => 'Corporation Or Proproetorship',
'input' => 'select',
'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
'required' => false,
'visible' => true,
'system' => false,
'position' => 210,
'system' => false,
'option' => ['values' => ['Corporation', 'Proproetorship']],
]);
$attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'customer_type')
->addData(['used_in_forms' => [
'adminhtml_customer',
'adminhtml_checkout',
'customer_account_create',
'customer_account_edit'
]]);
$attribute->save();
Now I want to display in registration form; could you help me how can I do?
Best Answer
1) app/code/Vendor/Module/Setup/UpgradeData.php
2) app/design/frontend/{vendor}/{theme}/Magento_Customer/templates/form/register.phtml
Copy the content from
Vendor/Magento/module-customer/view/frontend/templates/form/registration.phtml
then add this: