Sitecore SXA location finder filter by Country

SitecoreHandbook
2 min readDec 30, 2019

Recently we have been working on a Sitecore Experience Accelerator (SXA) implementation for a large housing company in UK

One of the requirements was to provide a Search solution with :

  1. Location finder to search properties in a region or postcode
  2. Filter (Radius) — used to reduce the search results by geospatial comparison.
  3. Map View of the searched properties
  4. Location finder Auto complete should display suggestions for UK region only

The first three requirements can be implemented with SXA OOTB components (location finder , Radius filter , Maps) with absolutely no coding effort ! , I will not go over our implementation in this blog post , Micheal West’s excellent blog on SXA location Search should point you in the right direction

But, SXA(1.8.1) Location finder at the moment does not provide an option to filter suggestions based on location , this would require come backbone JS customization

  1. Duplicate the maps connector OOTB file under /sitecore/media library/Base Themes/Google Maps JS Connector/Scripts/google-maps-connector

2. Replace the api.LocationAutoComplete Function with the code below

3. Update Country Code to your desired country , Save and Publish the updated file

The Location Finder should now filter suggestions based on the country provided

Happy Sitecoring :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response