Skip Navigation

[Resolved] Conditionnal display filters based on a first filter result

This support ticket is created 6 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#618346

Hi.

My site is areal estate site with properties.
All my properties have a post field named "location" in order to know that this property is next to the sea, this one in a city or this one in a mountain village.

They all have 1 taxonomy listing the available services. For example "ski renting", 'spa", "hammam", "boat renting", etc... All the services are under one of the 3 parents : "sea, mountain, city".

I have another post field which is a "select" list : sea, mountain, city.

I'm now creating my WordPress Archive page to view these properties.
I added filters to display only the properties corresponding to some criteria.
So if I choose my select list post field and I select mountain, it will display only the properties in the mountains. If I choose city, I will see only the properties in a city.

I would like to have visible only my "select list : sea, mountain, city". and display the "services" taxonomie child items corresponding to sea/city/mountain.

I was hoping doing that with "conditional output", but I can not use the value of the 1st dropdown list filter to display one or another corresponding taxonomy section to have only the services for a sea property displayed or the ones for a mountain property.

Can you help me ?

Thanks a lot.

Best regards

#618568

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Fabrice

If I have understood you correctly your posts have a custom field with options of sea, mountain, or city, and you also have a taxonomy services that is hierarchical, and the top level term is also sea, mountain, or city, and under these are the services that may be available at each type of location.

You want your search form to initially show only the filter for the custom field, and then depending on what is selected, show the taxonomy filter, but only for services for the matching location.

Is that correct?

This isn't something that can be done without adding some custom code, though I can help you with that.

My first observation is that grouping the services taxonomies together in a single hierarchical taxonomy is not very helpful for this. It would be easier to have 3 separate taxonomies, sea-services, mountain-services, and city-services, add each of these taxonomies as filters, and then selectively hide/show the filters depending on what had been chosen with the custom field filter.

Is that an option?

#618581

Thank you Nigel.
Is there then a possibility to have a multi-step filters system ?

I mean, choosing Sea, Mountain or City and then, following the choice, display a additional filter checkboxes with the sea services if you choose SEA or the Mountain services if you choose MOUNTAIN ?

#618652

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You can't do that without adding some custom code, and exactly what that code would do depends on how you set up the data.

So that's what I was trying to confirm in the last post.