Get list of all products
How do I get the store to list all products, independent of 开发者_运维知识库category?
This should work in all Magento versions:
$products = Mage::getModel('catalog/product')->getCollection();
//Magento does not load all attributes by default
//Add as many as you like
$products->addAttributeToSelect('name');
foreach($products as $product) {
//do something
}
精彩评论