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!
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.
This is what I did:
Thanks again!
Hi John,
Glad it helped! Changing the priority to fit your setup is a smart move. Thanks for your feedback!