Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - change Sort order to Name in Search Result

Tags:

magento

how can change Sort order to Name in Magento Search Result page?

Thanks for help.

like image 749
Ahmed Ala Dali Avatar asked Jun 10 '11 08:06

Ahmed Ala Dali


People also ask

How do I change the sorting in Magento?

To change the product sorting, navigate to Catalog > Categories and choose the Store View that you want to change. Then select the needed category, open the Products in Category tab, and edit the Position column. Save the changes.

How do I change the order of categories in a Magento 2?

Reorder Magento 2 Categories Using the Drag and Drop Feature To manage categories in the Magento admin go to Catalog -> Manage Categories. On the left, you will see a category tree. To view all parent categories and subcategories, click 'Expand All'. To rearrange the position of a category, drag it to a new position.


1 Answers

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>
like image 114
Alex Avatar answered Nov 29 '22 07:11

Alex