Skip Navigation

[Resolved] Toolset Distance filter does not work

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to order a view results by distance.

Solution:

  1. Remove Toolset Maps cache
  2. Remove the existing Distance filter
  3. Add a new Distance filter
This support ticket is created 4 years, 6 months 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 5 replies, has 2 voices.

Last updated by matthewS-9 4 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#1684321

Tell us what you are trying to do?

1. We have a custom post type "Doctor" with a custom field "Map Address".

2. A doctor with a Map Address value "1300 Broadway Ste 1200, Denver, CO, 80203, United States" was added.

3. We want to show this Doctor/Address in a View.

4. We have a View with the Filter below:

[wpv-control-distance distance_unit_url_param="toolset_maps_distance_unit" distance_radius_url_param="toolset_maps_distance_radius" distance_center_url_param="toolset_maps_distance_center" compare_field="map-address" default_unit="mi" inputs_placeholder="Distance: %%DISTANCE%% of %%CENTER%%"]

5. This Query Filter below was automatically added when the Filter Control was added.

Distance
Show posts within 5mi radius of address/coordinates provided using toolset_maps_distance_center URL parameter.

6. We accessed the View and nothing was shown.

7. If we remove the Query Filter in 5. then the Doctor/Address can be shown in the View.

8. We want that the Doctor/Address can be shown in the View so that we can filter the Doctors by Distance.

Please advise.

What is the link to your site?

1. hidden link

2. Admin account: [Credentials moved to private reply]

#1685319

Please advise or let us know if the issue of the component has been being addressed.

#1685409

Hello and thank you for contacting the Toolset support.

I checked the view and it has some control filters that do not have an associated query filter. For example:
- The contact control filter does not have an associated query filter.

[wpv-control-postmeta field="wpcf-contact-name" url_param="wpv-wpcf-contact-name"]

- The training service control filter does not have an associated query filter.

[wpv-control-postmeta field="wpcf-training-services" url_param="wpv-wpcf-training-services"]

I'll suggest removing these control filters and recreate them again, this will create the underlying query filter associated with them. If that does not help. Please create another view that holds only the distance filter and let us first check it.
Then we'll add other control filters gradually.

#1685497

We have removed all the other filters but the issue still persists.

Please review it here and advise:

hidden link

hidden link

#1685527

I recreated the view with a higher distance(100mi) to check how it will perform to no avail. I, then, removed all the cached location data in Toolset->Settings->Maps and it seems to fix the issue. Check this screenshot hidden link

I remain at your disposal.

#1685617

Sometimes the Distance filter does not work and we need to
1) remove the cache, then
2) remove the existing Distance filter, then
3) add a new Distance filter.

We need to follow the procedure above exactly or nothing will work.

If we have thousand of entries in the cache then it will be an issue because Toolset only allows us to remove one entry at a time.

Hope that this issue will be fixed in the future.