• I use woocommerce_products_will_display() function to validate HTML part, that will be show on the product-archive page. It works but, has an issue with the custom taxonomy, if custom taxonomy has child, and child has more than one product woocommerce_products_will_display() return false.
    I think the problem is in this part of code

    
    if ( empty( $term->term_id ) || empty( $term->taxonomy ) ) {
        return true;
    }
    

    Why return true if the taxonomy is empty?
    If I change it to this

    
    if ( ! empty( $term->term_id ) || ! empty( $term->taxonomy ) ) {
        return true;
    }
    

    all works fine.

The topic ‘woocommerce_products_will_display() function issue’ is closed to new replies.