Product count in archive page Title in WooCommerce [closed]

add_filter( 'woocommerce_page_title', 'add_products_number_to_category_title', 99, 1 );
function add_products_number_to_category_title($title) {
    if ( ! is_product_category() ) {
        return $title;
    }
    
    $products_count = get_queried_object()->count;
    
    return $title . ' (' . esc_html( $products_count ) . ')';
} 

tech