Magento set limit for products


Below code will call limit products with function getLoadedProductCollection().
Here, I use function setPageSize() and I set a variable is numbers of products need to show.

I get an example is file template/catalog/product/list.phtml in default of Magento Enterprise

Add after this line code in template/catalog/product/list.phtml:


By this code:

$_productCollection = $this->getLoadedProductCollection();
$numberItems = 5; //set 5 products
if(is_numeric($numberItems) && $numberItems > 0) {


After, clear all cache, reload and see result


Have a nice day!

One thought on “Magento set limit for products

Comments are closed.