Support » Plugin: WP Store Locator » Show all results in state regardless of radius

  • Jason Yingling

    (@yingling017)


    Hi, I’m looking to implement searching by state with the end goal being to show all results for a state if that state is searched and more or less negate the radius search.

    I’m comfortable with hooking into the existing filters, but was wondering if you had suggestions on a good starting point with that functionality?

    The plugin is great! Very developer friendly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Support for this is will be included in the 3.0 update, I have beta version already where this is implemented.

    It’s part of an option that will automatically return all results if the users searches for a state / country name instead of using the search radius.

    How this work is that the user input is send the Geocode API, then reverse geocoded again and the full API response contains data whether or not it’s a state or country and based on that the search is adjusted.

    If you want to try the beta version, just open a support ticket here.

    Otherwise you could use the wpsl_sql filter, reverse geocode the provided coordinates and look through the returned data for the correct state fields. If it’s a state, then leave the radius restrictions out of the SQL query and look for a matching state name in the meta fields ( wpsl_state )

    Jason Yingling

    (@yingling017)

    Awesome! Do you have a general timeline for the release or a target date? We’re launching the site next week, but this may be a feature implemented down the road and I’m sure the client will be interested in upgrading the functionality based on timing.

    I was considering parsing the search input to determine if it was a state or state abbreviation only being searched and if so hijack the wpsql_filter to query based on the state meta field.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    I was aiming to have a public beta before the end of September, but that won’t work. So hopefully in a few weeks.

    Sounds good! Thanks for getting back to me.

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