The sales order grid in Magento provides a convenient overview of all orders placed in your store.
However, you may want to customize the grid by removing certain elements that are not relevant to your business process.
In this blog post, we will discuss how to remove the 'Create New Order' button from the sales order grid, focusing on Magento 2.
Step 1: Locate the Grid Component
To begin, we need to locate the grid component responsible for rendering the sales order grid. In Magento 2, the grid component is defined in a UI component XML file. Navigate to the following file in your project directory:
Step 2: Modify the XML File
sales_order_grid.xml file and locate the
Inside this node, you will find the
<listingToolbar> node, which represents the toolbar displayed above the grid.
<listingToolbar>, there is a
<addNew> node defining the 'Create New Order' button.
To remove the button, comment out or delete the entire
Save the file once your modifications are complete.
Step 3: Clear Cache and Refresh
Once you've saved the changes to the sales_order_grid.xml file, clear the Magento cache to ensure the modifications take effect. Open a terminal, navigate to your Magento installation directory, and run the following command:
php bin/magento cache:clean
Finally, refresh your Magento admin panel to see the updated sales order grid without the 'Create New Order' button.
By following the steps outlined above, you can easily remove the 'Create New Order' button from the sales order grid in Magento 2.
This customization allows you to tailor the interface to align with your specific business requirements.
Remember to clear the cache after making changes to XML files to ensure that the modifications are reflected accurately.