WordPress Store Locator Plugin

Extend: Hide Similar Locations


One of your stores may serve several zip codes. You want to display all these zip codes on the map, but leave only one entry in the results list.


Create a location per each zip code served by this store keeping the same name for each. For example, if a store named "Joe's Corner" serves 4 zip codes, create 4 locations named "Joe's Corner" for each zip code/address.

Then add the following JavaScript code:

var locatoraidAlreadyShown = {};

// reset for a new search result
document.addEventListener( 'locatoraid-get-results', function(){
  locatoraidAlreadyShown = {};

// listen to render
document.addEventListener( 'locatoraid-render-in-list', function(e){
  var thisName = e.payload.data('location')['name'];
  // already displayed?
  if( locatoraidAlreadyShown.hasOwnProperty(thisName) ){
    var $div = e.payload;
  locatoraidAlreadyShown[thisName] = true;

There are several ways to make use of this additional JavaScript code: