i have a dropdown ui-component in which i want to display a list of manufacturers.

In the example below, i have a working drop-down with shipping methods.

<field name="manufacturer_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Shipping\Model\Config\Source\Allmethods</item>
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="multiple" xsi:type="boolean">false</item>
            <item name="label" xsi:type="string" translate="true">Manufacturer</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>

Is there an easy way of passing a class instead of Magento\Shipping\Model\Config\Source\Allmethods to get the list of manufacturers?

From this answer, getting the manufacturers is done via product attributes

$om = \Magento\Framework\App\ObjectManager::getInstance();

/** @var \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute */
$attribute = $om->get(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class)

foreach ($attribute->getOptions() as $option) {
     var_dump($option->getValue() . ' -> ' . $option->getLabel());

But how do i assign this data to my drop-down (and in what format?) ?

Thank you.

1 Answer 1


If I understand correctly, you want to show the options for a select UI component. I think this question have been answered here maybe this will help you.

  • Thank you, that actually helped me, even the answer from that question was related to showing all product attributes, i took only manufacturers (based on the my code above for getting manufacturers).
    – Robert
    Commented Mar 29, 2021 at 12:28
  • Glad I could help Commented Mar 29, 2021 at 12:32

Your Answer

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

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