Show the number of orders a user has on their account page.
add_action('woocommerce_account_dashboard', 'codebykp_display_orders_count');
function codebykp_display_orders_count() {
$customer_orders = wc_get_orders(array(
'customer_id' => get_current_user_id(),
'limit' => -1,
));
$order_count = count($customer_orders);
echo '<p>You have ' . esc_html($order_count) . ' orders.</p>';
}