Show each store's distance from the visitor
Distance is calculated at search time. It is not saved as a permanent store field because the value changes for every visitor and every searched location.
You need both parts:
- a store card or infobox containing the dynamic distance value; and
- a locator that can obtain an origin through address search or visitor location.
Add distance to a store card
- Go to Store Locator → Builder.
- Open the store card used by your locator, or duplicate it before changing a live design.
- Add a content element where the distance should appear.
- Select the dynamic Distance store value.
- Set the desired number/format options if the element exposes them.
- Add optional surrounding text only as a complete phrase—for example, a suffix of
away. - Save the store card.
Use the same process for a Map infobox design.
Let the locator establish an origin
The origin can come from:
- an address entered in a Search form;
- the visitor selecting the geolocation control and allowing browser permission;
- Ask location on load in the Map widget;
- the optional IP location fallback in the Map widget.
For address search, make sure the selected Search form contains the location field. For browser location, test over HTTPS and allow location permission when prompted.
Choose kilometres or miles
- Go to Store Locator → Settings.
- Open the Search tab.
- Set Distance unit to Kilometres or Miles.
- Save settings and refresh the published locator.
The distance control, REST request, sorting, radius, and displayed value must all use the same unit.
What visitors see before location is known
Before the locator has an origin, it cannot calculate distance. The element should remain hidden or display a complete fallback such as Enter a location to see distance. It must not display broken text such as About away.
Test the complete behavior
- Open the locator in a private window.
- Confirm distance is hidden or shows the configured complete fallback.
- Search for a known address and confirm distances appear.
- Use browser geolocation and confirm values change to the visitor position.
- Change radius and confirm the values remain visible.
- Select Load more and confirm new cards also contain distances.
- Set sorting to distance and confirm results increase from nearest to farthest.
If distance disappears after changing a filter, use Search, radius, and distance to inspect the request state.