Magento Forum

How to List all products
 
angelo_f
Sr. Member
 
Total Posts:  80
Joined:  2011-10-28
 

Greetings

How do I list all products (with a next previous, max products per page) regardless of the category

I tried the following on a page but nothing was displayed

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

 
Magento Community Magento Community
Magento Community
Magento Community
 
SarathTomy
Sr. Member
 
Avatar
Total Posts:  146
Joined:  2009-03-13
Melbourne, Australia
 

You can get all the products list using the below code: 

$product Mage::getModel(’catalog/product’);
$productCollection $product->getCollection()->addAttributeToSelect(’*’);

// if needed filtering options here 

foreach ( $productCollection as $_product {
echo $_product->getName().’<br/>’;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
angelo_f
Sr. Member
 
Total Posts:  80
Joined:  2011-10-28
 

That is going to display every single product without a next / previous which will take forever. I was hoping to only display a certain number and have them press next or previous.

 
Magento Community Magento Community
Magento Community
Magento Community
 
thebod
Moderator
 
Avatar
Total Posts:  81
Joined:  2010-08-11
 

1,; learn the basics of Magento (check out the Magento U training)
2.: take a look into pagination and the setPage() method of collection
3.: take a look into the category functions and check out how Magento works there
4.: think about if this is really a security related topic…

 
Magento Community Magento Community
Magento Community
Magento Community
 
angelo_f
Sr. Member
 
Total Posts:  80
Joined:  2011-10-28
 

Sorry - I posted this to wrong forum

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