Range and Checkbox filters
Hi Low,
I'm experiencing some trouble getting filters to work properly. I have some criteria for properties to be filtered. For example, I have this in my $_GET array: [range:property_rent] => 200|890.
Now I expect it to return all properties that have a rent from 200 between 890 but it's also returning properties that for example have a rent of $2000.
Next to that I have some checkboxes in my publish area (Native ee checkbox field). It contains features for the property like: parking, cats, dogs, bicycle.
When I check the features parking and cats it should only return the properties that have these two properties checked. Right now it seems to return everything that contains parking or cats. It should return parking and cats.
I hope this makes sense and you can give me a push in the right direction! Thanks!
Regards, Dion.
Replies
Low 24 May 2014 16:06
Make sure the property_rent field's "Field Content" setting is set to something other than "Any", so it's an actual numeric field, not a string pretending to be a number.
Also, for the input field targeting the checkbox field, make sure you add the parameter name to the require_all="" param, to change the behaviour from OR to AND. So if you're using name="search:checkbox_field[]" for the checkboxes, set this param to the Results tag: require_all="search:checkbox_field"
Dion Snoeijen 24 May 2014 16:19
Wow, fast! Thanks man. I will give this a try.