0

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?

  • This question is about M1. – Els den Iep Jan 12 '18 at 12:32
3

You can copy the product grid block

From app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php

to the app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php

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.

| improve this answer | |
3

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.