Free Directory, Listing & Classifieds WordPress Plugin › Support › General › HivePress › Multiple selection attribute does not work well when it filters
Multiple selection attribute does not work well when it filters
- Tommy5 months, 2 weeks ago
Create a multiple selection attribute (of listings) with at least two values.
Go to the navbar of filters in the web page.
1)Select only value “a” -> returns fine the tagged listing.
2)Select only value “b” -> returns fine the tagged listing.
3)Select values a and b -> no results found. Should return all listings with values a + b.ihor5 months, 2 weeks agodeveloper
Please let me know what hosting provider you’re using, I’ve seen the same issue with WordPress.com hosting and couldn’t find the reason, I guess this bug is specific to some PHP version.Tommy5 months ago
It is a regular shared hosting service, it is not inside WordPress.com.
The version of php that is running the site is PHP 7.2.letsgetdelivery5 months ago
I think i know what Tommy means. What I did to work around this was simply using Radio Buttons. The user won’t be able to make multiple selections BUT at least they won’t get 0 results. With a radio button rather than checkbox, it will be obvious that they have to pick one at a time. If you leave a checkbox a user may be confused .when they choose two options.ihor5 months agodeveloper
There will be an update in a few days and I’ll check this issue, but the last time I tested the Checkboxes attribute type I couldn’t reproduce it.unitehearts5 months ago
@Ihor – i have noticed the same issue with Select boxes also.
Assume I allow Users to select only one for Citizenship.
In the Search – i give the option of selecting more than one – to find those who have citizenship in either Country A or Country B.
The result is NIL – perhaps the Filter is using AND operator and not OR.ihor4 months, 4 weeks agodeveloper
Yes, there’s an AND operator set by default. Please consider using the select field instead of checkboxes for now (I’ll check if it’s possible to add some option for this later).Tommy4 months, 2 weeks ago
Is there any news about the patch of this bug?
I explain why. Basically the filters between attributes doesn’t work, regardless of the type of filters (within the available options) that you choose.
If you select and filter between attributes also ends up returning null. The problem is not only under the same attribute
Listing 1: attribute A with value 1, add tag. Ok,
Listing 2: attribute B with value 4, add tag. Ok.
If you select attribute A (value 1) AND attribute B (value 4): also returns null value.
So it’s problem that causes a lot of headaches because the combined filter system doesn’t work.ihor4 months, 1 week agodeveloper
I couldn’t reproduce it, I’ve seen the same issue with Checkboxes once, but it was specific to WordPress.com hosting. If possible send a step-by-step description for reproducing it (also you can send temporary WP access to firstname.lastname@example.org if it occurs only on your site). I installed HivePress and tested attributes a few times, but if you set the edit/search attribute types correctly (the attribute types should be compatible, for example you can’t make it “number” for editing and “checkboxes” for searching) then filters should work, they seem to work on the demo site https://demo.hivepress.io/
Ihor, if you say that the filters works well, I guess there’s no issue to fix it.
You wrote –> “Yes, there’s an AND operator set by default.”
Is there a way to change the behavior to OR ??
Or do you think that in the future there will be an internal option to change Y for O ?
Greetings and thanks.ihor4 months agodeveloper
If the issue is that only listings with all selected options are displayed (instead of at least one), then there’s no bug, there’s just an “AND” condition instead of “OR”. I’ll check if it’s possible to add an option for switching this in the next HivePress version.
” If the issue is that only listings with all selected options are displayed (instead of at least one) then there’s no bug, there’s just an “AND” condition instead of “OR” ” –>
So technically it wouldn’t be a bug, and agree with at least there may be an option to change the filters behavior to OR instead of AND.
Thanks in advance Ihor.
You must be logged in to reply to this topic.