cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Products on category page to only show product type 'Grouped'

Filter Products on category page to only show product type 'Grouped'

I'm trying to filter the results on the category page to only display 'Grouped' Products.

I'm editing the catalog/view/frontend/templates/product/list.phtml file.

 

$_productCollection = $block->getLoadedProductCollection();
$_productCollection->addAttributeToFilter('type_id', array('eq' => 'grouped'));

Is this the correct file to edit? 

1 REPLY 1

Re: Filter Products on category page to only show product type 'Grouped'

Yes this file(catalog/view/frontend/templates/product/list.phtml) is responsible for rendering the product on the category page. You can apply your filter in your theme's file.

In case you are not using the any third party theme then you can update this in your custom module. 

Hope this will help. If you have any query regarding it, please let me know.

Smiley Happy