I want to create customer attribute for the field as dropdown and checkbox and must save as YES/NO in backend in Magento2? Refer screenshot.
1 Answer
$customerSetup->addAttribute(Customer::ENTITY, 'is_mobile_verified', [
'label' => 'Is Mobile Verified ?',
'input' => 'select',
'required' => false,
'sort_order' => 100,
'visible' => false,
'system' => false,
'type' => 'static',
'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
'option' => ['values' => ['Yes', 'No']],
]);
