Display order status on dashboard order listing

When you go into the Magento dashboard and view your store summary information, one of the blocks is the “last 5 orders” listing that shows the customer, items, and grand total.

It would be nice to quickly see the status of each of those orders, so lets add a ‘status’ (ie processing, complete etc) column to that block.

COPY: app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php

TO: app/code/local/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php

Add the code below inside the function _prepareColumns()


protected function _prepareColumns()
{
$this->addColumn('customer', array(
'header' => $this->__('Customer'),
'sortable' => false,
'index' => 'customer',
'default' => $this->__('Guest'),
));

$this->addColumn('items', array(
'header' => $this->__('Items'),
'align' => 'right',
'type' => 'number',
'sortable' => false,
'index' => 'items_count'
));

$baseCurrencyCode = Mage::app()->getStore((int)$this->getParam('store'))->getBaseCurrencyCode();

$this->addColumn('total', array(
'header' => $this->__('Grand Total'),
'align' => 'right',
'sortable' => false,
'type' => 'currency',
'currency_code' => $baseCurrencyCode,
'index' => 'revenue'
));

// Add this section to include the status column
$this->addColumn('status', array(
'header' => Mage::helper('sales')->__('Status'),
'index' => 'status',
'type' => 'options',
// 'width' => '70px',
'sortable' => false,
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
));
// end add section
$this->setFilterVisibility(false);
$this->setPagerVisibility(false);

return parent::_prepareColumns();
}

Leave a Reply