Created
June 27, 2013 15:41
-
-
Save Modicrumb/5877535 to your computer and use it in GitHub Desktop.
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
//---------------------- GET THE PRODUCTS | |
$products = Mage::getModel ( 'catalog/product' )->getCollection (); | |
$products->addAttributeToFilter ( 'status', 1 ); //enabled | |
$products->addAttributeToFilter ( 'visibility', 4 ); //catalog, search | |
$products->addFieldToFilter(array( | |
array('attribute'=>'cost','gt'=>0))); | |
$products->addFieldToFilter(array( | |
array('attribute'=>'type_id','eq'=>'simple'))); | |
$products->addAttributeToSelect ( '*' ); | |
$prodIds = $products->getAllIds (); | |
//echo 'Product filter: '.memory_get_usage(false).'<br>'; | |
//flush(); | |
foreach ( $prodIds as $productId ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment