I would like to set as the default order in the search results page "relevance" in descending order.
How can i do?
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityCreate 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