Search Widget

Installation

  1. Download the zip file mentioned in the WPSL receipt.
  2. Log into your WordPress Admin area and go to Plugins > Add New.
  3. Click Upload Plugin on the top of the page.
  4. Select the zip file you downloaded in step 1.
  5. Click Install Now.
  6. Once the installation is complete, activate the plugin.

You can enable the widget under Appearance > Widgets by dragging it to one of the widgetized areas in your theme.

Search Widget

Activate License

You can find your license key in your purchase receipt, and in the ‘License Keys’ section on the account page.

Activate your license on the WPSL settings page under the ‘Licenses’ tab.

A valid license key is required in order to get automatic upgrades and support.

Configuration Options

Search Widget Options

Title
The main title of the search widget.

Search label
This is shown directly above the search input field. If this field is left empty, then it will default to “Enter your location”.

Search field placeholder
This is the default text shown inside the search input field. You can for example set it to “city or zipcode”.

Enable autocomplete?
This activates the Google Maps autocomplete function for the search field.

Attempt to auto-locate the user?
This will try to automatically determine the users location with help from the HTML 5 Geolocation API.

Show store category filter
If this option is enabled, a dropdown holding the store category names is shown under the search input field.

Category label
This is shown directly above the store category dropdown.

Select the page where you added the [wpsl] shortcode
After the user submitted the search form, the search results are shown on this page.

Notes

If you’re using the wpsl_templates filter to load a custom template, then make sure to include the following two things to make it compatible with the search widget.

  • Use the wpsl_search_input filter in the value field . This is required to pass the search value from the search widget to the input field in the store locator.

    The search input field with support for the search widget looks like this:

    <input autocomplete="off" id="wpsl-search-input" type="text" value="' . apply_filters( 'wpsl_search_input', '' ) . '" name="wpsl-search-input" />
  • Make sure there’s a way for the widget to add the wpsl-widget class to the outer template div. This class is used in the JS script to determine if it needs to automatically trigger the store search on page load.

    The required classes are added by including the $this->get_css_classes(); code on the outer template div.