开发者

Magento - change Sort order to Name in Search Result

开发者 https://www.devze.com 2023-03-12 11:52 出处:网络
how can change Sort order to Name in开发者_开发技巧 Magento Search Result page? Thanks for help.In your theme (for example /app/design/frontend/{your-interface}/{your-theme}/layout/) create a file lo

how can change Sort order to Name in开发者_开发技巧 Magento Search Result page?

Thanks for help.


In your theme (for example /app/design/frontend/{your-interface}/{your-theme}/layout/) create a file local.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <catalogsearch_result_index>
        <reference name="search_result_list">
            <action method="setDefaultDirection"><param>asc</param></action>
            <action method="setSortBy"><param>name</param></action>
        </reference>
    </catalogsearch_result_index>
    <catalogsearch_advanced_result>
        <reference name="search_result_list">
            <action method="setDefaultDirection"><param>asc</param></action>
            <action method="setSortBy"><param>name</param></action>
        </reference>
    </catalogsearch_advanced_result>
</layout>


Add &order=name to your query string. In order to do it go to /app/design/frontend/{your-interface}/{your-theme}/template/catalogsearch/advanced/form.phtml and add

<input type="hidden" name="order" value="name"/>

just before closing </form> tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消