• Resolved shecky

    (@shecky)


    After updating Woocommerce to version 3.3.3, when I display a top-level category that has no products but has subcategories without any product, the subcategories are no longer displayed in the archive page.
    This happens only for the top-level categories but not in the sub-categories under the same conditions.
    If inside subcategories exist one or more products the others empty categories will be shown. Actually I fix the problem by avoiding the use of have_posts() in archive-product.php and substitute it with:

    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); // get current term
    
    $children = get_term_children($term->term_id, get_query_var('taxonomy')); // get children
    
    if ( have_posts() || sizeof($children)>0) {
       ...
       ...
       ...
    

    In my file functions.php I have this filter:
    add_filter( 'woocommerce_product_subcategories_hide_empty', '__return_false');

    Everything worked normally with version 3.3.2.

    Can you help me?

    • This topic was modified 6 years, 8 months ago by shecky.
    • This topic was modified 6 years, 8 months ago by shecky.
Viewing 1 replies (of 1 total)
  • Hi @shecky,

    It sounds like your customizations worked in 3.3.2 but they no longer work in 3.3.3 – is that right?

    If you disable your customizations, what problem do you see?

Viewing 1 replies (of 1 total)
  • The topic ‘Top-Level categories don’t show empty subcategories’ is closed to new replies.