• Resolved harshalgtx

    (@harshalgtx)


    Hi there, I understand that you have given a code to be placed in function.php file to get inactive products in dropdown.

    Is there any way to get all categories in dropdown without activating any products?
    In other words – I have some products in draft mode – I dont want to activate them. But I want to filter their orders by categories. So even if no products active in particular category, it should come in dropdown.

    Hope I am clear.

    Appreciate your help.

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Kowsar Hossain

    (@kowsar89)

    Will try to add this feature in a future release.

    Here’s a way to achieve this now if you’re comfortable editing plugin files. In file “plugins/woocommerce-filter-orders-by-product/inc/filter-by-category.php” line 21, replace the following code:

    $terms = get_terms( array('taxonomy' => 'product_cat', 'fields' => 'id=>name' ) );

    with this one:

    $terms = get_terms( array('taxonomy' => 'product_cat', 'fields' => 'id=>name', 'hide_empty' => false ) );

Viewing 1 replies (of 1 total)
  • The topic ‘get all categories’ is closed to new replies.