i am trying to filter grid by category without adding category column, is there a way by which we can do this custom filter to grid.
below is what i did
function prepareCollection()
{
$catIdArray = getRequest()->getParam('cat_id');
//i.e $catIdArray = array(26, 27, 17);
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->joinField(
'category_id',
'catalog/category_product',
'category_id',
'product_id=entity_id',
null,
'left'
)
->addAttributeToFilter(
'category_id',
array('in' => $catIdArray)
)
->addAttributeToSelect('*');
$this->setCollection($collection);
Here filter is working fine, but pagination doesn't work in this case. please suggest me what am i doing wrong????