1

My category grid works fine, page 1 shows products 1-100, page 2 shows 101-200 and so on.

However, on the search results page, all results are listed on the first page, so page 1 shows results 1-289 for example. And the pager information next to the number of pages says "PRODUCTS 1 TO 289 OF 289". The number of pages is calculated and displayed correctly.

When I investigate the collection I can see that something's wrong:

echo $collection->getPageSize(); // 100
echo $collection->getCurPage(); // 1
echo $collection->count(); // 138 -> This should also be set to 100, as the current page is 1 and the page size is 100..

And looking at the query for the collection, I see that it's missing the LIMIT 100 right at the end of the query.

Does anybody know what could be causing this?

closed as off-topic by kab8609, Marius Feb 17 '15 at 20:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Marius
If this question can be reworded to fit the rules in the help center, please edit the question.

  • did you install any extension that could overwrite the search layered navigation? – Alex Dinca Feb 14 '15 at 12:10
2

I'm still not 100% sure what caused this odd behavior, but I solved it by defining a pager limit for the search result page by adding this into my theme's local.xml:

<catalogsearch_result_index>
    <reference name="product_list_toolbar">
        <action method="addPagerLimit"><mode>grid</mode><limit>20</limit></action>
        <action method="addPagerLimit"><mode>list</mode><limit>20</limit></action>
    </reference>
</catalogsearch_result_index>

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