0

How can I change the number of products shown per row in the search results page in Magento? The layout is currently three products per row and I would like it to be five products per row.

Would this be a change within the 'catalogsearch.xml' file?

I have the following in my catalogsearch.xml file:

        <layout version="0.1.0">

            <default>
                <reference name="header">
                    <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
                </reference>
                <reference name="footer_links">
                    <action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
                        <label>Search Terms</label>
                        <url helper="catalogsearch/getSearchTermUrl" />
                        <title>Search Terms</title>
                    </action>
                    <action method="addLink" translate="label title" module="catalogsearch">
                        <label>Advanced Search</label>
                        <url helper="catalogsearch/getAdvancedSearchUrl" />
                        <title>Advanced Search</title>
                    </action>
                </reference>
            </default>

            <catalogsearch_result_index translate="label">
                <label>Quick Search Form</label>
                <reference name="root">
                    <action method="setTemplate"><template>page/1column-cms.phtml</template></action>
                </reference>
                <reference name="left_first">
                    <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml">
                        <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
                    </block>
                </reference>
                <reference name="content">
                    <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
                        <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                            <block type="core/text_list" name="product_list.name.after" as="name.after" />
                            <block type="core/text_list" name="product_list.after" as="after" />
                            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                                <block type="page/html_pager" name="product_list_toolbar_pager"/>
                            </block>
                            <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>one_column_cms</layout><count>5</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                        </block>
                        <action method="setListOrders"/>
                        <action method="setListModes"/>
                        <action method="setListCollection"/>
                    </block>
                </reference>
            </catalogsearch_result_index>

            <catalogsearch_advanced_index translate="label">
                <label>Advanced Search Form</label>
                <!-- Mage_Catalogsearch -->
                <reference name="root">
                    <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
                </reference>
                <reference name="head">
                    <action method="setTitle" translate="title" module="catalogsearch"><title>Advanced Search</title></action>
                    <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
                    <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
                    <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
                </reference>
                <reference name="content">
                    <block type="catalogsearch/advanced_form" name="catalogsearch_advanced_form" template="catalogsearch/advanced/form.phtml"/>
                    <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
                </reference>
            </catalogsearch_advanced_index>

        <!--
        Advanced search results
        -->

            <catalogsearch_advanced_result translate="label">
                <label>Advanced Search Result</label>
                <update handle="page_two_columns_right" />
                <!-- Mage_Catalogsearch -->
                <reference name="root">
                    <action method="setTemplate"><template>page/1column-cms.phtml</template></action>
                </reference>
                <reference name="content">
                    <block type="catalogsearch/advanced_result" name="catalogsearch_advanced_result" template="catalogsearch/advanced/result.phtml">
                        <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                            <block type="core/text_list" name="product_list.name.after" as="name.after" />
                            <block type="core/text_list" name="product_list.after" as="after" />
                            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                                <block type="page/html_pager" name="product_list_toolbar_pager"/>
                            </block>
                            <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>one_column_cms</layout><count>5</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                        </block>
                        <action method="setListOrders"/>
                        <action method="setListModes"/>
                        <action method="setListCollection"/>
                    </block>
                </reference>
            </catalogsearch_advanced_result>

            <catalogsearch_term_popular translate="label">
                <label>Popular Search Terms</label>
                <remove name="right"/>
                <remove name="left"/>

                <reference name="head">
                    <action method="setTitle" translate="title" module="catalogsearch"><title>Search Terms</title></action>
                </reference>
                <reference name="root">
                    <action method="setTemplate"><template>page/1column.phtml</template></action>
                </reference>
                <reference name="content">
                    <block type="catalogsearch/term" name="seo.searchterm" template="catalogsearch/term.phtml"/>
                </reference>
            </catalogsearch_term_popular>

        </layout>

The catalog search is set to be 1column-cms layout but the column count is three when I'm looking for it to be five.

Can anyone please advise?

  • you need to explain what you want and I think you should first google and then ask it. if you mean the columns per row you can do it in layout magento.stackexchange.com/questions/35957/… – Nickool Oct 19 '15 at 21:29
  • Thanks Negin updated - the answer you linked to doesn't work for me - but I've added my layout above. – YorkieMagento Oct 19 '15 at 21:53
  • please turn on your template path hints and let me know what is the phtml file, give me the whole path, then I will see if you are in the right xml file. – Nickool Oct 19 '15 at 21:54
  • It appears to be list.phtml that contains the search results Negin. – YorkieMagento Oct 20 '15 at 6:38
0

I have achieved this by adding the following code to the catalogsearch.xml file:

<action method="setColumnCount"><count>6</count></action>

Thank you.

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.