Sort & Filter Products by Distance
MageModule's Product Distance Sort & Filter extension allows customers to sort product lists on Category and Search Results pages by distance from their location and also filter the product list by a distance range from their location. It's simple: add address information or even very general location information like Mount Rushmore or New York City to some products. Using that information, either Google or Bing will automatically provide the latitude and longitude coordinates for the product’s location and it will be automatically saved to the product. On the frontend, the customer’s location will be automatically obtained from their IP address and the distance calculation will happen on the fly. Additionally, the products will be plotted out on a Google map for a helpful visual reference.
How Does It Work?
Product Distance Sort & Filter uses geocoding. Geocoding is the conversion of geographical information, such as an address, into latitude and longitude coordinates. When a customer comes onto the website, their IP address is used to automatically obtain their location coordinates. Then, a special mathematical formula is used to instantly calculate the distance from the starting point(the customer) to the endpoint(the product). That distance is then temporarily added to each product and used for sorting and/or filtering purposes.
Products can be sorted in either ascending or descending order by distance. When sorting by distance, any products that don’t have location data associated with them will be pushed to the end of the list. All of the other sort options (name, position, price, etc) will still work exactly as they always have. This just adds another great option to the list!
Product Distance Sort & Filter will:
- Sort products by distance from the customer’s location
- Add a distance filter slider to the layered navigation block
- Work on Category pages and Search Results pages
- Work with custom themes and third-party layered navigation modules
- Obtain customer’s location automatically from their IP address
- Utilize Google and Bing’s free geocoding APIs to obtain latitude and longitude coordinates for catalog products
- Obtain product location using information as specific as a street address or information as general as a postal code or landmark name
- Plot products onto an embedded Google map for visual representation
- Allow user to change their location manually
- Allow website administrator to choose whether to display distances in kilometers or miles
- Allow website administrator to set distance as the default sort option
- Allow website administrator to choose whether to display distance differently depending on product grid view or list view
- Allow website administrator to choose whether or not to display Google map