Posts Tagged ‘admin grid’

Hello All,

Today i found how to set default filter in product grid by product type (e.g.  ‘simple’) in admin product grid. For that you need to rewrite grid.php class of product in path  yourproject/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php

You need to add below code in _construct() method of grid.php

  $this->setDefaultFilter( array(
                'type' => constant(get_class(Mage::getSingleton('catalog/product_type')) . '::TYPE_SIMPLE'),

In above code ‘type’ is field and “constant(get_class(Mage::getSingleton(‘catalog/product_type’)) . ‘::TYPE_SIMPLE’)” is value, you can change its value as per your requirement.

I hope this code will help you, Thanks for reading my blog.


Bijal Bhavsar 🙂