In magento 1.9 how we can get comment column in sale -> orders with the latest comment e.g Customer is redirected to Paypal Any idea what will be the query for this?


Create your custom renderer, extended from renderer abstract:

class Vendor_Module_Block_Adminhtml_Widget_Grid_Column_Renderer_History extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
    public function render(Varien_Object $row)
        $orderId = $row->getId();
        $order = Mage::getModel('sales/order')->load($orderId);
        $history = $order->getStatusHistoryCollection()->getFirstItem();
        return $history->getComment();

Then add new column to order grid, with this renderer:

$this->addColumn('history', array(
    'header' => Mage::helper('sales')->__('History status'),
    'type'  => 'text',
    'renderer' => new Vendor_Module_Block_Adminhtml_Widget_Grid_Column_Renderer_History()
  • Hi, @zhartaunik I need the same for Magento 2 Is that possible ? – Ask Bytes May 5 '19 at 9:49
  • Any help magento.stackexchange.com/q/298382/39050 Thanks @zhartaunik – zus Dec 12 '19 at 11:53
  • Hi, Is it also possible to filter on this renderer? how would i need to implement this? – Wouter Stulp Oct 8 '20 at 13:00

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