Get a list of all products

How can I get a list of all products in a store, regardless of category?

+3
source share
1 answer

This should work in all versions of Magento:

$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
}
+15
source

Source: https://habr.com/ru/post/1796028/


All Articles