I agree there is an issue when you put two range filters in the same post view, I will escalate this issue.
Currently, please try these:
Edit the new post view:
hidden link
find and click into the filter "prijs", click button "Edit filter", and change the filter settings, see my screenshot range-filter3.JPG
Hi, sorry for the delayed response, I've been away for a few days.
I did as described and set the filter to Between (even though the other View has 'between, lower end' and 'between, higher end'), saved the shortcode, clicked edit again, the filter was still/again on 'equal to'. It doesn't stick to Between.
It should be a bug of range filter when use custom option values, does it effect on frontend?
hidden link
I have tried it in your website, it seems to be work fine.
Your url shows 0 results.
I needed to edit both price and mileage filters because I needed more values.
Whatever filter I set, it always shows 0 results 🙁
Sorry for the delay answer, I have tried your test site credentials again, it does not work any more:
https://toolset.com/forums/topic/need-range-filter-in-toolset-from-till/#post-2342029
Please provide the new credentials in below private message box, thanks
I have extended the temp login with 1 month
Thanks for the details, I have done below modifications in your website:
1) Dashboard-> Toolset-> Settings-> Custom Code, add one item "range-filters", with below codes:
add_filter('wpv_filter_query', function($query_args, $settings, $view_id){
if($view_id == 182 && isset($query_args['meta_query'])){
foreach( $query_args['meta_query'] as $k => $v){
if( in_array($v['key'], array('wpcf-kilometerstand', 'wpcf-prijs'))){
$query_args['meta_query'][$k]['type'] = 'NUMERIC';
$query_args['meta_query'][$k]['compare'] = 'BETWEEN';
}
}
}
return $query_args;
}, 99, 3);
It will override those two custom field filter settings: kilometerstand and prijs
2) Edit the post view "Voertuigen Filter":
hidden link
in section "Custom Search Settings", choose options:
- Let me choose individual settings manually-> Update the View results only when clicking on the search button-> Reload the page to update the View results
- Always show all values for inputs
Since you are using custom values in the select fields, the AJAX feature won't work as expected, so you can disable the AJAX as step 2)
Please test again, check if it is fixed.
More help:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.