Question

I have a website and I am using Magento 1.7.2 cart. I am also utilizing the Advanced Search. My problem is when you select "All" from Power Watts under advanced search then click search the product display page show up all messed up.

Here is my return page return.phtml code:

?>
<div class="page-title">
    <h1><?php echo $this->__('Catalog Advanced Search') ?></h1>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php if($this->getResultCount()): ?>
    <p class="advanced-search-amount">
        <?php echo $this->helper('catalogsearch')->__('<strong>%d item(s)</strong> were     found using the following search criteria', $this->getResultCount()); ?>
    </p>
<?php else: ?>
    <p class="error-msg"><?php echo $this->helper('catalogsearch')->__('No items were     found using the following search criteria.');?> <a href="<?php echo $this->getFormUrl(); ?    >"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?></a></p>
<?php endif; ?>

<div class="advanced-search-summary">
    <?php $searchCriterias=$this->getSearchCriterias(); ?>
        <?php foreach (array('left', 'right') as $side): ?>
            <?php if(@$searchCriterias[$side]): ?>
                <ul>
                    <?php foreach($searchCriterias[$side] as $criteria): ?>
                        <li><strong><?php echo $this->htmlEscape($this->helper('catalog')->__($criteria['name'])); ?>:</strong> <?php echo $this->htmlEscape($criteria['value']); ?></li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>
        <?php endforeach; ?>
        <?php if($this->getResultCount()): ?>
        <p>
            <?php echo $this->helper('catalogsearch')->__("Don't see what you're lookingfor?"); ?>
        <a href="<?php echo $this->getFormUrl(); ?>"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?></a>
        </p>
    <?php endif; ?>
</div>
<?php if($this->getResultCount()): ?>
<?php echo $this->getProductListHtml() ?>
<?php endif; ?>
<?php $this->getSearchCriterias(); ?>

Here is my catalog.xml file:

<?xml version="1.0"?>
<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/3columns.phtml</template></action>
        </reference>
        <reference name="left">
            <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
        </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="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>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/2columns-right.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="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>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>

Why is this doing this and how can get this page back to default? The layout for some reason cuts off and I need to be like the products pages.

Here is the link to the products page see how this lays out fine: http://www.webstertoolbox.com/index.php/products/genlume-collection.html

You can find the site here: http://www.webstertoolbox.com/index.php/catalogsearch/advanced/result/?name=&sku=&power_wattage%5B%5D=57

Let me know if you need anything else?

Was it helpful?

Solution

The problem is with your grid columns. They are 4 and should be 3.
Open the file app/design/frontend/{interface}/{theme}/layout/catalogsearch.xml, look for the tag catalogsearch_result_index.
Inside it there should be this line:

<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>

Change 4 into 3, clear the cache and try again.

OTHER TIPS

Marius is partially correct, but you'll want to change it in your local.xml: app/design/frontend/{theme}/{variant}/layout/local.xml

In there add:

<catalogsearch_advanced_index>
    <reference name="search_result_list">
        <action method="setColumnCount">
            <count>3</count>
        </action>
    </reference>
</catalogsearch_advanced_index>

for the quick search (searching from the search bar):

<catalogsearch_result_index>
    <reference name="search_result_list">
        <action method="setColumnCount">
            <count>3</count>
        </action>
    </reference>
</catalogsearch_result_index>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top