Forums › Forums › Search & Filter Pro › Hide empty ranges (range filter dropdown)
Tagged: V3
- This topic has 3 replies, 2 voices, and was last updated 3 years, 10 months ago by Trevor.
-
Trevor(Private) January 27, 2021 at 8:40 pm #274324
I am not sure what you mean by empty ranges, but … range type fields do not filter down to take account of other form field choices in the current version of our plugin, although that behaviour may change in V3, which we plan to release in a few months (in the New Year).
This is intentional, as explained here:
Anonymous(Private) January 28, 2021 at 12:31 pm #274407With empty ranges I meant a range that has no posts with the queried values.
eg.
I have 3 products with prices:
10, 14, 25
I use a dropdown range with the ranges:
10-15
15-20
20-25The range 15-20 is “empty”, it has no results.
But this range is still displayed in the dropdown filter even though it has no possible results.Trevor(Private) January 28, 2021 at 6:07 pm #274431Ah. I understand. You cannot manually hide them because new posts added would make that hard to maintain, but there is no automatic way to detect whether there a are no posts for that entry, so you cannot use a Hide empty type of feature either.
All you could do is to make another custom field for the posts, and place the range entry as a term in each post, and make the form UI field a choice type field. As it is a Post meta, you could manually decide the order and which ones to exclude. This would require more work on making and editing the posts though.
-
AuthorPosts