my manufactorer manage grid can't filter at store column.
Uncaught Error: Call to undefined method
Magebuzz_Manufacturer_Model_Mysql4_Manufacturer_Collection::addStoreFilter()
prepare column:
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('manufacturer')->__('Store View'),
'index' => 'store_id',
'type' => 'store',
'store_all' => TRUE,
'store_view' => TRUE,
'sortable' => FALSE,
'filter_condition_callback'
=> array($this, '_filterStoreCondition'),
));
}
function:
protected function _filterStoreCondition($collection, $column)
{
if(!$value = $column->getFilter()->getValue()) {
return;
}
$this->getCollection()->addStoreFilter($value);
}
protected function _prepareCollection()
{
$collection= Mage::getModel('manufacturer/manufacturer')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
Best Answer
Use below code for store filter
It helpful to you.