Skip Navigation

[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 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 10 replies, has 2 voices.

Last updated by rafalM 2 years, 4 months ago.

Assigned support staff: Shane.

Author
Posts
#1346359

Hi,

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
Rafał

#1346369

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafal,

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

Please let me know if this helps.

Thanks,
Shane

#1346419

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?

#1346425

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafael,

Thank you for the update.

The results should be the same given that you've added the settings to the view with the smaller search bar.

It should still result in only the items for that CPT being display in the filter.

Could you send me a link to both pages with the different views?

Thanks,
Shane

#1346439

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ł

#1346541

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafal,

No problem.

Please keep me posted.

Thanks,
Shane

#1346681

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?

Thanks,
Rafał

#1346695

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafal,

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.

Thanks,
Shane

#1346705

Look's like I'll go that way than. Thanks for the help. I think this ticket can now be closed.

Thanks
Rafał

#1347295

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafal,

Awesome. Happy I was able to point you in the right direction.

There should be a mark as resolved option for you so you can go ahead and mark the ticket as resolved.

Thanks,
Shane

#1347539

My issue is resolved now. Thank you!