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.

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:

2 thoughts on “How to Add Customer Phone and Email to WooCommerce Orders IDs?

  1. 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!

    1. Hi John,

      Glad it helped! Changing the priority to fit your setup is a smart move. Thanks for your feedback!

Leave a Reply

Your email address will not be published. Required fields are marked *

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.