Saturday, February 23, 2013

Magento : How to get products for which image is added

Here is the sample code for getting all the products for which base image is added.

[php]</pre>
$collection = Mage::getModel('catalog/product')
->getCollection()->addAttributeToFilter('image', array('neq' =>'no_selection'))
->addAttributeToSelect('*');
<pre>[/php]

May be this could help some one who have some requirements like this.

No comments:

Post a Comment