Option to Sort Listings by Distance

Hey,

Edit: it seems like this option already exists, and I have it enabled in the backend, but can’t see it on the front-end.


I just wanted to share another idea that I feel would be a great addition for HivePress and the community.

Whilst the Geolocation extension is activate, it would be really nice if the Listing ‘sort by’ options allowed us to choose ‘Distance’.

E.g.

  • A user enters a keyword and location
  • Chooses ‘Distance’ from the sorting options
  • The Listings then get displayed in order of nearest to furthest from the entered Location.

I’ll likely have a go at this myself once time allows, so I’ll share what I come up with then!

Cheers,
Chris :victory_hand:

Hi Chris,

At the moment, Date is the default sorting option. However, when a user performs a search with the Location field filled in, the default sorting automatically changes to Distance [if the Enable sorting by distance feature is activated].

In other words, since users don’t have a default location assigned and different users may browse from different locations, sorting by Distance is only applied when a specific location is provided in the search.

Hope this clarifies things

Hey @kseniia,

Ah, I see! Thank you for clarifying how it all works. That makes sense!

It had only came to mind last night, and during a quick test, I must have not filled in the Location field, as I’ve just retested this, and, I can in fact see the option now. :man_facepalming:

Thanks again for all your help!

Cheers,
Chris :victory_hand:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.