robinbrorsson Posted November 20, 2017 Share Posted November 20, 2017 I have a problem with my prestashop version 1.7.2.2. When I search for a reference. for example: TB-BOX-IP44 I get many results, most of them seem to react on the "BOX" part. Since there is many other products that have box in reference or description. however there is one product that has an exact match. But the exact match product almost allways comes last in the results. Seems there relevance order is reversed somehow. any ideas? /Robin Link to comment Share on other sites More sharing options...
cvwcreative Posted December 20, 2017 Share Posted December 20, 2017 I'm also experiencing this issue Link to comment Share on other sites More sharing options...
bTk Posted February 8, 2018 Share Posted February 8, 2018 Hi guys, after strugling with this issue for quite some time I finally found a solution. This fix involves changes in "Src" folder, so it isn't "elegant". My version of Presta is 1.7.2.4. Here goes: 1) in file "./src/Core/Product/Search/SortOrderFactory.php" change line 44 from: (new SortOrder('product', 'position', 'asc'))->setLabel( to: (new SortOrder('product', 'position', 'desc'))->setLabel( 2) in file "./controllers/front/listing/SearchController.php" change line 67 from: ->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), Tools::getProductsOrder('way'))) to ->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), 'desc')) 2 Link to comment Share on other sites More sharing options...
pikkio92 Posted November 6, 2019 Share Posted November 6, 2019 On 2/8/2018 at 1:47 PM, bTk said: Hi guys, after strugling with this issue for quite some time I finally found a solution. This fix involves changes in "Src" folder, so it isn't "elegant". My version of Presta is 1.7.2.4. Here goes: 1) in file "./src/Core/Product/Search/SortOrderFactory.php" change line 44 from: (new SortOrder('product', 'position', 'asc'))->setLabel( to: (new SortOrder('product', 'position', 'desc'))->setLabel( 2) in file "./controllers/front/listing/SearchController.php" change line 67 from: ->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), Tools::getProductsOrder('way'))) to ->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), 'desc')) this absolute work! Thanks 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