Skip Navigation

[Fermé] Using Toolset Address field with FacetWP

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.

This topic contains 3 réponses, has 2 voix.

Last updated by Waqar Il y a 1 mois et 2 semaines.

Assigned support staff: Waqar.

Auteur
Publications
#2075295

Tell us what you are trying to do?
Hi. I'm trying to use a FacetWP proximity facet to filter posts based on the address stored from a Toolset address field. It appears that the facet isn't seeing the stored coordinates. I looked in the database and it appears the coords are stored in an interesting way... I checked with FacetWP support and they said if I can find out how the data is stored I can use an indexer hook to tell FacetWP how to index the lat and long.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
Yes, but would prefer to keep private.

What is the link to your site?
Would prefer to keep private during development.

#2075645

Waqar
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

If your goal is to get the raw latitude and longitude values from the Toolset's address type custom field, you can use the Toolset Types API:
https://toolset.com/documentation/customizing-sites-using-php/functions/#address

For example, suppose that you need a comma-separated latitude and longitude value from the address field with slug 'post-location', from post with ID "123".

The "types_render_field" function, in this case, will be used as:


$field_value = types_render_field( 'post-location', array( 'item' => 123, 'format' => 'FIELD_LATITUDE,FIELD_LONGITUDE' ) );

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2078129

Hi Waqar,

I'm still trying to make sense of this, have not solved the problem, and am only replying on a Saturday because your "cleanup robot" prompted me to do so... Please don't close this ticket yet.

Thanks,
Eric

#2079175

Waqar
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Eric,

This ticket will remain open for a couple of weeks, so you're welcome to share any follow-up questions or concerns.

regards,
Waqar

Le sujet ‘[Fermé] Using Toolset Address field with FacetWP’ est fermé à de nouvelles réponses.