Magento Forum

   
Get All Products
 
tman_f
Sr. Member
 
Total Posts:  85
Joined:  2008-02-12
 

Community,

Does anybody know an easy way to get all products?

for instance:

$products Mage::getSingleton('catalog/products')->getAllProducts();

Does anybody know of something like this?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
danieln
Sr. Member
 
Avatar
Total Posts:  131
Joined:  2007-11-08
Mainz, Germany
 

Hello tman_f,

maybe you want to take a look at getLoadedProductCollection() from app/code/core/Mage/Catalog/Block/Product/List.php. This gives you always all products by current scope. Maybe it also gives you an idea on how to write your own if you can’t use it right away smile

Best regards,
Daniel

 
Magento Community Magento Community
Magento Community
Magento Community
 
chapagain
Sr. Member
 
Avatar
Total Posts:  202
Joined:  2009-07-19
 

$collection Mage::getModel('catalog/product')
                        ->
getCollection()
                        ->
addAttributeToSelect('*');

foreach (
$collection as $product{
    
echo $product->getName() . "<br />";
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vipan Kumar
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2012-08-27
 

$collection Mage::getModel('catalog/product')
                        ->
getCollection();

foreach (
$collection as $product{
    
echo $product->getName() . "<br />";
}

Tutorials
Join me at Facebook

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top