Created
March 25, 2013 12:35
-
-
Save barbazul/5236813 to your computer and use it in GitHub Desktop.
Get a collection of products without image, ordered by an attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
$collection = Mage::getModel('catalog/product')->getCollection(); | |
$collection->addAttributeToSelect(array('name', 'sku', 'isbn')) | |
->addAttributeToFilter('image', array('null' => true)) | |
->addAttributeToSort('editorial'); | |
foreach ($collection as $product) { | |
echo "Product " . $product->getSku() . " has no image\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment