Skip Navigation

[Resolved] Limit view results to a certain distance from the logged in users address

This thread is resolved. Here is a description of the problem and solution.

Problem: Is it possible to limit a View's results to a certain distance based on the current User's role, established by purchasing a site registration package?

Solution: You can create 3 different Views with the different distance filters applied. You can use a shortcode attribute to set the distance center point, based on the User's profile address information. When a User buys a specific package, you can adjust his or her User role with Forms Commerce. Then based on the User's role, you can display one of those 3 Views with conditionals.

Relevant Documentation:
https://toolset.com/documentation-category/cred-commerce/
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1356227

Hi,

I got a request from a client who wants to sell leads to professionals. He wants to sell different packages, based on the distance from the professionals address.

So when the professional buys package 1, he can see all quote requests from clients within a 25 kilometer radius. When he buys package 2, he can see all quote requests within a 50 kilometer radius. When he buys package 3, he can see all quote requests within a 100 kilometer radius.

So the base of that radius should be the professionals address in their profile.

Is this possible with Toolset?

#1356437

Hi, yes this is possible in Toolset. You can create 3 different Views with the different distance filters applied. You can use a shortcode attribute to set the distance center point, based on the User's profile address information. When a User buys a specific package, you can adjust his or her User role with Forms Commerce. Then based on the User's role, you can display one of those 3 Views with conditionals.

Some documentation about these concepts:
https://toolset.com/documentation-category/cred-commerce/
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/

#1356517

Hi Christian,

Thanks for the quick reply 🙂 That's all the info I need for now, let's get the quote out 😉

Best regards,

Marcel