Support Forums

The forums are closed and will be removed when we launch our new site.

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

Forums Forums Search & Filter Pro Number Range not working as I would expect

Viewing 10 posts - 1 through 10 (of 16 total)
  • dann hanks
    #153812

    Hi, I am using search and filter to filter properties.

    Each of my properties has a custom ACF field to add a number of maximum guests that are allowed to stay in the property.

    I have used a ‘Range dropdown’ field to try and filter this data.

    So on my search form I have a dropdown that says sleeps between: 1 > 24

    I have a property that allows 8

    If, on the search form, I select 1 > 8 it finds the property.

    If I select 1 > 4 it doesn’t find the property.

    As the 8 person property can obviously take 4 people, I would expect the range to pick up that this number (4) is in-between 1 and 8.

    Maybe I am going about it in the wrong way.

    Any advice would be great.

    Cheers

    Dann

    Trevor Moderator
    #153813

    That is how I would expect the range to work.

    The only way that is can work is if the ACF field is set to accept multiple values, and it contains 8 and all the values below it (1,2,3,4,5,6,7 and 8), or that you have a separate field that contains all these values. In ACF you can make a field calculated, so when a post has the field with 8 in saved, the calculated field could than fill with the numbers 1 thru 8.

    dann hanks
    #153815

    Hi Trevor, thanks for the reply.

    It might be a setting I have not added right?

    As its a user inputted number field, I can’t expect the users to add 1,2,3 etc – I think this would have to be automatic.

    I am going to private post 2 screenshots below, 1.png is my settings in search and filter, 2.png is my setting for the ACF field.

    Any ideas?

    dann hanks
    #153817
    This reply has been marked as private.
    Trevor Moderator
    #153820

    Your settings are correct. But our range matching does not do ‘equal or less than’, which is what you want, so my suggestion is the only way around this for now (and does not need the user to do anything). I believe the feature you want is on our ‘to do’ list.

    dann hanks
    #153824

    Thanks Trevor – sorry I don’t understand what I need to do in ACF to achieve this?

    I have re-read your suggestion but not sure how to implement?

    Trevor Moderator
    #153826

    You would have two fields. One that the user currently enters the maximum occupancy in to, the other is a calculated field, and which the search is based on.

    You may need to resort to help on the ACF forums, but this is where I would start:

    ACF Forums

    dann hanks
    #153831

    Thanks for the suggestion, I might have to look for another way around – I have looked through the top links for the search you provided but I really don’t understand how this works / I cant relate it to my issue.

    Your solution is just a bit above my head I think..

    : /

    I will let you know here if I find another solution.

    thanks

    dann hanks
    #153859

    Hi,

    I have almost got a solution which would be easy to implement and would mean that I wouldn’t have to change the way the user adds the data.

    I have chosen the ‘Choice’ field rather than the number Range field in S&F.

    The value I am after is for number of guests.

    So, I have set my first choice in the dropdown to:

    Value:

    1&_sfm_numberofguests=2&_sfm_numberofguests=3&_sfm_numberofguests=4&_sfm_numberofguests=5&_sfm_numberofguests=6&_sfm_numberofguests7&_sfm_numberofguests=8&_sfm_numberofguests=9&_sfm_numberofguests=10&_sfm_numberofguests=11&_sfm_numberofguests=12

    Label:

    1

    … If this passed through to the form intact it would work.

    It would look like:

    http://mywebsite.com/?sfid=1627&_sfm_numberofguests=1&_sfm_numberofguests=2&_sfm_numberofguests=3&_sfm_numberofguests=4&_sfm_numberofguests=5&_sfm_numberofguests=6&_sfm_numberofguests7&_sfm_numberofguests=8&_sfm_numberofguests=9&_sfm_numberofguests=10&_sfm_numberofguests=11&_sfm_numberofguests=12

    This would mean that the ‘1’ guest could potentially stay in a property of any size from 1 > 12.

    Instead, when it gets passed through the form it looks like this:

    http://mywebsite.com/?sfid=1627&_sfm_numberofguests=1%26_sfm_numberofguests%3D2%26_sfm_numberofguests%3D3%26_sfm_numberofguests%3D4%26_sfm_numberofguests%3D5%26_sfm_numberofguests%3D6%26_sfm_numberofguests%3D7%26_sfm_numberofguests%3D8%26_sfm_numberofguests%3D9%26_sfm_numberofguests%3D10%26_sfm_numberofguests%3D11%26_sfm_numberofguests%3D12

    … replacing ‘ & ‘ with ‘ %26 ‘ and replacing ‘ = ‘ with ‘ %3D ‘

    … is there a way to pass this value through without it replacing the &’s and the =’s?

    Cheers

    Trevor Moderator
    #153867

    What happens if you untick the Use same for End Key but leave it the same key?

    You should then get some match choices?

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

The topic ‘Number Range not working as I would expect’ is closed to new replies.