Forums Forums Search & Filter Pro Hide empty ranges (range filter dropdown)

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #274268

    Hello,

    We use a range filter with the type “Range – Dropdown”.
    We want to hide empty ranges from the dropdown selection.
    Is this possible?

    Trevor
    #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:

    https://support.searchandfilter.com/forums/topic/post-meta-field-values-not-showing-correctly-on-woocommerce-product-categories/#post-257013

    Anonymous
    #274407

    With 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-25

    The 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
    #274431

    Ah. 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.

Viewing 4 posts - 1 through 4 (of 4 total)