Skip to content

Instantly share code, notes, and snippets.

@drewgillson
Created June 10, 2012 17:47
Show Gist options
  • Save drewgillson/2906747 to your computer and use it in GitHub Desktop.
Save drewgillson/2906747 to your computer and use it in GitHub Desktop.
Do not copy and paste this code - it won't work!
<?php
class Zyn_Common_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid {
protected function _prepareColumns() {
$this->addColumn('zyn_featured',
array(
'header'=> 'Show on Homepage',
'width' => '50px',
'index' => 'zyn_featured',
'type' => 'options',
'options' => array(0 => 'No', 1 => 'Yes')
));
parent::_prepareColumns();
}
protected function _prepareCollection() {
$collection = parent::_prepareCollection()->getCollection();
$collection->addAttributeToSelect('zyn_featured');
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment