Support » Plugin: WP Store Locator » Restrict place autocomplete to multiple countries

Viewing 4 replies - 1 through 4 (of 4 total)
  • Or maybe a way to use the Places API bounds and strictBounds parameters.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Did you enable the ‘Restrict the geocoding results to the selected map region?’ option on the settings page?

    I just noticed in the code that that option needs to be enabled as well before the geocode component code works. Not entirely sure why that is though, so maybe I should remove that restriction.

    I tested this, and it works ( but the settings option needs to be enabled as well ).

    
    add_filter( 'wpsl_geocode_components', 'custom_geocode_components' );
    
    function custom_geocode_components( $geocode_components ) {
    
        $geocode_components['country'] = array( 'nl' );
    
        return $geocode_components;
    }
    

    Ah. I tried about every format except a php array. So glad it’s supported. Thanks.

    I’m using it on http://www.matki.co.uk which is now live. On each product you can search for a local dealer who displays that range.

    That worked perfectly, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Restrict place autocomplete to multiple countries’ is closed to new replies.