How to Add Shipping Phone at Checkout Page in WooCommerce?

Shipping phone information is essential for every ecommerce website. Using it, ecommerce companies can communicate efficiently with courier partners and end customers. As a result, delivery related problems get communicated & resolved at a faster pace. In this article, you will learn about WooCommerce add shipping phone at checkout.

WooCommerce has a hook or filter for this particular checkout field. It is named as “woocommerce_checkout_fields”. You can use this filter to add, move, or remove any checkout fields. Reading this guide further, you will discover how to add a new field named “shipping_phone”. It will ensure smooth checkout. 

Image showing field that will be added after applying WooCommerce Add Shipping Phone at Checkout function

PHP Snippet:  WooCommerce Add Shipping Phone at Checkout Page

add_filter( 'woocommerce_checkout_fields', 'phpsof_shipping_phone_checkout' );
 
function phpsof_shipping_phone_checkout( $fields ) {
   $fields['shipping']['shipping_phone'] = array(
      'label' => 'Phone',
      'required' => false,
      'class' => array( 'form-row-wide' ),
      'priority' => 25,
   );
   return $fields;
}
  
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'phpsof_shipping_phone_checkout_display' );
 
function phpsof_shipping_phone_checkout_display( $order ){
    echo '<p><b>Shipping Phone:</b> ' . get_post_meta( $order->get_id(), '_shipping_phone', true ) . '</p>';
}

Where do you add this snippet?

So, this is how you can learn about WooCommerce add shipping phone at checkout function. This field lets your customer provide the right information. Also, it is easier to activate this function with this code. So, to apply this code, just add this PHP snippet at your child theme function.php file’s bottom. It should be placed before “?>”, if you have it there. Apart from this, CSS goes in your child theme style.css file. Make sure that you are editing these files in a right manner for best results.

Is this snippet still valid?

So, this is how you can learn about WooCommerce add shipping phone at checkout function. This snippet helps in integrating accurate customer shipping details. This is why you can deliver products faster. I have applied this code on the Storefront theme and WordPress friendly hosting PHP 7.3. Let me know if everything works as expected when you code. Share it further if you find this snippet useful for you and it had saved your time. 

Also Read, How to Rename State Label at Checkout in WooCommerce?

How to Show Checkout Even If Cart is Empty in WooCommerce?

Important links – WooCommerce – https://woocommerce.com/