Overview
To display "View Website" rather than a URL for a store in Store Locator, please follow these steps:
- From Shopify's admin, select Apps.
- Select Store Locator.
- Select Settings.
- Select Display Settings.
- 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>
Note: You can change the "Visit Website" text in this code if you'd like different text to display to your customers.
- Select Save.
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>