Engine23
blogBannerImage
By Engine23

Magento - Find all products in your store with missing images

$products = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect('image');
$a = array();
foreach($products as $id => $_product){
$a[(int)$id] = (int)$id;
}
$has_images = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect('image')->addAttributeTofilter('image', array('notnull' => ''));

foreach($has_images as $id => $_product)
{
$b[(int)$id] = (int)$id;
}

$product_ids_missing_images = array_diff($a, $b);
foreach($product_ids_missing_images as $_id){
echo '<div>'.$_id.'</div>';
}