I would like to switch the column order in the Manage Products admin grid.
Say I want to move the SKU column before the Name column. How would I go about that without installing any extensions?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
You can copy the product grid block
and change the columns order inside as you wish.
Note, it's a fast solution but not the best practice. Creating a new extension is more upgrade-friendly.
You can use layout XML for that.
Create a file
app/design/adminhtml/default/default/layout/local.xml containing the following code:
<?xml version="1.0"?> <layout> <adminhtml_catalog_product_index> <reference name="product.grid"> <action method="addColumnsOrder"> <columnId>sku</columnId> <after>entity_id</after> </action> </reference> </adminhtml_catalog_product_index> </layout>
If you want to move other columns you can find the column ids in
Mage_Adminhtml_Block_Catalog_Product_Grid::_prepareColumns(). The first parameter in the
$this->addColumn() calls are the ids.
Of course, you can also create your own extension and add a custom layout XML file if you want to re-use it.