1

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.

2
  • Your solution is not perfect, because of hardcoded category IDs, but still better than mine. I just tweaked it to use Custom Layout Update xml and is perfect. – mkutyba Apr 24 '15 at 8:27
  • i didnt say you need to acxept my answer in fact. If you feel, your answer is better, please accept yours itself. second my extension is intended for developers and not for merchants. its an experiment. I think you at least study how can do this in better way and that is what I want. :) – Rajeev K Tomy Apr 24 '15 at 9:02
2

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.

3

I did it by overriding Mage_Catalog_Block_Product_List_Toolbar and creating method setCurrentLimitValue:

public function setCurrentLimitValue($limit)
{
    $this->setData('_current_limit', $limit);
}

Then in Custom Layout Update for category I added:

<action method="setCurrentLimitValue"><limit>2</limit></action>
0

Here is the best free magento extension available on magento marketplace.

https://marketplace.magento.com/invigoratesystems-module-productsizecategorywise.html

it allows admin to set category wise page limit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.