---
schema_version: "1"
id: 68435b1c66dd4510690e0cc2d9bb3a3f3bfe4be09135e16b2d327fa2ee169106
title: Boost In-Store Sales with Store Locator
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/pwa-kit-managed-runtime/guides/store-locator.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/store-locator.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e1b2596a7ba4d8026f4e1d4d7199f703ca7a5d61cb63a60fc7f561d4834023a9
products:
  - Composable Storefront
  - Salesforce APIs
---
# Boost In-Store Sales with Store Locator

With the [Retail React app template](https://pwa-kit.mobify-storefront.com/), you can include a store locator on your [Progressive Web App (PWA) Kit](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/getting-started.html) site with reduced implementation time. Shoppers can find store locations worldwide based on ZIP code, city, and more. Extend your store information in Business Manager to customize the displayed location metadata on your site.

This guide explains how to configure and use a store locator.

## Prerequisites

To include a store locator:

- Build your site with:
  - The [Retail React app template](https://pwa-kit.mobify-storefront.com/)
  - Retail React App version 4.0 or later
  - Commerce SDK React version 2.0.1 or later
- Use a [Shopper Login and API Access (SLAS)](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html) client with the scope `sfcc.shopper-stores`. Follow the steps in [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html#create-a-slas-client) or use the [registerClient API endpoint](https://developer.salesforce.com/docs/commerce/commerce-api/references/auth-admin?meta=registerClient) to create or update a SLAS public or private client.

  - In the **Scopes** field, include this scope: `sfcc.shopper-stores`.

  A SLAS private client offers several advantages over a public client. See [Use a SLAS Private Client](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/use-a-slas-private-client.html).

## Configure a Store Locator

1. In Business Manager:

   - Add the countries that you want shoppers to find on your site. See [Store Geolocation Data in B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_store_geolocation_data.htm&type=5).
   - Add the stores that you want shoppers to find on your site. You can edit store information that you already added. Also, you can bulk import stores. See [Create Stores in B2C Commerce.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_stores.htm&type=5)

2. In [`app/constants.js`](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/cdea5994a47174d7ea38b3f3412b4e4393fe701a/packages/template-retail-react-app/app/constants.js):

   - In the `SUPPORTED_STORE_LOCATOR_COUNTRIES` constant, add the list of countries that you want shoppers to see in the Country dropdown.

     The country codes that you add must match those of the stores that you added in Business Manager.

     If the `SUPPORTED_STORE_LOCATOR_COUNTRIES` constant is empty, when a shopper searches for stores, store locator uses the postal or ZIP code entered by the shopper. Store locator searches in the country specified in the `DEFAULT_STORE_LOCATOR_COUNTRY` constant defined in [`app/constants.js`](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/cdea5994a47174d7ea38b3f3412b4e4393fe701a/packages/template-retail-react-app/app/constants.js).

3. In [config/default.js](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/develop/packages/template-retail-react-app/config/default.js), set the `storeLocatorEnabled` value to `true`.

```
   module.exports = {
    app: {
        ...
        storeLocatorEnabled: true
    },
```

## Initial Store Locator Rendering

For shoppers who have location sharing already enabled on their device, store locator shows results around the GPS location of the shopper’s device.

For shoppers who don’t have location sharing enabled on their device, the initial rendering of the store locator shows results for the default geolocation specified in these constants in [`app/constants.js`](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/cdea5994a47174d7ea38b3f3412b4e4393fe701a/packages/template-retail-react-app/app/constants.js).

- `DEFAULT_STORE_LOCATOR_POSTAL_CODE`
- `DEFAULT_STORE_LOCATOR_COUNTRY`

## Constraints

Store locator:

- Returns up to 200 stores at a time
- Searches for stores within a maximum radius of 100 kilometers

  The default unit is `km` (kilometers), as specified in the `STORE_LOCATOR_DISTANCE_UNIT` constant in [`app/constants.js`](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/cdea5994a47174d7ea38b3f3412b4e4393fe701a/packages/template-retail-react-app/app/constants.js). Optionally, to use miles for the unit, you can set `STORE_LOCATOR_DISTANCE_UNIT` to `mi`.

  The default maximum radius is 100, as specified in the `STORE_LOCATOR_DISTANCE` constant in [`app/constants.js`](https://github.com/SalesforceCommerceCloud/pwa-kit/blob/cdea5994a47174d7ea38b3f3412b4e4393fe701a/packages/template-retail-react-app/app/constants.js). Optionally, you can set `STORE_LOCATOR_DISTANCE` to your chosen maximum radius.

## Troubleshoot Store Locator

This section provides a suggested solution for a common error that you might encounter while using store locator.

### Inaccurate Location Data

**Potential Cause:** Your location data in Business Manager is inaccurate.

**Suggested Solution:** Ensure that your store location information is accurate and reflects any changes in address, phone numbers, operating hours, or other store data. See [Managing Stores in B2C Commerce](https://help.salesforce.com/s/articleView?id=cc.b2c_managing_stores.htm&language=en_US&release=2.0.1&type=5).
