Presetting search options via a custom URL

Setting search settings (checkboxes, dropdown etc..) via adding query arguments to current page URL

1) Navigate to the page with the search bar/settings you want to preset. In this example we are using the ajax search pro property demo example.

2) Preset the filters as you want them, for example:

3) Get your search ID. You can get the search shortcode ID on the plugin backend. In our case it is 16

4) Navigate back to the frontend with the search page. Now open your browser developer console via hitting F12. We are using Chrome. For other browsers CTRL + SHIFT + I may also work.

Make sure the console panel is highlighted:

5) Copy/Paste the following code to the console - but make sure to change the id variable to your search ID.

var id=16;
ASP.api(id, 'getStateURL');

The console should return a URL, which when used will preset the filters to the desired state.

If you want to also use a search phrase and/or trigger the search, then use this code instead. Change the phrase variable as you need it (it can be an empty string as well to only trigger the search).

This one enters a phrase and triggers the search:

var id=16, phrase='my search phrase';
ASP.api(id, 'getStateURL')+'&asp_s='+encodeURIComponent(phrase)+'&asp_id='+id;

This one only triggers with an empty phrase

var id=16;
ASP.api(id, 'getStateURL')+'&asp_s=&asp_id='+id;

In our case the console printed:

6) Copy/Paste the URL returned. You can repeat the steps if you need multiple setups.