I added a custom billing field in woocommerce by
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_phone_new'] = array(
'label' => __('Phone 2', 'woocommerce'),
'placeholder' => _x('Phone 2', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);
return $fields;
}
add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');
I want to edit this field value from admin side. At the moment I am able to edit all other values in billing address but this value is not appearing in admin section.
my code to see the value in admin section
function order_phone_backend($order){
echo "<p><strong>Billing phone 2:</strong> " . get_post_meta( $order->id, '_billing_phone_new', true ) . "</p><br>";
}
add_action( 'woocommerce_admin_order_data_after_billing_address', 'order_phone_backend', 10, 1 );
Kindly resolve my problem