Created
January 26, 2012 03:44
-
-
Save danlamanna/1680842 to your computer and use it in GitHub Desktop.
Adding customer attributes to Magento Adminhtml Order Grid.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _prepareCollection() | |
{ | |
$collection = Mage::getResourceModel($this->_getCollectionClass()); | |
$collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),'sfoa.entity_id=main_table.entity_id',array('sfoa.postcode')); | |
$this->setCollection($collection); | |
return parent::_prepareCollection(); | |
} | |
protected function _prepareColumns() | |
{ | |
$this->addColumn('postcode', array( | |
'header' => 'Customer Zip', | |
'width' => '80px', | |
'type' => 'text', | |
'index' => 'postcode', | |
'filter_index' => 'sfoa.postcode')); | |
$this->addColumn('real_order_id', array( | |
'header'=> Mage::helper('sales')->__('Order #'), | |
'width' => '80px', | |
'type' => 'text', | |
'index' => 'increment_id', | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment