Hello, Magento Folks,

Last time I explained how you can Remove Item from cart automatically after 30 minutes in Magento 2.

Today, we are going to learn how you can add a new custom action in the sales order grid in Magento 2.

For Store Magento 2 store owners, it is the most essential part to fulfil the customer’s orders throughout the journey, which start from placing an order to receiving it. In Magento 2, it has become so easy to order with its easy checkout process.

By default, Magento2 provides view action in admin order’s grid, and with the help of that we can view particular order details. But what if we want to add some custom actions with view action?

Like, reorder functionality directly from the grid.

No worries, with the help of below codes you can add custom actions (one or more) as per your requirement.

So, Let’s get started,

Step 1: To do this, create sales_order_grid.xml file inside app\code\Vendor\Extension\view\adminhtml\ui_component\ folder and add this code:

Step 2: Next, create ViewAction.php file inside app\code\Vendor\Extension\Ui\Component\Listing\Column\ folder and add this code:

Step 3: And finally refresh the cache.

So, this is it. From now on, you are able to add custom actions in the sales grid of Magento 2. You are free to implement these codes if you face any issues while implementations, then contact our Support team for help.

Lastly, if you found this article helpful, then let us know in the comments below. Also, don’t forget to share this with your Magento partners and colleagues.

Happy Coding?

Click to rate this post!
[Total: 4 Average: 4]