Working on custom extension, I have implemented multi select option using custom source. It don't show the option in multi select box. Anybody knows the reason?
Check screenshot,
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'extension_source_user',
[
'type' => 'varchar',
'label' => 'Used Title',
'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
'input' => 'multiselect',
'source' => 'company\extension\Model\Source\Custom\User',
'required' => false,
'sort_order' => 7,
'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
'apply_to' => 'simple,configurable,virtual',
'group' => 'company',
'searchable' => false,
'filterable' => false
]
);
Best Answer
It the issue of your source model "'source' => 'company\extension\Model\Source\Custom\User'"
You need to return option array in the form of key, value pair like :