I want to override customer grid collection to filter by customer group. How to add customer group filter on Customer grid?


By default customer group exist in grid collection filter. You just need to enable group from grid columns setting from right top corner of grid.

  • I don't want to filter manually.Actually, i want to display customers for a specific group in the grid. – Sneha Panchal Sep 15 '17 at 6:19
  • 1
    override Magento\Customer\Model\ResourceModel\Grid\Collection class and add this code: protected function _renderFiltersBefore() { $this->addFieldToFilter('group_id','3'); parent::_renderFiltersBefore(); } – Yogesh Karodiya Sep 15 '17 at 9:46
  • and how to call this Collection in my new module please – Developper Magento Nov 21 '18 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.