How to Delete Columns in Sales Grid

How to Delete Columns in Sales Grid

When the number of extension grows on your Magento store, you need to get rid of certain columns in the table Order => Sales, Customers => Manage Customers etc.

In order to solve this problem, you can use observer events.

1. Add the following code to config.xml :

2. Then in the Model/Observer.php file delete the column using its code.

You can find column code using browser’s debugger (F12  or Ctrl+Shift+i).

How to Delete Columns in Order Sales Grid

You need to use different conditions instanceof to delete columns depending on the table from which you want to delete them.

  • For Sales => Orders  – Mage_Adminhtml_Block_Sales_Order_Grid;
  • For Customers => Manage Customers  – Mage_Adminhtml_Block_Customer_Grid;

As a result, the Billing Name column won’t be displayed.

How to Delete Columns in Order Sales Grid

In the next article I’ll show you how you can create a dynamic filter for columns based on this event.



Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *