Using this code

$chooser = $this->_layout->createBlock('\Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser');

        $configChooser = [
            'button' => [
                'open' => __('Select Products'),
                'type' => '\Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser',

I can get a pretty nice product selector for my custom field in my custom form, but i need it to be able to select several product. There is a chooser config that i can be able to set?

  • 2
    Hi Gianni, can you share more code for Product Chooser in custom module form, please. I want to figured out that but I couldn't. Thanks. – hayatbiralem May 7 '18 at 10:06
 <fieldset name="assign_products" sortOrder="40">
            <label translate="true">Products</label>
                <container name="assign_products_container" sortOrder="160">
                 <htmlContent name="html_content">
                     <block name="my_assigned_products" class="Magento\Catalog\Block\Adminhtml\Product\Grid">
                            <argument name="button" xsi:type="array">
                             <item name="open" xsi:type="string" translate="true">Select Product...</item>
  • perfact work on my custom ui form thanks a lot. – user77175 Feb 19 at 13:29
<fieldset name="assign_products" sortOrder="40">

true Products Select Product...

use Magento\Catalog\Block\Adminhtml\Product\Grid instead of Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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