Hi all,
I have a table for my custom module with following columns:
---------------
| custom_table|
---------------
| id
| seller_id
| buyer_id
| ...
---------------
seller_id -> customer_enity [entity_id]
buyer_id -> customer_entity [entity_id]
Now i would like to show the seller name and buyer name in admin grid layout. I couldn’t figure out how to retrieve the seller name and buyer name from the customer entities. But i know how to retrieve their emails as:
protected function _prepareCollection()
{
$collection = Mage::getModel('custommodule/custommodule')->getCollection();
$collection->getSelect()
->join( array('ce1' => 'customer_entity'), 'ce1.entity_id=main_table.seller_id', array('seller_email' => 'email'))
->join( array('ce2' => 'customer_entity'), 'ce2.entity_id=main_table.buyer_id', array('buyer_email' => 'email'));
#echo $collection->getSelect()->__toString();
$this->setCollection($collection);
return parent::_prepareCollection();
}
This above code works fine. But i want to display their names instead of email. Can any body help me to modify this collection?
Any help is very much appreciated. Thanks