[Resolved] Search showing all values possible for filters
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that the user wants to only show the available options on their frontend filters. This means they only want the filter to display options that will return a result.
Solution:
We can fix this by using the Custom Search Settings of Views.
If you go to you view, then scroll down to the Custom Search Settings section. Then select the option "Let me choose individual settings manually"
Next we scroll to the section "Which options to display in the form inputs" then select "Show only available options for each input" From here you are able to customize how each filter type will respond to this setting
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.
I have a page with search and results of products where I use a view with parametric search for my store. The filter values there are only those that are used in products. There is also another page where I have only search. It redirects to the other page.
The issue is that on page where I have just search the filters there show all available values and not only those that are used in products like on the page where both search and results are shown. Is this an issue of configuration? How can I make both page searches show only available values for filters?
Thanks for getting in touch
So your filters themselves are showing all the possible values correct?
We can fix this by using the advanced search settings of Views See Screenshot
I did a check again and I think I found the issue.
For both pages I use different views. The second one is a copy of the first.
Now I did a test where both pages used the same view and was ok (with the setting on the img). Its not working only when I use two different views.
What I wanted was to have one smaller search with different styling on some page, and one big with results on main shop page. Is this doable?
I'll check it in couple of hours, there were many changes lately and could be that all was an issue because of the broken small search. Most the time updated was only the big one. But now I know it should work. If I cant fix it, I will prepare links for it.
Thanks for help and for the quick responses!
Rafał
After removing some old filters the issue got fixed. Now I see only the results that I wanted.
One last. Is there a way to disable search values update? Now each time I pick a value from one filter the others get reduced to the remaining ones. Or at least a way to change the values existing in the dropdowns?
The only way to work around this is to add a reset button.
So how the option for only the available values work is that it will always ensure that your view will return a result based on what is being filtered.
If you view is already filtered then it will only give the options to filter that current list.
You will need to add a reset button to the search in order for it to show the other values that would return results as well.