I have situation
I want to join two tables having some data related to orders.One table contain order id as increment_id
and other table contain order id as order_id
.I am joining the tables through customer_id
.Now the thing is when we display the column in backend grid we define some column name to it.But now I have two columns containing different names.Then how I can use data of both the column together and can give name to grid column.
Till now my join code is
$collection = Mage::getModel('creditlog/creditlog')->getCollection();
$collection->addFieldToFilter('main_table.customer_id', $this->getRequest()->getParam('id'));
$logTable = Mage::getSingleton('core/resource')->getTableName('creditlog/logdata');
$collection->getSelect()->join(array('a'=> $logTable),
'main_table.customer_id = a.customer_id', array('order_id','credit_amount','date','status'));
And my grid column is
$this->addColumn('increment_id', array(
'header' => Mage::helper('creditlog')->__('Your orders'),
'index' => 'increment_id',
'type' => 'text',
)
);
Please help.
Best Answer
and your renderer block