Ok - so as per your requirement, as we need to query the parent address field.
I've created the following views:
The following view is used to get Dealers based on the distance search address string and the view will return IDs of found posts and we used that further with "wpv_filter_query" hook.
- hidden link
The following view is used to get Building post IDs based on the found Dealers using the distance search address (The Dealer IDs we get from above view ID: 13885) string and the view will return IDs of Building posts and we used that further with "wpv_filter_query" hook.
- hidden link
I've adjusted the code added to "Custom Code" section offered by Toolset:
- hidden link
Wow, thanks for doing all that work, Minesh. I tested the distance filter and it seems to work partially. It is including some buildings outside of the 50 mile radius, though. If I use the address
3506 GA HWY 224, Montezuma, GA 31063
it should not include the 3 results in Thomaston, GA because it is 61 miles from the entered address. If I change the radius to 5 miles it shows 3 locations and there should only be 1.
I tried another address:
519 W Adair St, Valdosta, GA 31601, USA
And it returned results that seemed correct.
Well - I've created the simple distance search test view as you can see with the following link:
- hidden link
As you can see I've only added the distance search for the Dealers post type and I'm displaying the Post IDs with the above view loop.
When I search for the address string "3506 GA HWY 224, Montezuma, GA 31063"
- hidden link
I can see it does display the result that is post ID "6916" and that post ID has the address "629 N Church St, Thomaston, Georgia, 30286" but that address has the Distance value 43.8 Miles.
Can you confirm this, maybe you confuse between miles and kilometers. or am I missing anything here?
I just realized something. Toolset by default calculates the distance by a radius from a set of coordinates calculated from an address. It doesn't use the road distance as determined by getting directions. Is Toolset capable of displaying posts by calculating the distance according to directions from the entered address to the dealer address?
Also, the live page hidden link is now just spinning when I enter an address. It never finishes loading. I haven't done anything since Friday.
Thanks for all your help on this. I'm trying to make this page for my boss so we can market our inventory, but it's been more of a challenge than I thought it would be.
I just realized something. Toolset by default calculates the distance by a radius from a set of coordinates calculated from an address. It doesn't use the road distance as determined by getting directions. Is Toolset capable of displaying posts by calculating the distance according to directions from the entered address to the dealer address?
===>
No - there is no such feature available.
Also, the live page hidden link is now just spinning when I enter an address. It never finishes loading. I haven't done anything since Friday.
==>
it's fixed.