+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: search by distance restrict to 1 country

  1. #1

    search by distance restrict to 1 country

    Hi Flynax,

    Is there anyway if I can restrict the input of location of search by distance to auto fill only 1 country USA?

  2. #2
    Guru
    Join Date
    Jul 2019
    Location
    Australia
    Posts
    657
    Wei,
    I think rudi gave me some code for that.
    Its in one of my threads. Dunno where though.

  3. #3
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138

  4. #4
    Quote Originally Posted by Rudi View Post
    Hi Rudi,

    I have been reading again and again all 3 page, especially page 2. But still can't figure out how to implement it. (
    On page 2, there is a solution for olx template homepage which I don't use, so the only solution found is:

    Code:
    Only registered members can view the code.
    I'm using Realty Nova template and trying to restrict the search by distance input on the category search form on sidebar, so I'm looking at:
    template/tpl/blocks/side_bar_search.tpl and field_search_box.tpl

    Also checking plugins/search_by_distance/field.tpl

    I could not find where to implement your code. Here is my country name and country code:

    Code:
    Only registered members can view the code.
    Would you please comment on this?

  5. #5
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    You only need to select a default category in Basic Settings > Search by Distance > Listing Fields Mapping > Country field > NONE; Default country > your country

  6. #6
    Quote Originally Posted by Rudi View Post
    You only need to select a default category in Basic Settings > Search by Distance > Listing Fields Mapping > Country field > NONE; Default country > your country
    Hi Rudi, yes. I also set that

    Screen Shot 2021-07-21 at 4.12.33 PM.png

    But for some reasons, when I input location it still show other country results

    Screen Shot 2021-07-21 at 4.14.02 PM.png


  7. #7
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    I've checked and you need to update the plugin

  8. #8
    Quote Originally Posted by kiowa View Post
    Wei,
    I think rudi gave me some code for that.
    Its in one of my threads. Dunno where though.
    Hi kiowa, I checked your site and tried to input in the search by distance location random place in other country, it still shows other country. Did you remove the code to restrict to Australia only?

    Screen Shot 2021-07-21 at 8.52.14 PM.png

    Quote Originally Posted by Rudi View Post
    I've checked and you need to update the plugin
    Hi Rudi,

    I just downloaded the newest 5.0.2 on my local machine and setup as you suggest, it still show suggestion from other country rather than restrict to USA only.
    So I went to Flynax realty demo, enable the search by distance plugin, used the same setup

    Screen Shot 2021-07-21 at 8.58.12 PM.png

    Then try it at https://realty.demoflynax.com/search-by-distance.html
    The suggestion still shows other country

    Screen Shot 2021-07-21 at 8.58.53 PM.png


  9. #9
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    It should work, on gerenal demo it works as it should

  10. #10
    Quote Originally Posted by Rudi View Post
    It should work, on gerenal demo it works as it should
    Humh, you're right Rudi. On General Demo it work, but in Real Estate Demo it doesn't. I will try changing template and testing a bit when I got time.
    Thank you for your speedy support.

+ Reply to Thread