B-219 Sec-55 Noida, India

How to limit the collection of a model in Magento

In this post, I will show you how to limit the collection of a Model in Magento. I will use catalog product module for this example.

First, you can use setPageSize() method for setting number of items you want to display in one page.


The second example is to display 10 items from a 5th item

    $start = 5;
    $limit = 10;
    $collection = Mage::getModel(‘catalog/product’)->getCollection();

(Visited 69 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.