See Complete List of Stores Link on Store Locator Page Does Not Show Store List

This topic applies to

Applies to

SuiteCommerce Advanced | Kilimanjaro | Vinson | Elbrus

In some implementations of the Kilimanjaro, Vinson and Elbrus releases of SuiteCommerce Advanced, the See Complete List of Stores link on the Store Locator page reloads the page but does not show the complete list of stores. The patch instructions described below correct this problem.

To implement this patch, create a custom module to override the store_locator_main.tpl, store_locator_list.tpl, and store_locator_list_all_store.tpl files, which are part of the StoreLocator@X.Y.Z module. In this example, X.Y.Z represents the version of the StoreLocator module in your implementation of SuiteCommerce Advanced. You can download the code samples described in this procedure here: StoreLocator.Extension@1.0.0 ElbrusCodeSamples.zip

Step 1: Create the Override Files

  1. Create an extensions directory to store your custom module. Depending on your implementation, this directory might already exist. For example, create Modules/extensions

  2. Within this directory, create a custom module with a name similar to the module being customized.

    For example, create Modules/extensions/StoreLocator.Extension@1.0.0.

  3. In your new StoreLocator.Extension@1.0.0 directory, create a subdirectory called Templates.

    For example: Modules/extensions/StoreLocator.Extension@1.0.0/Templates

  4. Copy the following source file and paste into the correct location:

    Copy This File:

    Place a Copy Here:

    Modules/suitecommerce/StoreLocator@X.Y.Z/Templates/store_locator_main.tpl

    Modules/extensions/StoreLocator.Extension@1.0.0/Templates

    Modules/suitecommerce/StoreLocator@X.Y.X/Templates/store_locator_list.tpl

    Modules/extensions/StoreLocator.Extension@1.0.0/Templates

    Modules/suitecommerce/StoreLocator@X.Y.Z/Templates/store_locator_list_all_store.tpl

    Modules/extensions/StoreLocator.Extension@1.0.0/Templates

    In this example, X.Y.Z represents the version of the module in your implementation of SuiteCommerce Advanced.

  5. Revise your new store_locator_main.tpl file following these steps:

    1. Locate the following line:

      <a data-touchpoint="{{touchpoint}}" data-hashtag="stores/all" href="stores/ all" href="stores/all">{{translate 'See complete list of stores'}}</a>
    2. Replace this line with the following code:

      <a href="stores/all">{{translate 'See complete list of stores'}}</a>
    3. Save the file.

  6. Revise your new store_locator_list.tpl file following these steps:

    1. Locate the following line:

      <a data-hashtag="stores/details/{{storeId}}" data-touchpoint="{{touchpoint}}" data-toggle="show-in-pusher">
    2. Replace these line with the following code:

      <a href="stores/details/{{storeId}}" data-toggle="show-in-pusher">
    3. Save the file.

  7. Revise your new store_locator_list_all_store.tpl file following these steps:

    1. Locate the following lines:

      <a class="store-locator-list-all-store-name" data-touchpoint="{{touchpoint}}" data-toggle="show-in-pusher" data-hashtag="stores/details/{{storeId}}" href="stores/details/{{storeId}}">{{name}}</a>
    2. Replace this line with the following code:

      <a class="store-locator-list-all-store-name" data-toggle="show-in-pusher" href="stores/details/{{storeId}}">{{name}}</a>
    3. Save the file.

Step 2: Prepare the Developer Tools For Your Customization

  1. Open your Modules/extensions/StoreLocator.Extension@1.0.0 module directory.

  2. Create a file in this directory and name it ns.package.json.

    Modules/extensions/StoreLocator.Extension@1.0.0/ns.package.json

  3. Paste the following code in your new ns.package.json file:

    { "gulp": { "templates": [ "Templates/*" ] }, "overrides": { "suitecommerce/StoreLocator@X.Y.Z/Templates/store_locator_main.tpl": "Templates/store_locator_main.tpl", "suitecommerce/StoreLocator@X.Y.Z/Templates/store_locator_list.tpl": "Templates/store_locator_list.tpl", "suitecommerce/StoreLocator@X.Y.Z/Templates/store_locator_list_all_store.tpl": "Templates/store_locator_list_all_store.tpl" } }

    Important

    You must replace the string X.Y.Z with the version of the module in your implementation of SuiteCommerce Advanced.


  4. Open the distro.json file. This file is located in your root directory.

  5. Add your custom module to the modules object.

    Your code should look similar to the following example:

    { "name": "SuiteCommerce Advanced Elbrus", "version": "2.0", "isSCA": true, "buildToolsVersion": "1.3.0", "folders": { "modules": "Modules", "suitecommerceModules": "Modules/suitecommerce", "extensionsModules": "Modules/extensions", "thirdPartyModules": "Modules/third_parties", "distribution": "LocalDistribution", "deploy": "DeployDistribution" }, "modules": { "extensions/StoreLocator.Extension": "1.0.0", "suitecommerce/Account": "2.3.0", ...

    This ensures that the Gulp tasks include your module when you deploy.  In this example, the custom modules are added at the beginning of the list of modules. However, you can add the modules anywhere in the modules object. The order of precedence in this list does not matter.

  6. Save the distro.json file.

Step 3: Test and Deploy Your Customization

  1. Test your source code customizations on a local server (see SCA on a Local Server) or deploy them to your NetSuite account (see Deploy to NetSuite). If you are currently running SCA on a local server, your changes should appear on your local site immediately.

  2. Confirm your results.

    Upon successful deployment, Store Locator reloads the page and shows the complete list of stores.

Related Topics