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
– – Sale
However 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
– Women
Now 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 the get_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?
- This topic was modified 6 hours, 16 minutes ago by . Reason: Converted nested lists to plain text (stupid text editor does not like nested lists apparently)