Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Customer phone in the orders list

Adds a Phone column to the WooCommerce orders list, so you can call a customer without opening the order.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Needs WooCommerce
  • Category WooCommerce
  • Tested with WordPress 7.1, WooCommerce 11.1
PHP
<?php

$snipfire_add_column = static function ( $columns ) {
	$columns['snipfire_phone'] = __( 'Phone', 'woocommerce' );
	return $columns;
};
$snipfire_show_phone = static function ( $column, $order ) {
	if ( 'snipfire_phone' !== $column ) {
		return;
	}
	$order = $order instanceof WC_Order ? $order : wc_get_order( $order );
	$phone = $order ? $order->get_billing_phone() : '';
	echo $phone ? '<a href="' . esc_url( 'tel:' . preg_replace( '/[^0-9+]/', '', $phone ) ) . '">' . esc_html( $phone ) . '</a>' : '—';
};
// Orders stored in their own tables (the default) and the older posts storage.
add_filter( 'manage_woocommerce_page_wc-orders_columns', $snipfire_add_column );
add_action( 'manage_woocommerce_page_wc-orders_custom_column', $snipfire_show_phone, 10, 2 );
add_filter( 'manage_edit-shop_order_columns', $snipfire_add_column );
add_action( 'manage_shop_order_posts_custom_column', $snipfire_show_phone, 10, 2 );

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.