Magento: How to hide products that have no images

If you would like to hide products without images in your Magento store product list page, this is one way to do it. edit app/design/frontend/[YOUR CURRENT TEMPLATE]/[YOUR CURRENT THEME]/template/catalog/list.phtml (e.g. app/design/frontend/default/default/template/catalog/list.phtml)

Change :


  1.  $_productCollection=$this->getLoadedProductCollection();

to


  1.  $_productCollection = clone $this->getLoadedProductCollection();
  2.  $_productCollection->clear()
  3.   ->addAttributeToFilter('image', array('neq' => 'no_selection'))
  4.   ->load();

Since the collection we get from getLoadedProductCollection was already fetched from database, we cannot add attribute filters to it, that’s why it wouldn’t work without the clone. So we need to clone it then clear it. then add the attribute filter.

If you are not familiar with neq, neq means not equal.