This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Proximity search?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9134
    nazarnazar
    Participant

    Is it possible to build a proximity search with either a Slider or Range slider?
    I have lat/long and even zip code as custom fields attached to my CPTs.

    #9169
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    I would suggest the Range slider for this purpuse. It uses the “BETWEEN” operator on database level – but it still does not exceeds the selected range, it is strict. So if the range is 1 – 10 and the user selects 2 and 5, then values between 2 and 5 are considered as match – there is no additional boundary.

    I would probably make one range slider for the latitude, other for the longitude, but both latitude and longitude must be a separate custom field as a numeric value (no spaces, no other extra characters) – otherwise it will be recognized as a string by the MySql database.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.