Load a Parameter with a Query String

Table of Contents

Agile Store Locator makes it possible for users to load a parameter using a query string. Thereby, directing their customers to the store locator with a specific parameter preselected. For example, there could be a link that takes your customer to the store locator with the address “ California” pre-selected. 

While it may seem like a small detail. Eventually, customers will appreciate how much time and effort they are saved  (no matter how small) by directly loading the store locator with a certain parameter.

How Does it Work? #

A query string (added) at the end of the store locator URL takes the customer to the store.

Furthermore, the Parameters to pre-select include:

  1. Category – “category”
  2. Brand – “brand”
  3. Address -”addr”

The query string added at the end of the URL is: “?sl-category=x”

Where “x” represents the parameter ID ( the parameter ID can be alphabetic or numeric; depending on the parameter selected). In addition, the term “category” can be replaced with “brand” or “addr”.

For example, if a user wants to direct a customer to the store locator with “California” pre-selected as the address then the following query string is added at the end of the URL:

https://your-site.com/store-locator/?sl-addr=california

Similarly, for the categories, it will be like this, where 4 is the category to be selected on the load, multiple categories can also be passed comma separated.

https://your-site.com/store-locator/?sl-category=4

For the brand, you need to provide the brand ID as the query parameter to pre-select it.

https://your-site.com/store-locator/?sl-brand=5

For the specialty, you have to provide the specialty id as the query parameter to pre-select it.

https://your-site.com/store-locator/?sl-special=5

An example of sl-addr, the overall URL will look like this:

http://demosite.com/index.php/store-locator/?sl-addr=california

Store Locator with Pre-Selected Parameter
Store Locator with Pre-Selected Parameter

If you are looking to filter through address-related fields such as city, state, postal_code, you can refer to the document about filtering data through the shortcode attributes.