Forums Forums Search & Filter Pro Wildcard for empty fields

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #141122

    I have a catalogue.
    Each product is a separate Post.
    They have ACF fields like these:

    Product Code
    Product Series
    Category
    Width
    Height
    Weight

    Some product have one or two fields that are not filled.
    EG, they miss Width and/or Weight.

    When I do a search, the items that have these fields void are excluded from the results.

    Field relationships are set as “AND”.
    ACF for Width and Weight are set as number fields.

    Is there a way to set a wildcard for these fileds that are not filled so that they won’t be excluded from results?

    Trevor
    #141127

    Are these meta keys being searched with a Range field, because that would cause the problem. At this time you can sort of work around it (by using the Edit Query Argument filter to remove the unwanted range parameters). There will be snippets other users have posted on how they did this if you search for:

    sf_input_object_pre range

    Anonymous
    #141129

    Thanks for prompt answer. Yes, they are Range fileds. I’m going to read the link you’ve provided. I’ll be back to tell you if I’ll fix the issue or not 😉

    Anonymous
    #141131

    Hmmm… ok, if I’ve understood right, one of these snippets should cut out the unneeded parameters. but I’m not finding how to do it. I’ve seen that by modifyng the parameters in the url I can get the right search but that way I’m changing “the question” while I need to change “the answer” and actually I don’t know how to achieve it with code. I guees I’d need something that allow to search for a particular range only if its field has a value….

    Trevor
    #141133

    Yes, you remove the condition entirely. Try doing a search now, see the URL has the range in it? Edit that out in the URL and you will see the effect. Try doing the search without the word ‘range’, because I know someone has posted their solution.

    Anonymous
    #141135

    Do you mean to open the url

    https://support.searchandfilter.com/forums/search/sf_input_object_pre/
    instead of
    https://support.searchandfilter.com/forums/search/sf_input_object_pre+range/ ?

    I’m afraid i’ll need some more help Trevor, in any case I really appreciate your fast answers…

    Trevor
    #141251
    This reply has been marked as private.
    Anonymous
    #141253
    This reply has been marked as private.
    Trevor
    #141255
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)