Change the Website Text

Follow

To display "View Website" rather than a URL for a store in Store Locator, follow these steps:

  1. From "Shopify 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 Footer HTML" field: 
    <script>
    $('#store_map').click(function(){
    setTimeout(function(){
    $('.website a').text('Visit Website');
    }, 100);
    });
    </script>

    paste this code in the Page Footer HTML

  6. Select Save.

    Save

That's it! 

Note: if the code in step 5 doesn't work for you, you can use this code instead:

<script> 
var website_link_text = 'Visit Website';

function fixURLS(){
    var websites = jQuery(".addresses .store_website a");
    for(i=0; i<websites.length; i++){
       jQuery(websites[i]).text(website_link_text);
   }
}

$('#store_map, #addresses_list a').click(function(){
 setTimeout(function(){
 $('.website a').text(website_link_text);
 }, 300);
});
</script>

Next Steps:

Blog Posts:

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.