Skip Navigation

[Resolved] Restrict Filter Values based on Filter Choices

This support ticket is created 6 years, 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 replies, has 1 voice.

Last updated by Adrian 6 years, 7 months ago.

Author
Posts
#628865
weird-combination.jpg

Hi,

I am using a filtered view:

Here is my filter content:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Makes[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="make" type="select" url_param="wpv-make"]
  	<div class="form-group">
	<label>[wpml-string context="wpv-views"]Models[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="model" type="select" url_param="wpv-model"]
      <div class="form-group"> 
	<label>[wpml-string context="wpv-views"]Years[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="model-year" type="select" url_param="wpv-model-year"]
</div>
</div>
</div>
[/wpv-filter-controls]
[wpv-filter-end]

And my view just shows the titles of the products in a list:

<!-- views-start -->
[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<ul>
		<wpv-loop>
          <li>[wpv-post-title]</li>
		</wpv-loop>
        </ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]
<!-- views-end -->

I get that the views filter almost does that on its own, but in this example, one part will fit multiple makes and model. Because of that part these combinations become available.

I would like to filter these results so that when the first field changes, the second dropdown only shows models that I designate to be a model of the make selected. Is there a way to do so? I imagine through javascript...

#628869

Update:
the URL to the page is hidden link

It seems that a lot of the weird filter combinations (IE Ford -> Tacoma) come up empty.

#628878
toolset_combo.jpg

Ok so I found the solution:

The settings below work perfectly 😀