Pekkhyu Posted March 27, 2019 Share Posted March 27, 2019 (edited) Hello everyone, I try to edit the "sort by" select in my site and I want to obtain theese 4 options: 1) From relevance (and it's ok, I modify the position in Catalog-Products) 2) from the most recent to the oldest 3) from the oldest to the most recent 4) by popularity I found the file Ps_FacetedsearchProductSearchProvider.php in modules\ps_facetedsearch\src\Ps_FacetedsearchProductSearchProvider.php and I obtained the first 3 of 4 options that i need. I modify the code at line 117 and there is the result: private function getAvailableSortOrders() { return [ (new SortOrder('product', 'position', 'asc'))->setLabel( $this->module->getTranslator()->trans('Relevance', array(), 'Modules.Facetedsearch.Shop') ), (new SortOrder('product', 'date_add', 'desc'))->setLabel( $this->module->getTranslator()->trans('Da più recente a meno recente', array(), 'Shop.Theme.Catalog') ), (new SortOrder('product', 'date_add', 'asc'))->setLabel( $this->module->getTranslator()->trans('Da meno recente a più recente', array(), 'Shop.Theme.Catalog') ), ]; } I don't know what to write for the last option = BY POPULARITY Anyone can help me? Thanks! P.S: Sorry for my bad english, I'm an italian guy Edited March 27, 2019 by Pekkhyu (see edit history) Link to comment Share on other sites More sharing options...
saditens Posted April 24, 2019 Share Posted April 24, 2019 Ciao, hai risolto? Io volevo aggiungere la lista delle marche, quindi ordinare per marca.. Hai qualche idea? Grazie Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now