grupaperun Posted March 8, 2021 Share Posted March 8, 2021 Hey guys, in my client's shop there are many products with similar names. Sometimes difference is in the third or fourth word. Sometimes these different parts of the names are in quotes or apostrophes and here is the problem. How to set alphabetical product sorting to ignore quotes and apostrophes in product names? Example Default sorting by names: 1. Product 'Delta' 2. Product Alpha 3. Product Beta 4. Product Gamma Should be: 1. Product Alpha 2. Product Beta 3. Product Gamma 4. Product 'Delta' Anyone knows how to fix this? Link to comment Share on other sites More sharing options...
musicmaster Posted March 8, 2021 Share Posted March 8, 2021 The easiest approach would be to sort by the link_rewrite field instead of by name. Link-Rewrite is used for making the links when pretty links are enabled. There is one catch: where should you make those changes. It depends: of the Faceted Search module is active you should make it there. Otherwise you should make it in the getProducts function in /classes/Category.php Link to comment Share on other sites More sharing options...
grupaperun Posted March 8, 2021 Author Share Posted March 8, 2021 3 hours ago, musicmaster said: The easiest approach would be to sort by the link_rewrite field instead of by name. Link-Rewrite is used for making the links when pretty links are enabled. There is one catch: where should you make those changes. It depends: of the Faceted Search module is active you should make it there. Otherwise you should make it in the getProducts function in /classes/Category.php Thank you for your reply. Default products sort order is set in BO to Product Name. It can be change in category page using dropdown menu but there is no option to sort by link_rewrite. Module ps_facetedsearch is active in our store. Can you guide me what I need to change? Link to comment Share on other sites More sharing options...
musicmaster Posted March 8, 2021 Share Posted March 8, 2021 (edited) In the file /modules/ps_facetedsearch/src/Adapter/MySQL.php I have added the lines marked with "QQQ" in the attached file MySQL.php Edited March 8, 2021 by musicmaster (see edit history) 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