Store Locator Plugin Guide
The Store Locator list can be sorted by a number of attributes, such as ID, title, city, state, distance, and the categories. Moreover, the default sorting is by the distance to the center of the searched location.
To change the sorting, please go to "ASL Setting" in the WordPress admin panel under the "Store Locator" section, select the required sorting parameter, and save the settings.
How to sort by shortcode attribute?
In order to sort by the shortcode attribute, you have to provide the sort_by attribute in the shortcode as an attribute with the value to sort, the empty value will be considered as distance.
Other possible values for the above attributes are title, city, state, country, or any other custom column.
Can we change the sorting to distance after the search is performed?
If your initial sorting is set to another attribute than the distance and you want to set it to distance after the search is performed, add the following shortcode attribute.
The above shortcode will switch the sort to distance, once a search or geolocation is performed.
Can we change the sorting after the first load?
Yes, it can be done via the JS hooks, once the store locator is loaded you can change the sorting value.
How to sort by the Categories?
Category sorting is multi-level sorting that works by sorting by the categories and the distance as well. Furthermore, to add this sorting, please use the shortcode below.
How to Sort the Categories List?
The categories listed in the store locator are sorted in alphabetical order by default. To change the sorting order by other attributes such as the order id can be done via the shortcode below.