Skip Navigation

[Resolved] Both my home page Zip code search and Map search are not working.

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 18 replies, has 2 voices.

Last updated by jessicaM-4 3 years ago.

Assisted by: Jamal.

Author
Posts
#2005329

Tell us what you are trying to do?

I need the zip code search for my map to filter through existing locations.
Is there any documentation that you are following?
Trying to follow toolsets but the examples they have seem to be for a newer more visual version of toolset.
Is there a similar example that we can see?
hidden link. On the home page and locations page.
What is the link to your site?

hidden link

#2005405

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

Make sure that the view has a filter rule, in the Query filter section, that corresponds to the existing filter in the search section.

If that does not help, please allow me temporary access to your website to check this view further. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2005495

I do have a javascript filter in place but am unsure if everything is connecting properly. Here is the code I currently have in place.

jQuery(document).ready(function($){

$('select[name="toolset_maps_distance_unit"] option[value="km"]').remove();
jQuery('#toolset-maps-distance').hide();
jQuery('input[name="toolset_maps_distance_center"]').prop('Zip Code');
});

#2005507

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

The WordPress credentials do not work for me. Can you test from your side if you can log in with them. Update your previous reply or your next one with working credentials.

Regarding the custom code, I don't understand what you want it to do. But, I'll suggest that you remove it and test it.

Once I get working credentials, I'll check the view further.

#2005541

So essentially what I want to do is have a zip code search from the home page to the map page and also one on the map page. The services dropdown seems to work fine but not the ZIP search.

#2005543

Also, I see online that there is or was a support chat with Toolset. Is that still available? It might be easier to explain what I need if we could chat together for a min.

#2005549
#2006383

Good Morning,

Were you able to access the backend of the site?

#2007597

Hello, could I get a response on this ticket, please? I feel like I'm close to solving the issue but need your help to get over the hump.

#2008233

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and my apologies for the late reply, but I do not work on Wednesdays and Thursdays as you can see on my profile page https://toolset.com/forums/users/jamal-b/

I confirm I can access the backend. I'll check this further and get back to you as soon as possible.

#2008471

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

We do offer chat. If no supporter is available to chat, the support will only offer to create a ticket.

Regarding the /service-map/ page, you are using two views, when you need to use only one of them:
- The search filters are from the "Map Search" view hidden link
- The results(map, and markers) are from the "Locations" view hidden link

I copied the search filters from the "Map Search" view to the "Locations" view, and I rebuilt the underlying query filters. We only need a taxonomy filter and a distance filter. The taxonomy filter seems to work, but the distance filter is not.

The distance search will not work because the database version does not support geolocation distance. The current database version is 5.5.68-MariaDB, and I think it is equivalent to MySQL 5.5. The distance search requires MySQL 5.6 and above, which I believe is equivalent to MariaDB 10. Check the Toolset requirements https://toolset.com/toolset-requirements/
Check this article hidden link

The page is built using Divi, and you want to display the search form in a different Divi module than the results, right? Unfortunately the current Toolset View module does not allow that, so we have to workaround it using shortcodes:
- Display the form using wpv-form-view shortcode:

{!{wpv-form-view name='locations'  target_id="self"}!}

- Display the results using wpv-view shortcode:

{!{wpv-view name='locations' view_display='layout'}!}

If you want to display the form on a different page and point it to this page for results, use this, where 3277 is the ID of the results page:

{!{wpv-form-view name='locations'  target_id="3277"}!}

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-1496531

After upgrading your database server version, please make sure to visit all location posts on the backend and that each post marker appears on the address field. This will ensure that all the posts have the geolocation data stored in the database and can be used in distance searches.

I hope this helps. Let me know if you have any questions.

#2011129

Hello Jamal,

Thank you so much for the help and advice. Using two views was really throwing me off. I do have a question about the comment you made below.

"The distance search will not work because the database version does not support geolocation distance. The current database version is 5.5.68-MariaDB, and I think it is equivalent to MySQL 5.5. The distance search requires MySQL 5.6 and above, which I believe is equivalent to MariaDB 10. Check the Toolset requirements https://toolset.com/toolset-requirements/
Check this article hidden link"

The strange thing is I already have this set up using the same type of database on another site. It's here on the locations page hidden link. And you can search from the home page hidden link. This is essentially what I am trying to accomplish with this new site as well.

So are you saying that Toolset has been updated. And this feature will not work on new instances of Toolset with my current database configuration? Is it because the hidden link site was built with an older version of
Toolset that allows the location search to work?

#2011469

Hey Jamal,

Also, I'm a little confused why the list of locations is also showing under the map.

#2011953

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I have added the list for my debugging just to have quick access to Locations posts, you can remove them now. I find out the cause of the distance search issue.

Toolset Maps has a limit of 10 requests to Google Maps API in order to not exceed the API limit, which I was thinking of at first. It turned out that one post did not have an address in the cache. When I added it I got 11 locations.

So, I migrated your website into our platform to make sure that's not a server issue(database in this case), and the issue was reproduced. So, I run more tests, and the distance was working when I use the "Use my location" button, by mocking my browser address to a nearer location to the posts, and the search worked correctly.
When we enter an address in the address field, it did not work. This means that the geolocation request to convert the search address into latitude, longitude did not work as expected.

So, I used our Google Maps API key, on the migrated site, and it worked as expected.

I think that your Google API key is restricted for server-side requests. You should check the API key configuration in the Google Dashboard, to check for any configuration that is blocking the server from doing API calls. You can add a secondary key to be used only by the server.

You can check my test page in the migrated site for a 10km search from a nearer location "McClellanville South Carolina"
hidden link

#2019041

Can you help me remove the list from the map page.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.