Set an absolute near me location value

This topic contains 9 replies, has 3 voices, and was last updated by  Stiofan O’Connor 7 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #367657

    Brendan Flanagan
    Free User
    Post count: 9

    Hi

    How can I set the near me location to always be from the same location.

    I am creating an accommodation listing for a major event.

    Users will want to see the distance from the accommodation to the event and will not be interested in any other distance measurement.

    If i could somehow set the near me value and then hide the field by positioning it off screen with css that would be great.

    Is there perhaps a function I can use to set this loction?

    Brendan

    #367680

    Guust
    Moderator
    Post count: 29970

    The only thing I can think off is to add a custom field where you add distance details manually when creating the listings.
    I’ll get the others to have a look too, maybe they can think of a simple way, without having to get a special customization.
    Thanks

    #367688

    Brendan Flanagan
    Free User
    Post count: 9

    Having a user enter their own distance manually would mean that the distance might not be accurate, as they would be guessing.

    Whereas if the distance is worked out by google api it would be accurate and I like the way it can be filtered in the advanced search option too.

    If you can come up with a solution that would be great. And I think it might be a really good feature for ye to add to the plugin.

    Thanks
    Brendan

    #367762

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Brendan,

    Where exactly do you want to show it?, are you wanting to show distances as the crow flies or Google maps directions distances?

    Stiofan

    #368092

    Brendan Flanagan
    Free User
    Post count: 9
    This reply has been marked as private.
    #368104

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Brendan,

    Happy Paddy’s Day 🙂

    That is a search page, i thought you wanted the distances to show throughout the site and not just the search page?

    I actually do something similar on one of my own sites but with two locations, how close to the airport and how close to the biggest town, i usually enter these distances manually. I think we could create a new custom field that would do this for you, maybe we just enter the GPS coordinates and it will calculate it and show it, then it will show everywhere and not just on the search page, how does that sound?

    Stiofan

    #368117

    Brendan Flanagan
    Free User
    Post count: 9

    Happy Paddy’s Day to you too Stiofan

    I’m watching the Club All Ireland Hurling on the TV and trying to get in a bit of work too. That’s my Paddy’s Day.

    I hadn’t thought about showing the distances throughout the site, but that would be great.

    So, yes please.

    Slainté
    Brendan

    #368141

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I did a small blog post about your need and added the code there, if you need help implementing it just let me know: https://wpgeodirectory.com/distance-custom-field/

    Thanks,

    Stiofan 🙂

    #368563

    Brendan Flanagan
    Free User
    Post count: 9

    Thanks Stiofan

    That worked really well for me to display on the listing.

    However, I still need it to be filterable to show ascending order by distance.

    I changed the ‘cat_sort’ => false to true

    and turned it on in custom fields and placed it in sorting options, but I still don’t see it on the front end in search.

    What else do I need to do

    Brendan

    #368575

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Brendan,

    This will not automatically sort by distance, that feature is done in search though, maybe a direct link placed where you need it to the search results page would do what you need?

    Stiofan

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket