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

  • Author
    Posts
  • Tommy

    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.

    ihordeveloper

    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.

    Tommy

    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.

    letsgetdelivery

    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.

    ihordeveloper

    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.

    unitehearts

    @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.

    ihordeveloper

    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).

    Tommy

    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.

    *Filter menu:

    attribute A:
    -Value 1
    -Value 2
    -Value 3

    attribute B:
    -Value 4
    -Value 5
    -Value 6

    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.

    ihordeveloper

    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 support@hivepress.io 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/

    Tommy

    Ihor, if you say that the filters works well, I guess there’s no issue to fix it.

    ——————
    One question:

    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.

    ihordeveloper

    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.

    Tommy

    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.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.