Skip to content

Instantly share code, notes, and snippets.

@davefreiman
Created March 10, 2014 19:50
Show Gist options
  • Save davefreiman/9472898 to your computer and use it in GitHub Desktop.
Save davefreiman/9472898 to your computer and use it in GitHub Desktop.
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->join(array('customer_info' => Mage::getSingleton('core/resource')->getTableName('customer_entity')), 'main_table.customer_id = customer_info.entity_id', array('customer_info.group_id'))
->join(array('customer_group' => Mage::getSingleton('core/resource')->getTableName('customer_group')), 'customer_info.group_id = customer_group.customer_group_id', array('customer_group.customer_group_code AS group_name'));
$this->setCollection($collection);
return parent::_prepareCollection();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment