• Resolved bschroeter

    (@bschroeter)


    Hello! I purchased the WP Store Locator widget plugin. I’m using the following snippet to limit the autosuggest options to United States, Mexico, and Canada. It doesn’t seem to limit the results for the widget. May you advise if there is a snippet that I can use to do the same for the widget?

    add_filter( ‘wpsl_autocomplete_options’, ‘custom_wpsl_settings’ );
    function custom_wpsl_settings( $settings ) {
    $settings[‘componentRestrictions’][‘country’] = array( ‘mx’, ‘us’, ‘ca’ );
    return $settings;
    }

    The page I need help with: [log in to see the link]

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

    (@tijmensmit)

    It’s maybe a bit confusing, but I checked the widget code, and this works.

    add_filter( ‘wpsl_geocode_components’, ‘custom_geocode_components’ );

    function custom_geocode_components( $geocode_components ) {

    $geocode_components[‘country’] = array( ‘mx’, ‘us’, ‘ca’ );

    return $geocode_components;
    }

    Do make sure you have also checked the ‘Restrict the geocoding results to the selected map region?’ on the WPSL settings page ( this option shows up after selecting a map region ).

    I will see how to make it use the same filter, instead of it requiring a different once.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Also, in the future please open a support ticket here since support for paid add-ons isn’t really allowed here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit Autocomplete Search Suggestions for Widget’ is closed to new replies.