Skip Navigation

[Resolved] ACF Address Field does not work with Toolset distance search

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

Problem:
When using an ACF Address Field as input for Distance Searches with Views, it seems we cannot do so.

Solution:
The location/address field created with Advanced Custom Fields does not work with a Toolset Search for distance, which requires Toolset Maps to work.

To filter by distance in Toolset you would have to create an Address Field using Types and Toolset Maps.
Then, you can filter by that field by a distance.

This support ticket is created 5 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by isaiasV-2 5 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#1285385
screenshot-medicalreferral.com-2019.07.06-16_05_52.png

I am trying to: Create a Toolset Maps Distance Filter using a location/address field created with Advanced Custom Fields

Link to a page where the issue can be seen:

I expected to see: Comparison field is blank, no fields available...yet my post types contain a location field with lat/lon coordinates.

Instead, I got:

#1285429

The location/address field created with Advanced Custom Fields does not work with a Toolset Search for distance, which requires Toolset Maps to work. Can you point me to the Documentation that recommends this approach, in case you found this on our DOC?

To filter by distance in Toolset you would have to create an Address Field using Types and Toolset Maps.
Then, you can filter by that field by a distance.
Note that Toolset Maps stores the Address Data (and only the data that it gets from Toolset Address field, expectedly) in a special Database - this is elaborated here: https://toolset.com/2019/06/toolset-forms-2-4-and-maps-1-8-release/ > Toolset Maps 1.8 Provides Big Performance Improvements
This would provoke that it cannot read the ACF field even if you could set it in the Filter: the data would not be stored in the Database table it expects it to be.

This was also discussed here:
https://toolset.com/forums/topic/how-do-i-use-the-distance-filter-on-a-view-if-i-am-not-using-toolset-rather-acf/
You can meanwhile add your voice to feature requests using the form here https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
The Product Management will receive the email of that form and consider the feature according to the priorities.

#1285465

Hello,

Okay I have added a Toolset Location field to my custom post type and I was able to create the filter inside the view.

However, not ALL posts show up when I search (I have about 1,000 posts total). Furthermore, the search form/view filter option does not display all the Categories on the frontend - I have 127 categories.

All posts have location/address data inserted.

I have created you an Admin user login to further investigate.

{removed, as public forum}

#1285475

This is fast.

The search will only work for posts that have an address stored, as otherwise, there is nothing the View can search for in the database.

If all posts have the address and they still do not display, it might be due to the ordering. Do you order by another Custom Field?
If so, can you try without?

I will also see if I can find something using the access you provided (I deleted it because this forum is public, it is visible to anyone.)
I can provide private reply modes if you require this.

#1285613

All my posts have an address stored.

I was also ordering by taxonomy of category. I removed it but still no luck.

#1287571

I was able to fix this by using the WP Ultimate CSV Import plugin.

Originally I imported my data using WP All Import which imported the addresses into my Location field, however, the data did not register with Toolset Maps and generate geocoded coordinates.

#1287573

My issue is resolved now. Thank you!