Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom field filters – selectors : Night Duration
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 11 months ago.
- AuthorPosts
- April 20, 2021 at 1:18 pm #32839
Hello Ernest Marcinko,
As topic please refer to screenshot. Is there a way to create a selectors ( Above 15 Nights ) with other duration that i state in screenshot? i seems cant find a way. Please advice
Regards
-
This topic was modified 1 year, 11 months ago by
wankhee93.
Attachments:
You must be logged in to view attached files.April 20, 2021 at 1:22 pm #32853Hi,
With a radio button filter it is not possible I’m afraid, you need a range slider for that.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 20, 2021 at 3:53 pm #32856Hello Ernest Marcinko,
Is it possible like:
16::TO::100||Above 15 Nights
or i must list out:
16::17::18::19::20::21::22::23 etc until ::100||Above 15 Nights ?
Actually we prefer radio.Regards
April 21, 2021 at 12:08 pm #32866That way is not possible, but you can try custom coding to map values and change the operator via the asp_query_args hook:
add_filter("asp_query_args", "asp_query_args_change", 10, 2); function asp_query_args_change($args, $search_id) { foreach( $args['post_meta_filter'] as &$filter ) { if ($filter['key'] == 'nights_duration') { if ( strpos($filter['value'], '--') !== false ) { $filter['value'] = explode('--', $filter['value']); $filter['operator'] = "BETWEEN"; } } } return $args; }
..then use the range values like:
1--3||1-3 Nights 4--6||4-6 Nights
etc..
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
-
This topic was modified 1 year, 11 months ago by
- AuthorPosts
You must be logged in to reply to this topic.