Skip Navigation

[Resolved] Display 2nd part of search only after a first choice has been made

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.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 1 year, 3 months ago.

Author
Posts
#2645287

hidden link
I have Woo products extended with 2 taxonomies: 1/ country ("Land) and 2/ region ("Regio).
I was able to set up the 2 filters.
However, I would prefer customers to first select the country and then, if available, select the region. But I am unable to make the region checkboxes display conditionally. I just don't find the right condition in the list of possibilities.

#2645497

Nigel
Supporter

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

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

Hi there

You want the users to choose a country, and only then have the region checkboxes appear?

You can't use conditional blocks or conditional shortcodes for that, because they are evaluated at the time the page is generated.

You want to add interactivity to a page that has already been sent to the browser, in which case you will need a JavaScript solution.

You should be able to hide the region checkboxes UI on the DOM ready event, and expose it by adding an onchange event listener to the country selector.

(If you want it to only show regions that correspond to the country, while the two are not directly linked, you can achieve a similar result by setting the View search options to only show filter options that would produce results.)