Adding new column in Sales Order View Items in Magento Admin

Adding new column in Sales Order View Items in Magento Admin

August 26, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Adding new column in Sales Order View Items in Magento Admin

Modifying Sales Order View Items to Display Product Manufacturers in Magento

As an experienced developer, I understand that customizing the admin interface of Magento requires a deep understanding of its core files and block systems. In this post, we’ll guide you through adding a new column for product manufacturers alongside the name in the Sales / Order / View order section.

Understanding the Mage_Sales_Block_Order_Item_Renderer_Default

The Mage_Sales_Block_Order_Item_Renderer_Default class, located at app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php, is responsible for rendering individual items in a sales order. However, as you’ve discovered, it doesn’t directly reference the columns or product attributes that are displayed.

The Role of the Template File

The default.phtml file you mentioned (app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml) is indeed a crucial part of the rendering process. It’s responsible for displaying the actual HTML output for each item in an order.

Modifying the Default Renderer Template

You’re on the right track with attempting to modify this file. Let’s first understand how it works:

<tbody>
    <?php foreach ($this->getItemsCollection() as $_item): ?>
        <tr class="item-row">
            <td style="width:1%;"><?php echo $this->getColumnHtml($_item, 'row_num') ?></td>
            <td style="width:35%;"><?php echo $this->getColumnHtml($_item, 'name') ?></td>
            <!-- More columns here -->
        </tr>
    <?php endforeach; ?>
</tbody>

As you can see, each item is rendered within a tr element. The column contents are determined by calling the getColumnHtml() method of the renderer block.

You tried to replace 'name' with 'manufacturer', which seems like a logical approach. However, this alone won’t work because the core files don’t currently map the ‘manufacturer’ attribute to any specific HTML output.

Mapping Custom Attributes

To display the manufacturer, we need to modify the mapping of columns in the renderer block itself. The getColumnHtml() method is defined in the Mage_Sales_Block_Order_Item_Renderer_Abstract.php file:

public function getColumnHtml($item, $column)
{
    return $this->getItemRenderer()->render($item, $column);
}

The actual rendering happens in the item renderer, which is defined by Mage_Sales_Model_Order_Item_Renderer::getRenderer() method.

Using Custom Item Renderers

To display a custom attribute like ‘manufacturer’, you’ll need to create a new item renderer. Magento allows you to define your own renderers using XML configuration files.

Here’s a basic example of how you might define a new renderer in an extension:

<sales>
    <order_item_renderer>
        <custom_manufacturer>
            <type>Sales/Block/Order/Item/Renderer/CustomManufacturer.php</type>
            <sort_order>10</sort_order>
        </custom_manufacturer>
    </order_item_renderer>
</sales>

Then, in your CustomManufacturer.php file, you would override the render() method to output the manufacturer name:

public function render($item)
{
    return $item->getProduct()->getAttributeText('manufacturer');
}

Remember, this is a simplified example. You’ll need to ensure that the ‘manufacturer’ attribute exists in your catalog_product_entity attributes table.

Conclusion

In conclusion, adding a new column like the manufacturer name isn’t as straightforward as modifying a single template file. It requires creating a custom order item renderer and mapping it properly through Magento’s XML configuration system.

If you’re looking to learn more about extending Magento’s functionality safely and efficiently, I recommend checking out our comprehensive guide on Magento 2 extension development.

This guide provides a detailed walkthrough of the process, ensuring you can make changes like this without compromising your store’s stability or security.

Catalog Themes Admin Orders

Our network