we have a woocommerce shop for bike parts. Our parent category name is "Motorcycle-Parts". Subcategories are the motorcycle brands, like:
Motorcycle-Parts
=> Suzuki
=> Honda
=> Yamaha
...
Inside the subcategories, we have the products. These products have an attribute called "ccm" (its the cubic capacity,with numeric values).
Now we try to list all existing "ccm" values from the products of each category underneath the category name, like:
Motorcycle-Parts
=> Suzuki
- 300
- 380
- 550
- ...
=> Honda
- 600
- 650
- 700
- ...
=> Yamaha
- 420
- 650
- 860
- ...
So, if for example a product is inside the category "Suzuki" with the attribute pa_ccm (e.g. 500), we want to automatically list that value (500) underneath the category name, so people see, that inside the category Suzuki one (or more) Products exist that have the pa_ccm value 500.
I tried a few things with _get_term_hierarchy, but my skills are limited here. So no results. Thanks for help and ideas.