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?
1 Answer
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, Is it also possible to filter on this renderer? how would i need to implement this? Oct 8, 2020 at 13:00