Set Page Limit for Category and Prevent Changes

categorypager

I want to set specific page size for one category, I do this in Custom Layout Update this way:

<reference name="product_list_toolbar">
    <action method="addPagerLimit"><limit>2</limit></action>
    <action method="setDefaultGridPerPage"><limit>2</limit></action>
    <action method="setDefaultListPerPage"><limit>2</limit></action>
</reference>

It works as intended – default limit is 2, but when I change the limit in other category (e.g. to 9) it is now current limit.
Probably limits are stored in users session.

I would like to override current limit in this particular category, to be 2 all the time. I tried methods setCurrentLimit and setLimit but both doesn't work.

Best Answer

I have created an extension for this. You can find the extension here. It is absolutely free.

The advantage of my module over yours is, it does not use any rewrites. In Magento, it is better to avoid rewrites if possible. So have a look on my extension and make an idea and modify as per your need. I think in your case, you can directly use my extension.

Also you can find more details on how can we limit page size in my blog.

Related Topic