Search Results Page – Wrong Number of Products Per Page in Magento

catalogsearchpagerpagination

In search results page, I'm not getting the correct number of products on each page. I have set the following in local.xml file:

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalogsearch_result_index>
        <reference name="product_list_toolbar">
            <action method="addPagerLimit"><mode>grid</mode><limit>30</limit></action>
            <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action>
        </reference>
    </catalogsearch_result_index>
</layout>

The limiter selectbox in pagination toolbar, indeed displays "Show 30" as selected value. But in product list, there are only 9 products displayed in each results page.

I can't find a solution to this, any suggestions?

Best Answer

Well done for doing local.xml, however, for the list part of category and search result pages layout updates in local.xml cannot be relied upon. I cannot fully remember the reason for this, but I think this is the problem here!!!

Try moving your layout updates to the .xml files in your theme (as copied from base, the proper Magento way).

If this does not work... Maybe the templates rather than the layout is where the problem is.

The search results use the same category list templates as the main category pages. The side nav, header and other page elements may be different but that main list template is the same.

Go into admin->system->config->catalog->catalog and change the products per page there, as predicted this should affect the products in your template.

Next, how to fix. If it wasn't the local.xml problem mentioned above, I suspect that the $collection is being created properly, paginating on 30, however, the template is hard wired to different settings, to show 9. If this changes based on the catalog admin settings you are nearer to knowing what is going on.