Skip Navigation

[Resolved] Filter by distance field not working as expected

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

Problem: I have a custom search View that displays results on a map, with a distance filter. The distance filter does not seem to be working.

Solution: Check the URL parameter in the Query Filter and make sure it matches the URL parameter in the filter control shortcode - "toolset_maps_distance_center"

This support ticket is created 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by Franck 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#906204
Capture d’écran 2018-05-30 à 15.28.53.png

Hello,

I try to filter by distance field, but it doesn't work. So i don't know what i have to do. I show you my query filter on picture and here my shortcode.

It is my page : hidden link

The view is view_id=195

Thanks for your help.

#906328

Hi can you tell me more about this page?
- Is this a custom search View, or a WordPress Archive? Distance filters are not currently supported in WordPress Archives.
- Please take a screenshot of the full editor screen so I can see all the Query Filters and content selection.
- Please copy + paste the code from your Filter Editor panel for me to review.

#906339

No it is view.
How i can do this ? Please copy + paste the code from your Filter Editor panel for me to review.

#906367

I apologize for the confusion, I just realized that in the new system the panel is called "Search and Pagination", not Filter Editor. It's the panel where all the custom search filter shortcodes and pagination shortcodes are added. If you cannot see the panel, you may have to enable it in the Screen Options tab at the top right corner.

#906660
3.jpg
2.jpg
1.jpg

Hello,

You can see picture and code.

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="distance-bloc">
[wpv-control-distance default_distance="50" compare_field="adresse-precise" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="Découvrez les programmes à %%DISTANCE%% de %%CENTER%%"]
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Typologie[/wpml-string]</label>
<div class="typologie-bloc">
[wpv-control-postmeta field="wpcf-typologie" url_param="wpv-wpcf-typologie"]
</div>
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Dispositif[/wpml-string]</label>
<div class="dispositif-bloc">
[wpv-control-post-taxonomy taxonomy="dispositif" type="select" url_param="wpv-dispositif"]
</div>
</div>
[/wpv-filter-controls]
[wpv-filter-end]

#906950

It appears that the URL parameters in your Query Filter and your Search and Pagination panel have become out of sync somehow. Please edit the Distance Query Filter and modify the value of "Distance center is set using URL parameter" to be "toolset_maps_distance_center". This will correspond with the filter added in Search and Pagination. Let me know if this does not resolve the problem.

#906977

Thanks a lot