[Résolu] Filters showing all options instead of relevant options
Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
The setting to “Show only filter options that would produce results” in a View with custom search can result in expensive queries on larger sites with several filters, and the last update of Views/Blocks included efforts to optimise these to make them maximally efficient.
It seems that in some cases this has led to the setting not working at all, in particlar on the initial page load rather than when changes to filters are applied, such that filter options include options that would lead to no results.
Solution:
This is fixed in next version of Toolset Views/Blocks plugins, currently you can try the patch file of below erratum:
I am trying to:
Use several filters on an archive page using Types, Blocks and WooCommerce Blocks but with classic Views, not block built Views as this site has been around longer than Blocks and has complicated archives, views and content templates that aren't easy to move to Blocks.
Link to a page where the issue can be seen: lien caché
I expected to see:
On this and any product taxonomy related archive we used to only see checkboxes for options that will produce results.
Instead, I got:
With the most recent updates ( Types 3.4.10, Blocks 1.5.2, WooCommerce Blocks 3.1 ) we are now seeing all filter options, not just those for which products in the current archive have values.
I assume we are talking about a taxonomy archive page, and you are going to design the WordPress Archive page with classic editor.
If it is, please check these:
1) Dashboard-> Toolset-> WordPress Archive,
Setup one WordPress Archive for the taxonomy "product-category" with custom search form.
2) In above Toolset WordPress Archive, section "Custom Search Settings", enable option:
Let me choose individual settings manually-> Show only available options for each input
This is a site that has been working for years. It has many archives and views on it with filters. If the settings are different now, why are the defaults different than they have been in the past?
That means I need to go make changes to hundreds of filters on dozens of sites to get them all back to working the way they have for many years now.
More importantly, I set the setting to hide the options that won't produce results and they are still showing. I cleared cache and tested from more than one browser.
Go here: lien caché
Check 12 MIL Residential
No results
Attached image shows this archive's search settings.
2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP code snippets, and test again
3) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, I need to test and debug it in my localhost, thanks https://toolset.com/faq/provide-supporters-copy-site/
We've noticed the same issue, only Googled this morning and found it was a recent issue and your ticket.
Fortunately we are rebuilding a site and I thought we'd broken something, so still had live sites on exactly the same setup. Filers fine on those until I updated Toolset...this broke the filters.
I spent 5 hours yesterday looking for the issue our end...seems to be an update issue? Waiting to hear back from support ref this 🙂
Thanks for the details, please provide a little more details:
In which version Toolset plugins, you can get the expected results:
On this and any product taxonomy related archive we used to only see checkboxes for options that will produce results.
I need to duplicate the same problem and compare them in my localhost
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
@Pete could you please open a new thread. It would be helpful to get a copy of your site for testing, and you'll need to open a new thread so that we can get credentials from you.
Update to the latest versions of all other active Toolset plugins first, then apply the patch to the updated Blocks plugin file. Let us know if the issue is not resolved completely after the modification.