Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
00 Days
00 Hours
00 Minutes
00 Seconds

How to Add Customer Phone and Email to WooCommerce Orders IDs?

One common problem that store owners have is the time-consuming process of accessing customer contact information buried within each order. What if you could instantly view customer phone numbers and email addresses right from the orders table? This WooCommerce customization offers exactly that. No more switching between screens or digging through order details – everything you need is right at your fingertips. Read on to learn how to implement this convenient feature.

Solution: Add Customer Phone and Email to WooCommerce Orders IDs

The provided code customizes the WooCommerce orders table by appending customer phone numbers and email addresses directly to the ‘order_number’ column.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function ts_custom_shop_order_column_content( $column, $post_id ) {
if ( 'order_number' === $column ) {
$order = wc_get_order( $post_id );
// Get the customer's phone number and email
$phone = $order->get_billing_phone();
$email = $order->get_billing_email();
// Append the phone and email below the order number
if ( $phone ) {
echo '<small>' . __( 'Phone:', 'textdomain' ) . ' ' . esc_html( $phone ) . '</small>';
}
if ( $email ) {
echo '<br><small>' . __( 'Email:', 'textdomain' ) . ' ' . esc_html( $email ) . '</small>';
}
}
}
add_action( 'manage_woocommerce_page_wc-orders_custom_column', 'ts_custom_shop_order_column_content', 10, 2 );
function ts_custom_shop_order_column_content( $column, $post_id ) { if ( 'order_number' === $column ) { $order = wc_get_order( $post_id ); // Get the customer's phone number and email $phone = $order->get_billing_phone(); $email = $order->get_billing_email(); // Append the phone and email below the order number if ( $phone ) { echo '<small>' . __( 'Phone:', 'textdomain' ) . ' ' . esc_html( $phone ) . '</small>'; } if ( $email ) { echo '<br><small>' . __( 'Email:', 'textdomain' ) . ' ' . esc_html( $email ) . '</small>'; } } } add_action( 'manage_woocommerce_page_wc-orders_custom_column', 'ts_custom_shop_order_column_content', 10, 2 );
function ts_custom_shop_order_column_content( $column, $post_id ) {
    if ( 'order_number' === $column ) {
        $order = wc_get_order( $post_id );

        // Get the customer's phone number and email
        $phone = $order->get_billing_phone();
        $email = $order->get_billing_email();

        // Append the phone and email below the order number
        if ( $phone ) {
            echo '<small>' . __( 'Phone:', 'textdomain' ) . ' ' . esc_html( $phone ) . '</small>';
        }
        if ( $email ) {
            echo '<br><small>' . __( 'Email:', 'textdomain' ) . ' ' . esc_html( $email ) . '</small>';
        }
    }
}
add_action( 'manage_woocommerce_page_wc-orders_custom_column', 'ts_custom_shop_order_column_content', 10, 2 );

Output

The customer contact details are displayed directly in the orders table, so that you can quickly reach out to customers for order confirmations, delivery updates, or any issues that may arise.

How to Add Customer Phone and Email to WooCommerce Orders IDs? - Tyche Softwares

This solution helps you speed up order processing, quickly resolve customer queries, and ensure accurate communication. If you prefer to instantly view other details that are important to you, you can customize them too. We have covered posts on adding other customer details to order numbers. Try out these customizations and let us know how they work for you!


Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of


2 Comments
Newest
Oldest
Inline Feedbacks
View all comments
John Pozadzides
1 year ago

Great suggestion, and I added it to my admin panel. One suggestion… I wanted the order number and name to be first, so I set a lower priority on the snippet to rearrange things.

For this line, just change the 10 (which is the priority) to a higher number so it executes later.

add_action( 'manage_woocommerce_page_wc-orders_custom_column', 'ts_custom_shop_order_column_content', 10, 2 );

This is what I did:

add_action( 'manage_woocommerce_page_wc-orders_custom_column', 'ts_custom_shop_order_column_content', 50, 2 );

Thanks again!

2
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.