Forums Forums Search & Filter Pro can I use the checkbox to search a range of meta value

Viewing 10 posts - 1 through 10 (of 12 total)
  • Anonymous
    #131861

    hello everyone, the question is how to perform the range search with checkbox?
    For example, there are 26 characters. and I only provide 10 character options (a,b,c,d,..,j) to user.
    and the last option j which option I want to show the characters J and after J like k,l…. .

    Trevor
    #131878

    So you want 10 choices like

    a
    b
    c
    d
    e
    f
    g
    h
    i
    j-z

    If so, you might be able to use our Edit Query Arguments filter:

    https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Edit_Query_Arguments

    Where you would check if j-z had been selected and change the argument from that to an array.

    Anonymous
    #131887
    This reply has been marked as private.
    Trevor
    #131892

    You would need to be running a child theme, and inside the child theme folder on your server would be a file called functions.php

    Edit that and add the sample code on new lines in the file.

    There are examples of using the code in this forum, using this search:

    https://support.searchandfilter.com/forums/search/sf_edit_query_args/

    But I am unable to provide help with the coding. For that you would need to hire a coder.

    Anonymous
    #131894
    This reply has been marked as private.
    Trevor
    #131896

    No, the code I gave you is called by our plugin and applied to the form ID number used. The code example you have does nothing until you add your own code into it. All I have shown you is the wrapper code to join it to the results.

    Anonymous
    #131898
    This reply has been marked as private.
    Trevor
    #131901

    I do not think so, no. In any event, range searches work only on purely numerical data.

    Anonymous
    #131903
    This reply has been marked as private.
    Trevor
    #131905

    Not within our cache of the data. The actual value stored in the database would have to be. This also presumes you use no special characters. I think the issue would then become that a range search on numbers cannot be done with checkboxes, but it can with radio buttons, in the radio buttons option only allows to regularly spaced/stepped ranges. E.g

    11-20
    21-30
    31-40
    41-50

    All steps of 10, but this is not allowed:

    11-20
    21-30
    31-40
    41-50
    51-100

    Steps of 10, but the last is a step of 50.

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