Backend grids in Magento 2 are meant for easy data management.
The mass actions in the admin panel grids allow the admin to perform an action in bulk.
The default customer grid offers multiple mass actions:
However, modern business may demand custom actions to be performed on customer data.
Today, I’ll show the programmatic solution to add custom mass action in the customer grid in Magento 2.
One can use this solution to confirm the registration of customers in bulk or update customers’ data at a time.
The default Magento 2 does not have this feature. Therefore, here, I have shared a programmatic solution as shown below:
Method to Add Custom Mass Action in the Customer Grid in Magento 2
Here is what you need to do.
Create file customer_listing.xml at app\code\Vendor\Extension\view\adminhtml\ui_component\
<?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">
<message translate="true">Are you sure to perform Action for selected customers?</message>
<title translate="true">Custom MassAction</title>
<url path="extension/controller/massAction"/> <!-- your custom controller to handle request -->
<label translate="true">Custom MassAction</label>
After executing this code, you manage to add custom mass action in the customer grid.
If you have queries regarding this post, feel free to ask in the Comment section below.
I would be happy to answer your question.
Share this post to Magento Community via social media to bring more awareness about adding custom mass action in the customer grid.
- How to Add Mass Custom Action in Order Grid in Magento 2
- How to Add Custom Mass Action to Product Grid In Magento 2
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.