Skip to content

Order Metadata

When processing an order, the plugin stores phone numbers in international format (E.164) in different locations depending on the checkout type.

FieldMethodDescription
billing_phone$order->get_billing_phone()Billing phone in international format
_<field_id>$order->get_meta('_<field_id>')Additional phone fields (order meta with _ prefix)
FieldMethodDescription
billing_phone$order->get_billing_phone()Billing phone in international format
shipping_phone$order->get_shipping_phone()Shipping phone in international format
_<field_id>$order->get_meta('_<field_id>')Additional phone fields (order meta with _ prefix)
$order = wc_get_order( $order_id );
// Billing phone (both classic and block checkout)
$billing_phone = $order->get_billing_phone();
// Result: "+420607123456"
// Shipping phone (block checkout only)
$shipping_phone = $order->get_shipping_phone();
// Additional phone field (e.g. company_phone)
$company_phone = $order->get_meta( '_company_phone' );
$customer = new WC_Customer( $user_id );
// Billing phone
$billing_phone = $customer->get_billing_phone();
// Shipping phone (updated only from block checkout)
$shipping_phone = $customer->get_shipping_phone();

The plugin stores numbers in E.164 format:

InputOutput
607 123 456 (with CZ dial code)+420607123456
+49 170 1234567+491701234567
(212) 555-1234 (with US dial code)+12125551234

You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.