Add parent name to term list in dropdown (coupon category list)
-
We have a clothing store and want to create coupons in WooCommerce that have certain categories excluded. Our category structure is as follows (simplified):
– Men
– – Shirts
– – Jeans
– – Sale
– Women
– – Shirts
– – Jeans
– – SaleHowever when we want to select [Men ??Sale] from the Exclude categories dropdown picker in [WooCommerce ??Marketing ??Coupons ? Usage Restriction] the list is flattened:
– Jeans
– Men
– Sale
– Sale
– Shirts
– Shirts
– WomenNow it is not clear which categories are actually the one we want to exclude. Have in min, this is a very simplified structure, in the live environment this is even worse.
I hoped for an
apply_filter
but theget_terms()
apparently does have none in code, see source code on github here ?$categories = get_terms('product_cat', 'orderby=name&hide_empty=0');
Since this is not filtered, I don’t see a way to add a parent category to have this as the desired outcome:
– Men
– – Men ??Jeans
– – Men ??Shirts
– – Men ??Sale
– Women
– – Women ? Jeans
– – Women ? Shirts
– – Women ? Sale—
Any idea how to get that list now that there is no filter in the code?
- The topic ‘Add parent name to term list in dropdown (coupon category list)’ is closed to new replies.