I need to filter blank image product in Magento from catalog and catalogsearch. But it working fine on catalog. bt not fine in catalog search.

I got error when search product in search....

  Column not found: 1054 Unknown column 'e.small_image' in 'where clause'"


<?xml version="1.0"?>
                    <filter_blank_image> // unique idrntifer


class Nine_Catalog_Model_Observer extends Varien_Event_Observer

    public function filterBlankImage(Varien_Event_Observer $observer)
        $collection = $observer->getEvent()->getCollection();
        return  $collection->addAttributeToFilter('small_image',array('neq'=>'no_selection'));


1 Answer 1


If you enable catalog product flat setting then may be small_image column is not created at catalog_product_flat_YourStoreId table.So please reindex catalog product from admin Index Management.

If small_image column is not create then add below code to config. xml for enable this attribute to flat.


Code Observer code:

class Nine_Catalog_Model_Observer extends Varien_Event_Observer{

    public function filterBlankImage(Varien_Event_Observer $observer)

        $collection = $observer->getEvent()->getCollection();
        return $this;

If this not work then must issue with indexing See at another example how to filter blank image product collection by observer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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