• Resolved Ronaldt

    (@neejoh)


    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 1 year, 5 months ago by Ronaldt. Reason: Converted nested lists to plain text (stupid text editor does not like nested lists apparently)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add parent name to term list in dropdown (coupon category list)’ is closed to new replies.