Skip Navigation

[Closed] Sort search results by "As a distance from" not available

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2567087

Jim
Screenshot 2023-03-06 at 11.39.55 AM.png

Tell us what you are trying to do?
I want to sort the search results by distance from a submitted address, or the users location. When I try to change the order by in the backend, the "As a distance from" option is disabled.

Is there any documentation that you are following?
I couldn't find documentation on this though I did find a similar support request.

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2567415

Hello,

How do you setup the custom field "Business 1 Postal Code"?
The distance filter only available for custom address field, see our document:
https://toolset.com/lesson-placement/lesson-placements-1622939-1625485/

#2567721

Jim

Hi Luo.

Thanks for the reply.

I have 'Business 1 Address' as an 'Address'.

'Business 1 Postal Code' is 'Single Line'.

Having 'Business 1 Address' as an 'Address' should work, no?

Jim

#2568029

Yes, it should work with custom address field.

#2568039

Jim

Yes, it should. But it doesn't. Hence my support request.

Why would it not give me the option to sort results by distance when I set the field to the Address field?

#2568093

I have tried it in a fresh WP installation + the latest version of Toolset plugins, it works fine.

See below sandbox site:
Login URL:
hidden link

Custom address field:
hidden link

Post view, sort by above address field:
hidden link

Is there any missing steps? Can you reproduce the same problem in above website?

#2568539

Jim
Screenshot 2023-03-08 at 8.21.14 AM.png
Screenshot 2023-03-08 at 8.18.52 AM.png

Hi Luo.

Thank you for taking the time to set this up.

Perhaps it has something to do with the query filters I have. I've attached a screenshot that shows the 'As a distance from' disabled, as well as the rest of the Query Section. Your example looks exactly like mine, except for the query filters.

I've also included a screenshot of the Distance query filter.

Thanks for your help.

Jim

#2568963

Can you reproduce the same problem in above sandbox website?

I have tried to add the distance range filter into above post view, it works fine too.

If you can not too reproduce the same problem, then there might be other compatibility/server issues in your website.

Please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

The topic ‘[Closed] Sort search results by "As a distance from" not available’ is closed to new replies.