Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
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.

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
4 months 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