2

For adding massaction to product grid I use next code:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">
        <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
            <action name="copyoptions">
                <settings>
                    <url path="modulename/index/massSendConfirmation"/> <!-- your custom controller to handle request -->
                    <type>copyoptions</type>
                    <label translate="true">Copy Product Options</label>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
</listing>

It works, How can I add input field to this place enter image description here

I need it to set product id in this input. Who can give any information?

3
  • any luck with this ? Did you manage to solve this ? Commented Mar 27, 2020 at 12:57
  • No, did not solve
    – omelandr
    Commented Mar 27, 2020 at 16:44
  • Check my module here. It adds custom mass action along with the input field
    – shreyas d
    Commented May 26, 2023 at 10:56

1 Answer 1

-1

Massaction is already implemented in Product grid if you want to add one more action in the list you can create app/code/Vendor/ModuleName/view/adminhtml/ui_component/product_listing.xml in your module with code:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">
        <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
            <action name="status">
                <settings>
                    <type>status</type>
                    <label translate="true">Change status</label>
                    <actions>
                        <action name="0">
                            <type>enable</type>
                            <label translate="true">Enable in All Store Views</label>
                            <url path="catalog/product/massStatus">
                                <param name="status">1</param>
                            </url>
                        </action>
                        <action name="1">
                            <type>disable</type>
                            <label translate="true">Disable in All Store Views</label>
                            <url path="catalog/product/massStatus">
                                <param name="status">2</param>
                            </url>
                        </action>
                    </actions>
                </settings>
            </action>
        </massaction>
        <paging name="listing_paging"/>
    </listingToolbar>
</listing>

Hope it work!

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.