Skip Navigation

[Resolved] Multiselect choice 1 OR choice 2 based on select custom field

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by romanB-3 4 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#1670725

Hi,
On this page hidden link I have a view with several filters.
In the first filter, if I choose several choices, I got no result.
those filters are based on a "select" field in backend, but I should be able to display all schools having 2019 "Bonne qualité" OR "Très bonne qualité" for instance.
Thank you.

#1672025

Hi,

Thank you for contacting us and I'd be happy to assist.

Can you please check the "Query Filter" section of the view and confirm that in the filter for the "Classement ministère 2019" field, the comparison type is set to "number" with operation "equal to", for the URL parameter "wpv-wpcf-classement-ministere-2019".
( example screenshot: hidden link )

In case the issue still persists, you're welcome to share temporary admin login details so that I can see how this view's filters are set up in the admin area.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1673233

Thank you for sharing the admin access.

I've performed some test searches and the search filters seem to be working as expected now.

Note: In the "Query Filter" section, "AND" is selected for the fields filter relationship, which means that only those posts will show which will have all the field values which are selected in the search form.
( screenshot: hidden link )

If you'd like to change it so that posts with any of the selected values are shown, you can change "AND" to "OR".

Please let me know of any search example, which is still bringing in incorrect results.

#1673429

On hidden link
First filter is "Classement 2019"
When I select only first choice "Très bonne qualité", I got 4 results.
When I select only second choice "Bonne qualité", I got 13 other results.
When I select both I only got the same 4 results as if I have had selected only "Très bonne qualité", where I should get 17 results.
I tried to change the view's query filters relationship to "OR" with no change at all.
Thank you.

#1675107

Thank you for sharing these details.

During testing with similar data and search filters on my test website, I noticed that there is a slight difference in how the query filter works in regular post views and WordPress Archives.

In WordPress Archives, you'll need to select "in" operator when using a multi-select type search filter.
( screenshot: hidden link )

Now, if you'll search for "Très bonne qualité" and "Bonne qualité" both in the first filter "Classement 2019", total of 18 results will show (4 + 14 ).

#1675131

My issue is resolved now. Thank you!
Thank you very much!