I am trying to: Filter posts by location
Link to a page where the issue can be seen: hidden link
I expected: Posts to be sorted by their location data provided by the Toolset Address field.
Instead, I'm only receiving search query feedback, and no results for location searching.
All Toolset plugins are up to date, along with WordPress and the Divi theme. I'm also using a plethora of other plugins, most notably GeoDirectory and Relevanssi Premium.
I am attempting to create a directory listing site that lists dogs that can provide frozen assets to clients. Each dog has a location associated with it, so that a user may search for a dog breed in their area.
I created a layout that contains a WordPress Archive cell that is configured to allow customized searching and filtering. I've been able to successfully filter my posts with the taxonomy filters so far. When I started noticing that location data provided by GeoDirectory was not making it through to the archive's filtered results, I figured I could rely on Toolset's location fields data to achieve what I was looking to do.
Here's what I have:
I created the appropriate URL parameters via the Filter Editor with the following shortcodes:
[wpv-filter-search-box output="bootstrap"]
[wpv-control-distance default_distance="20" default_unit="mi" compare_field="address" 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="%%DISTANCE%% %%CENTER%%"]
I then, replicated these fields in a different cell with my own fields referring to the same URL parameters:
<form id="breed-search" method="GET" action="/dogs">
<input type="text" name="wpv_post_search" placeholder="Search Dog Breed">
<input type="text" name="toolset_maps_distance_center" placeholder="Search Location">
<input type="hidden" name="toolset_maps_distance_radius" value="30">
<input type="hidden" name="toolset_maps_distance_unit" value="mi">
<input type="submit" name="wpv_filter_submit" value="u">
</form>
When I run an example search from my fields, the values are reflected in the Toolset filter fields, so there is communication between my fields, and the filter fields. So for example, I search "labrador" near "erie, pa", I get the appropriate URL parameters showing up in the address bar:
/?wpv_post_search=labrador&toolset_maps_distance_center=erie%2C+pa&toolset_maps_distance_radius=30&toolset_maps_distance_unit=mi&wpv_filter_submit=u
...which are near identical to filter fields
/?wpv_view_count=638&wpv_post_search=labrador&toolset_maps_distance_radius=30&toolset_maps_distance_unit=mi&toolset_maps_distance_center=erie%2C+pa&wpv_filter_submit=Submit
The only parameter I'm lacking is the wpv_view_count and the wpv_filter_submit value. That would matter if the Toolset fields functioned as I'd expect them to, but they're not. In this example, I have two posts associated with the "Labrador Retriever" term under the "Dog Categories" taxonomy. One is "located" in Harborcreek, PA, and the other is associated with Pittsburgh, PA. These two locations are approximately 128 miles apart, well outside my 30 mile radius limit. Both posts show up when I run my search as described above. Running an exact search for a "labrador retriever" near "harborcreek, pa" produces the same results.
As I stated, I was using GeoDirectory for location searching, but since it wasn't working, I have since disabled the Google Maps API for the plugin, to see if there was a conflict between GD's map API and Toolset's. Previously, in the inspector's console, it stated that I was using multiple Google Maps APIs, which could cause errors, and since disabling the API for GD, it now states, "Maps API Not Loaded :("
GeoDirectory's implementation is required, as now its purpose is to strictly provide a shopping cart for directory listing packages. It'll handle PayPal subscriptions for recurring payments, as well as cancelling and expiring packages. The post type "Dog" is a CPT made through GD, not Toolset, so if I disable GD, to troubleshoot, I also lose all my posts.
Regarding Relevanssi. For whatever reason, without it, I'm unable to get results, but I suspect it might be interfering. It's also highly likely that I have something configured incorrectly, but the goal was to focus search results on taxonomy terms of "Dog Categories" (dog breeds), versus the post title or body. The logic here is that the post title is going to be the dog's name, as it wouldn't make sense to name the post after the dog's breed, of which there will likely be many. No one is going to search for a dog's name, they're going to search for the dog's breed, which is needed as a filterable item anyway.
I'm sorry if this rather long winded, but I've been tossing this around for awhile, so I'm hoping I could get some assistance from you guys as I got everything into the Toolset world. By all accounts, it (hopefully) shouldn't matter what GD is doing, as all the information provided in the archives is populated by Toolset fields and taxonomies, with the exception of the "Dog Categories" taxonomy.