I am using this to create a new field in my woocommerce billing form
add_filter('woocommerce_checkout_fields', array(__CLASS__,'custom_woocommerce_billing_fields'));
function custom_woocommerce_billing_fields($fields)
{
$fields['billing']['billing_mobile'] = array(
'label' => __('Mobile Phone Number', 'woocommerce'), // Add custom field label
'placeholder' => _x('Mobile Phone Number', 'placeholder', 'woocommerce'), // Add custom field placeholder
'required' => true, // if field is required or not
'clear' => false, // add clear or not
'type' => 'text', // add field type
'class' => array('my-css') // add class name
);
and also i use this code to do action after payment:
add_action( 'woocommerce_payment_complete', array(__CLASS__,'create_invoice_for_wc_order'));
function create_invoice_for_wc_order( $order_id ) {
// get order details data...
$order = wc_get_order( $order_id );
}
the question is how can i get that mobile number which user enter before payment in my "create_invoice_for_wc_order" function?