I have created my own custom module for "Critic Expert" feature. I want to assign a critic expert with each product so I have to add my custom dropdown with each product.

How would I can show the dropdown with my custom module values and save it along with product in admin section.

Please find attached screenshot for more details.

enter image description here

  • @Neeraj Sharma, I have create small module for this you can download from below link. download link. You just need to share your selected option data to product data-provider.
    – kunj
    Mar 27, 2018 at 13:52
  • I had same requirement and created one module for it. Is it fine to create Critics List attribute and assign it with product by pragmatically ? Mar 27, 2018 at 14:16

1 Answer 1


I have created Small module. It will help you.

Create module files which are listed below.


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Kunj_Critic" setup_version="2.0.0"></module>



namespace Kunj\Critic\Model\Critic;

class Options implements \Magento\Framework\Option\ArrayInterface
    public function toOptionArray()
        return [
                'label'=>"My Option"
                'label'=>"My Option 2"
                'label'=>"My Option 3"
                'label'=>"My Option 4"
                'label'=>"My Option 5"


<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="product-details">
        <field name="critic_lists" sortOrder="300" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Kunj\Critic\Model\Critic\Options</item>
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">block</item>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                <label translate="true">Critic Lists</label>



After create module run :

php bin/magento setup:upgrade
  • How I save these option in database Oct 9, 2018 at 10:56
  • this code for save those data in you custom table.
    – kunj
    Oct 11, 2018 at 4:18

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.