Sauter la navigation

[Résolu] Hide filter option that doesn’t produce a result

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

The "tarief" (price) filter on the site was incorrectly displaying filter options that no longer had relevant results. Even when no posts matched a certain price range, the filter option still appeared.

Solution:

The issue was caused by a mismatch between the field type and the filter type. The price range field was originally set as a radio button, but the filter was using checkboxes. Changing the field type to checkboxes resolved the issue, ensuring that only relevant options appear based on available posts.

This support ticket is created Il y a 2 mois et 3 semaines. 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.

Ce sujet contient 0 réponses, a 1 voix.

Dernière mise à jour par Marcel Il y a 2 mois.

Assisté par: Christopher Amirian.

Auteur
Publications
#2795685

On this site: lien caché, we have a filter called "tarief", which is the price. There are 3 options: up to 2000, 2001 - 4000 and over 4000.

The problem is, when there's a post that has the 2001 - 4000 range, the filter option "over 4000" will still show as well, even though that doesn't have results anymore.

Please see this 90s video: lien caché

#2795960

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi,

Welcome to Toolset support. I wonder if it is related to the fact that the option is a radio button but you selected the checkbox option in the front end?

What happens if you select radio button as default? Doe sthe same issue happen?

If yes, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.

Make sure you set the next reply as private.

Also please give us permission to copy your website if needed to check on our side.

#2796325

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi,

Thank you for the video and sorry for the late reply. I asked for help regarding this and will get back to you as soon as I have an answer.

Thanks.

#2796511

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi,

I have an answer from the second tier support:

I think the problem is that the filter is based on a radio field but the filter itself is a checkboxes filter.

I edited the View in question and changed the filter to a radio filter, and now it works.

Would you please double check now and see if it works as you intended?

Thanks.

#2798433

I have now changed the field type to checkboxes, then it works as intended.