0
<field id="dropdown_example" translate="label" type="select" sortOrder="80" 
    showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Numbers</label>
   <source_model>vendor\module\Model\Config\Source\Custom</source_model>
                    
<frontend_model>vendor\module\Block\System\Config\Form\Field\SearchableDropdown</frontend_model>
 </field>

1 Answer 1

0

Magento 2 : How to Add Multi Select Dropdown in System Configuration

This article is for the Category Multi Select Dropdown on system configuration.

Here is the file that you need to change based on your requirements.

app/code/RH/MultiSelectCategory/Model/Source/Category.php

For Example:

public function toOptionArray()
{
    $options = ['test' => 'test', 'test1' => 'test1' => 'test2' => 'test2'];
    $optionArray = [];
    foreach ($arr as $key => $value) {
            $optionArray[] = [
                'value' => $value->getId(),
                'label' => $value->getName(),
            ];
    }
    return $optionArray;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.