Support » Plugin: WPAdverts - Classifieds Plugin » search by country or state

  • Resolved kowalski

    (@jankowalski)


    Is it posible to search by state and country using MAL plugin?
    My location field with google autocomplete only works fine if i enter a city but when entering state, or county it is not filtering correctly ads.
    is this functionality not supported or i don t have it properly configured?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    It should be possible if the current setup does not work for you then you can go to wp-admin / Classifieds / Option / Maps and Locations panel and in “[adverts_list] Configuration” / “Location Field” select “Replace ‘location’ input with autocomplete.”,

    Yes it works fine if “Replace ‘location’ input with autocomplete” selected
    if “Replace ‘location’ input with Google autocomplete” then it is working well only for cities, but not for countries or states..

    • This reply was modified 2 years, 1 month ago by  kowalski.

    can you help with this? i will send you a link to my website by email.
    please note that searching by city is working fine, but for country and state is not filtering nothing at all.

    Plugin Author Greg Winiarski

    (@gwin)

    In your search configuration, the country is not being used, you would need to open file wpadverts-mal/assest/js/search-places.js go to line 93 and change

    
    $.each(["address", "postal_code", "locality"], function(index, item) {
    

    to

    
    $.each(["country", "address", "postal_code", "locality"], function(index, item) {
    
    kowalski

    (@jankowalski)

    contry works ok, but still can t get work States, or provinces in europe.
    FE: TX or MI doesn not return filtered results. Any other further notification of this code is needed to make it work?

    $.each(["country", "address", "postal_code", "locality"], function(index, item) {
    

    thanks

    Plugin Author Greg Winiarski

    (@gwin)

    Try changing it to

    
    $.each(["country", "administrative_area_level_1", "address", "postal_code", "locality"], function(index, item) {
    

    administrative_area_level_1

    kowalski

    (@jankowalski)

    not working …

    Plugin Author Greg Winiarski

    (@gwin)

    What error do you see? I am checking with my dev version and it works fine.

    Note that each country has different administrative areas, and Google returns them in a different format so you might not be able to fine tune this to work with every country.

    It would be best to use the search along with Radius field then the search would first find the center for your entered location and then return all Ads within the range, this would probably be the best setup for international site.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘search by country or state’ is closed to new replies.