Magento : Product Name and Product SKU in Sales order grid

Product Name and Product SKU in Sales order grid: This is really very important and needed aspects of the sales order grid and saves a lot of time of your’s , Lot of users requested us for this tutorial . so here is a simple hack to display product order name and product sku in magento sales order grid .

Go to /app/code/core/Mage/Adminhtml/Block/Sales/Order and open grid.php

Now replace your _prepareCollection() function to this following code

protected function _prepareCollection()
       	$collection = Mage::getResourceModel($this->_getCollectionClass())
		            'skus'  => new Zend_Db_Expr('group_concat(`sales/order_item`.sku SEPARATOR ",")'),
		            'names' => new Zend_Db_Expr('group_concat(`sales/order_item`.name SEPARATOR ",")'),

        return parent::_prepareCollection();

After adding this function lets add the columns in grid for sku and ordername add this code in your _prepareColumns() function

$this->addColumn('skus', array(
            'header'    => Mage::helper('Sales')->__('Skus'),
            'width'     => '100px',
            'index'     => 'skus',
            'type'        => 'text',

	$this->addColumn('names', array(
            'header'    => Mage::helper('Sales')->__('Name'),
            'width'     => '100px',
            'index'     => 'names',
            'type'        => 'text',

after this you’ll display your sales order screen in like this Email me for any query or suggestion :
We also provide extended version of the module for magento extended sales order grid .

This module supports following product properties in sales order grid –

★ Product image

★ Product id


★ Product Name

★ Buyer Email address

★ Gender

★ Ordered Quantity

Feel free to contact us  or add a ticket at our ticket support system –

. . .

Comments (2)

Add Your Comment

  • Paolo L
    get error 500 during “add this code in your _prepareColumns() function” section.
  • yoseph2012
    Thank you! It shows the SKUs and names perfectly. But when trying to search for specific SKU, it throws error saying: Column not found: 1054 Unknown column ‘skus’ in ‘where clause’.. Can you help?
  • css.php