*

morfik

  • ****
  • 169 posts
Can the regions be alphabetically sorted?
« on: February 17, 2023, 11:40:17 AM »
When you search something, you are able to specify the region field by selecting an item from it. But the items aren't sorted. Is there a way to sort them, so a user could easier select what he wants instead of searching the one position he's looking for? The same problem is with posting an ad.

*

morfik

  • ****
  • 169 posts
Re: Can the regions be alphabetically sorted?
« Reply #1 on: February 18, 2023, 12:55:16 AM »
It looks like there's another bug (or actually two) in Osclass Geolocation data.

The problem with sorting I had was a result of the following thing. When a user imports the geo data, the action adds some entries to the database. There are the following columns in the region table: s_name and s_name_native. I noticed that the Polish geo data isn't fully translated, so I translated it and placed English names of Polish regions in the s_name table (as it should be), and the translation in s_name_native (because of the preferred native names in the Osclass settings). The names were translated in the front website, but in some places in the dashboard (i.e. Listings > Manage listings) there were English names -- this is the fist bug. The ordering issue on the front website was because the ordering was done by s_name column and not by s_name_native. When I changed the values in s_name to the ones in s_name_native, and added a new ad, I finally saw in the Dashboard (under Listings > Manage listings) Polish names of regions. Also while adding an ad, I noticed that the order of the regions in the location bar on the front page is alphabetically sorted, which also solved this issue.

To sum up. The region (and possibly country and city) entries should be sorted the native names (if they set in the Osclass settings), and if not, then use normal English names.

There's also another issue concerning sorting. Positions starting with non ASCI characters are always at the end of the list. For instance, in Polish we have the letter Ł which comes after the letter L (in out alphabet), but when some region starts with the Ł letter, it will be placed on the list as the last one item just right after the letter Z. Can this be fixed?
« Last Edit: February 18, 2023, 12:58:06 AM by morfik »

*

MB Themes

Re: Can the regions be alphabetically sorted?
« Reply #2 on: February 25, 2023, 01:51:45 PM »
@morfik
No plans to invest time on this right now.
Maybe in future version.
You may check model/City.php, model/Region.php, ....
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots