• Hi,

    on the Shop page there is a filter to show products by distance, i.e. the user sets the slider to 1km, 2km, etc… and sees all the products that are in the selected circle, i.e. at the selected distance.

    There are standard ways to sort, but I need a sort that is very important and I can’t find that sort: distance sort.

    If there are several hundred or several thousand products in a circle, the user wants to know which ones are closest to his location.

    Does anyone know a plugin that enables this?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • How did you implement the filter for the distance? Which plugin do you use for it? The answer to this question is crucial because you obviously already have the data for the distances. The plugin you are looking for should be able to refer to this and thus be compatible with it.

    Thread Starter edinbrankovic

    (@edinbrankovic)

    Hi,

    thanks for your answer.

    I use the WCFM multivendor platform from WC Lovers. This part with the radius filter is integrated into the plugin.

    On the platform there is, among other things, a list of vendors and a shop page with a list of products.

    There is also a radius filter on the List of Vendors, and when you look at that list, you can see for each vendor how far it is from the user.

    It would be difficult to add that information to the product itself on the Shop page, but it would be great if it could be sorted.

    Moderator bcworkz

    (@bcworkz)

    Because such a plugin that you seek would need to interact with existing location data which is unique to your product data, I’m skeptical you’ll find such a plugin unless it’s offered by the same developers who made the distance filter.

    If they cannot help you with what you want, a custom query with appropriate ordering could be developed if you have understanding of how the product location data is managed. Here’s some information about distance calculations on the Earth’s surface that will help you get started. Note that the methods suggested are only rough approximations. Accurate calculations involving ellipsoidal geometry would be much too complex and slow for practical DB queries.

    Thread Starter edinbrankovic

    (@edinbrankovic)

    Thanks for the advice, I will see this variant with the owners of the platform I use.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sorting by distance plugin’ is closed to new replies.