DUPLICATE: Query Filter: parent terms are disabled when products are assigned to child terms only

Setup

Shop page with a product query loop (post type: product) and a
Filter – [Radio / Checkbox] element targeting that loop.

Filter source: Taxonomy → Product categories
Option “Top level terms only” enabled.

Category structure:

Audio (0 products directly assigned)
├─ Headphones (12 products)
└─ Cables (3 products)

Products are assigned to the child terms only, never to the parent term.

Steps to reproduce

  1. Create a parent product category with two child categories.
  2. Assign products to the child terms only, none to the parent.
  3. Add a product query loop and a Filter – [Radio] element targeting it,
    source = product categories, limited to top-level terms.
  4. Regenerate the filter index.
  5. Open the page on the frontend.

Expected

“Audio” is selectable and returns 15 products (12 + 3), because a tax_query
on a hierarchical taxonomy includes child terms by default
(include_children = true).

Actual

“Audio” is rendered as disabled and cannot be selected. It is treated as if
it had 0 matching results.

Why this looks like a bug rather than a config issue

Calling the filter URL parameter manually works exactly as expected:

/shop/?_category=audio → all 15 products are returned.

So the query side already resolves child terms correctly. Only the option
state in the filter UI is wrong.

Hi Jonas,
There is already a somewhat older feature request regarding this, which we are currently working on:

Accordingly, I am closing this report, and we will update the original thread once the issue is resolved.