Remove sorting from the list, or remove sorting display in Prestashop 1.7 version
In 1.7 version of Prestashop , you can remove an item from the sorting list or remove the sorting display on the category page and search page, below I will describe how you can do this. Attention, the sort list may be supplemented by an external prestashop module that you install !!!
When you open a category page or a search page, you will see the item " sort by ":
This sorting list is output by the " ps_facetedsearch - Layered Navigation" module displayed in the " displayLeftColumn " hook.
Also on the left of the page, this module displays various filters (colors, price, types, etc.)
My topic is called "classic", in this topic I will indicate the paths to the sorting template.
1) List template "sort-orders.tpl" sorts are called in the template "products-top.tpl" along the way:
/themes/classic/templates/catalog/_partials/products-top.tpl
2) And the list template itself "sort-orders.tpl" lies along the way:
/themes/classic/templates/catalog/_partials/sort-orders.tpl
3) To remove the sorting display, you will need to go to the template "products-top.tpl (/themes/classic/templates/catalog/_partials/products-top.tpl)" and comment out the call to the template "sort-orders.tpl" it will be like this:
To remove a certain sort from the list, it is better to do what I described below.
1) Next, in order for us to change the list, remove or add an item in the list, we need to open the file "SearchProvider.php" format php along this path
\modules\ps_facetedsearch\src\Product\SearchProvider.php
2) Further in this file you will see a list of these sortings:
So you can change the list in your specified order.