Magento (v 1.7.0.2) - Add "Shipping Method" column in Sales Order Grid

Magento (v 1.7.0.2) - Add "Shipping Method" column in Sales Order Grid

August 20, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento (v 1.7.0.2) - Add "Shipping Method" column in Sales Order Grid

Extending the Sales Order Grid in Magento (v1.7.0.2)

Adding custom columns to the Sales Order grid in older versions of Magento can be quite challenging compared to more recent releases that offer built-in features for extending grids. In this post, we’ll guide you through adding a new column for Shipping Method (Standard, Priority, Express) to your Sales Order Grid located at /home/html/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php.

Understanding the core grid setup

Before diving into modifications, let’s first understand how the core grid is structured. The Sales_Order grid is defined in the _prepareCollection() and _prepareColumns() methods of the Mage_Adminhtml_Block_Sales_Order_Grid class.

The _prepareCollection() method prepares the main collection that will be used to populate the grid:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $this->setCollection($collection);
}

Adding a new column

To add your custom “Shipping Method” column, you’ll need to modify the _prepareColumns() method. You’re on the right track by suggesting to extend this method and add a case for your new column. Here’s how to implement it correctly:

protected function _prepareColumns()
{
    $this->addColumn('real_order_id', array(
        'header' => Mage::helper('sales')->__('Order #'),
        'width' => '80px',
        'type'  => 'text',
        'index' => 'entity_id',
    ));

    // Add your custom column here
    $this->addColumn('shipping_description', array(
        'header' => Mage::helper('sales')->__('Shipping Method'),
        'width' => '150px',
        'type'  => 'text',
        'index' => 'shipping_description',
    ));

    // ... (rest of the code remains unchanged)
}

Getting the shipping method description

The shipping_description index in the above example corresponds to the shipping_method column in your orders table. To retrieve the actual shipping method name (like “Standard”, “Priority”, or “Express”), you’ll need to create a new helper or extend an existing one.

You can create a custom helper module as explained in our guide: Creating Custom Helper Modules.

In your custom helper, you would define a method to map the shipping code (like standard, priority, etc.) to its corresponding human-readable description:

class My_Adminhtml_Helper_Sales extends Mage_Core_Helper_Abstract
{
    public function getShippingMethodDescription($shippingCode)
    {
        $descriptions = array(
            'standard' => 'Standard',
            'priority' => 'Priority',
            'express'  => 'Express',
            // add more shipping methods as needed
        );

        if (isset($descriptions[$shippingCode])) {
            return $descriptions[$shippingCode];
        }

        return '';
    }
}

Then, in your grid block, you can use this helper to retrieve the shipping method description:

// In Mage_Adminhtml_Block_Sales_Order_Grid::renderRow()
public function renderRow($row)
{
    // ... (other code)

    $shippingDescription = Mage::helper('my_adminhtml/sales')->getShippingMethodDescription($row->getData('shipping_method'));

    if ($shippingDescription) {
        $cellHtml .= '<span class="nobr">' . $shippingDescription . '</span>';
    } else {
        $cellHtml .= '<span class="nobr">-</span>';
    }

    return $cellHtml;
}

Conclusion

Adding a new column to the Sales Order grid in Magento 1.7.0.2 requires careful modification of the core files and an understanding of the grid’s structure. By extending the _prepareColumns() method and creating a custom helper for shipping method descriptions, you can successfully add your desired “Shipping Method” column.

Remember that modifying core files should always be approached with caution, as it may cause issues during updates or upgrades. If you’re working on an active production site, consider using a local development environment to test these changes before applying them to the live site.

For more advanced customizations and grid management in Magento 2.x and later versions, I recommend exploring our guide on Extending Grid Blocks for a better understanding of the architecture and available features.

Magento 1 Admin Orders

Our network