This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Drop Down Search multiple values with Custom Fields search.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Drop Down Search multiple values with Custom Fields search.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29076
    ChrisBCG32ChrisBCG32
    Participant

    Hello,

    I’m trying to make an “Advanced Search” by utilizing custom fields in Ajax Search Pro under Frontend Search Settings > Custom Fields.

    Some of the items that are searchable have custom fields with more than one value applied to it. (ex. The Flying Sword has condition immunity: charmed as well as condition immunity: poisoned.)

    One of the goals is for users to be able to add multiple values in the search to better refine their results. (ex. If they enter poisoned in the condition immunities field, they get multiple results including the Flying Sword and the Imp. But if they add charmed, the imp should be removed from the results as it does not have this value applied.)

    We’ve been fiddled around with the settings, and when Drop-down values logic is set to OR, it looks like when multiple values are selected it will show all results that meet at least one of the selected values.

    My goal is to make it so that if more than one value is selected for the same custom field, the only results that show are ones that match all of the applied criteria. So we tried setting Drop-down values logic to AND, however this did not work as expected. Instead once a second value is applied in the search no results come up.

    #29077
    ChrisBCG32ChrisBCG32
    Participant

    I thought I provided screenshots, but looks like they didn’t carry over. Sorry if they did and I’m sending duplicates.

    #29094
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you very much for your detailed ticket. I was able to replicate this setup and found the cause. Generally it is not a common practice to use multiple instances of the same custom field by name to store multiple values, but WordPress allows that, so it should be fine.
    The problem with this is, that the plugin query applies this logic one a single field level – so the value1 AND value2 means, that it should match a single existing field value, not one value in one field, and another one in another field etc..

    I was able to come up with a possible solution, but I will have to extensively test it before a final release. We have a minor bugfix release planned for this week, a solution to this should be in it as well (by adding a new logic option).
    You will get a notification from codecanyon once the update is ready, should take a few days, if that is okay for you.

    #29103
    ChrisBCG32ChrisBCG32
    Participant

    Hey Ernest!

    No worries, I work in support myself and when I’m not doing that I work with artists, so I always try to give as much detail as possible!

    I’m so happy to hear that you were able to find a solution. And absolutely, development takes time, I’m more than content with waiting a bit. In the meantime I can just keep working on other parts of the site.

    Have a great day Ernest!

    #29121
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank you, and a great day to you too!

    #29184
    ChrisBCG32ChrisBCG32
    Participant

    Just got the update! Thank you so much! Feel free to close this ticket! 😀

    #29195
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Drop Down Search multiple values with Custom Fields search.’ is closed to new replies.