Home » Magento tutorials » How to limit the collection of a model in Magento

How to limit the collection of a model in Magento

Sometimes, we want ti limit the collection of a model in Magento. In this quick tutorial, I will show you how to do that. I will use catalog product module for this example.

First, you can set number of products to be displayed in one page by using  setPageSize()  method.

Ypu can also display 10 items starting from the 5th item

About Gareth

avatar
Gareth is an editor at Tutorial Magento. His special hobby is to share magento knowledge and experience with everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Scroll To Top