Display Default Search when Store Locator Loads

Follow

Overview

Store Locator will display a general map of your region. If you have a main store or headquarters, the map can be adjusted to make a specific location the default to where your map loads.

To display a default search when Store Locator loads, please follow these steps:

  1. From Shopify's admin, select Apps.

    select apps

  2. Select Store Locator.

    select store locator

  3. Select Settings.

    select settings

  4. Select Display Settings.

    select display settings

  5. Copy and paste this code in the "Page Header HTML" field: 
    <script>
    document.addEventListener("DOMContentLoaded", function(){
    document.getElementById('address_search').value = "!!!";
    setTimeout(function(){
    document.querySelector('.search_bar button').click();
    }, 1000);
    });
    </script>

    paste the code

  6. Replace !!!! with the search term you'd like as the default search.

    SL_change_the__s.png

  7. Select Save.

    Save

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.