*

morfik

  • ****
  • 169 posts
There's a nice window in the delta theme on the home page which allows users to search for some city -- they simply select the city/region box and start typing. This window works just fine, i.e. when I search for śliwno , the popup with Śliwno appears and I can select it and the seach page with this city loads. It also react for the sliwno phrase which also shows Śliwno in the popup.

There's similar search box for region/cities on the publish ad page. So I select the region, the city filter box shows now cites, I type śliwno and nothing appears in the city filter. But when I type liwno without the Polish ś, the box shows Śliwno in the filter. It looks like the phrase sliwno also works here.

It looks like the two search city/region mechanisms use different semantics for returning results. So how to fix the publish page city/region search so it behaved the way the search city/region box on home page does?
« Last Edit: March 10, 2023, 05:29:40 PM by morfik »

*

MB Themes

Re: Searching for cities on the home page and on the publish page
« Reply #1 on: March 10, 2023, 07:44:33 PM »
Box on publish page only filter results those are already loaded by javascript.
In past we've been fixing it for romanian characters and it works just fine.
Is there problem just with that one character?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Searching for cities on the home page and on the publish page
« Reply #2 on: March 10, 2023, 07:58:55 PM »
No, it's with all Polish characters.

Here's the list:
https://en.wikipedia.org/wiki/Polish_alphabet#Computer_encoding

*

MB Themes

Re: Searching for cities on the home page and on the publish page
« Reply #3 on: March 15, 2023, 01:46:21 PM »
@morfik
That's clear to me :D

In global.js find this line (line 39):
Code: [Select]
var term = ($(this).val()).trim();
Below this line add:
Code: [Select]
term = term.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
It should change Śliwno into Sliwno and search just without special char using jquery regex.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Searching for cities on the home page and on the publish page
« Reply #4 on: March 15, 2023, 02:06:56 PM »
Yes, it does. So what about the other letters? Should I add more lines like the one you've provided?

*

MB Themes

Re: Searching for cities on the home page and on the publish page
« Reply #5 on: March 15, 2023, 02:18:25 PM »
@morfik
It's not letter-specific fix  ::)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Searching for cities on the home page and on the publish page
« Reply #6 on: March 15, 2023, 02:19:32 PM »
So it should work for all of the Polish letters?

*

MB Themes

Re: Searching for cities on the home page and on the publish page
« Reply #7 on: March 15, 2023, 02:20:41 PM »
I always prefer first try and then ask
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Searching for cities on the home page and on the publish page
« Reply #8 on: March 15, 2023, 02:22:40 PM »
Actually I did, but it looks like that the cache plugin doesn't work well with this city/region filters. I disabled it, and it looks like it works.

*

MB Themes

Re: Searching for cities on the home page and on the publish page
« Reply #9 on: March 15, 2023, 02:37:31 PM »
Maybe there is some conflict. How to reproduce?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Searching for cities on the home page and on the publish page
« Reply #10 on: March 15, 2023, 03:07:25 PM »
Enable cache for home page for instance or where these filter fields are used.
Open the page, cache will be generated.
Try to search for a city using this filter.