0

I would like to set as the default order in the search results page "relevance" in descending order.

How can i do?

Thanks

1 Answer 1

0

Create a file named catalogsearch_result_index.xml at Venodr\Module\view\frontend\layout and paste the following code

 <?xml version="1.0"?>
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
 <referenceContainer name="content">
        <referenceBlock class="Magento\CatalogSearch\Block\SearchResult\ListProduct" name="search_result_list">
            <action method="setDefaultDirection">
                <argument name="dir" xsi:type="string">
                asc
                </argument>
            </action>
        </referenceBlock>
    </referenceContainer>
</body>

Now setDefaultDirection accordingly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.