Skip Navigation

[Resolved] location and agent many to many relationship

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 8 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 8 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#420114

I am creating a site where agents can have multiple locations based on city and state. Each city and state will already be stored in the system and the agent should select the cities that they offer their services in via a cred form. Additionally I need a parametric filter that searches for agents based on a city/state combination.

The workflows should resemble something like this.

The cred form for the agent to fill out:
Should list states with their associated cities and the agent will simply check off the cities that they offer services.

The filter for users:
The user should first select a state from a drop down, then the next drop down will display the cities associated with the selected state. once the city is selected and the user clicks the search button, all agents who have selected that city/state combination will be displayed.

#420265

Dear bryan,

There is parameter search feature within Views plugin:
Search on the parent/child relationships:
See our document:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/
There are similar option "State" and "City" fields in the search form,

You can see the live demo site here:
hidden link

And create your own live Real Estate demo site here:
http://discover-wp.com/site-templates/
Hope it help

#420881

Cool, I have looked into this solution. Before I dive in to much to this solution I want to make sure of one important aspect.

Will each agent be able to have multiple parent locations. Also will they be able to add these locations via a Cred form? This way an agent can service multiple cities.

#421058

Q1) Will each agent be able to have multiple parent locations
No, in above demo site, post type "Houses" is a child post type of "City", so one "House" post can correspond to only one "City" post

Q2) Also will they be able to add these locations via a Cred form?
In your case, I suggest you try this:
1) Create a custom Hierarchical taxonomy "location", assign it to post type "agents", and setup the terms like this:
- state 1
-- City A
-- City B
- state 2
-- City C
-- City D
...
https://toolset.com/documentation/user-guides/create-custom-taxonomies/

2) Then you will be able to associate one "agent" post with multiple Cities, and also will be able to add these locations via a Cred form.

#421061

Yes this is what I am currently doing, the problem is in the search. To create a parametric search using this taxonomy their will be a drop down with thousands of options. I am told that there is not a way to have two drop downs, one with the states and the other with the cities which populate based on the states selected. Is their a better workaround that has been discovered for this?

#421096

About the question:
there is not a way to have two drop downs
It is already in our to-do list, here is the feedback from our developers:
there are plans to improve this, there isn't better workaround for now
And I added this thread into that to-do, hope it will raise our developers attention.

Currently, You can subscribe to our blog to get the updated news:
https://toolset.com/blog/

Or Check out our certified partners:
https://toolset.com/consultant/

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.