Support Forums

Hey there, it looks like you've been redirected from designsandcode.com - as you can see we have a new home - read more

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro number based searching

Viewing 10 posts - 1 through 10 (of 14 total)
  • dann hanks
    #117074

    Hi, I am using search and filter with Advanced Custom Fields Pro (ACF)

    one of my fields is ‘number of bedrooms’ I have many properties with various numbers and am finding it tricky getting the right logic for the search fields.

    At the moment, its just in as is so if you search for 3 bedrooms, it shows properties with 3 bedrooms. Really, I need this to be 3 and above so if I wwere to select 3, it would also show the 4 properties, 5 properties, 6 properties etc…

    I just cant figure out how to set this up right.

    Trevor Moderator
    #117153

    Because we do not have a search operator for numeric fields, in this case >= would be needed, you would need to have a second ACF field that has 3, 4, 5 AND 6 in it (etc) as a multi select field (an array), and search in that instead. I am hoping that this functionality will be in the forthcoming V3

    dann hanks
    #117168

    Hi Trevor, I notice that when I change the post meta field to a number dropdown the search comes out like something like this this:

    website.com/?sfid=132396&_sfm_bedrooms=2+4

    … the 2+4 part is obviuosly an inclusion of all 2,3 and 4 bedroom properties as it returns all of these.

    I tried to do this through manual values in a manual drop down list eg:

    label: 1, Value: 1
    label: 2, Value: 1+2
    label: 3, Value: 1+3
    label: 4, Value: 1+4

    … but as soon as I take it out of the ‘number’ option in the post meta these urls no longer work. There isnt many options in the ‘number’ section and certainly nothing that suits my criteria.

    I am a little confused about your explanation above, are you saying the only way to do this is to add other meta values to the posts? If so this will be impossible as users setup their own properties, I couldnt expect them to add extra data, it is a simple question for them: how many bedrooms are there? are there any other ways around this?

    Trevor Moderator
    #117282

    I am not sure you understood me. I did not mean to do that in the search form. It would an extra custom field in the ACF group.

    dann hanks
    #117719

    Hi Trevor, what I am saying is the users (property owners) are creating their own listings so I couldnt expect them to add extra data, it would just be a simple question of how many bedrooms they have.

    Trevor Moderator
    #117725

    Ah. Then finding a way to do it in the form field would be best.

    If the field is set to AND search operator and checkboxes, what does the search URL look like for more than one?

    Trevor Moderator
    #117736

    My bad. It looks like you answered that, so all we need to do is figure how to encode this, as you already tried, in the form field settings.

    Are you able to send me admin logins for the site so that I can investigate this in the form setup? Please use a Private Reply.

    dann hanks
    #117741
    This reply has been marked as private.
    Trevor Moderator
    #117774

    Hi

    It is late here now, so I will jump on this early tomorrow.

    Trevor Moderator
    #117947
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 14 total)

You must be logged in to reply to this topic.