WooCommerce Customer Billing Address

I am trying to add a VAT field to the Customer Billing Address, while this works on the Checkout page with the following code:

// Company Name Required
function custom_override_checkout_fields($fields){
    $fields['billing']['billing_company']['required'] = true;
    $fields['billing']['billing_vat'] = array(
    'label'       => __('VAT Number','woocommerce'),
    'placeholder' => _x('Enter VAT Number','placeholder','woocommerce'),
    'required'    => true,
    'class'       => array('form-row-wide'),
    'clear'       => true
    return $fields;
//Display field value on the order edit page
function my_custom_checkout_field_display_admin_order_meta($order){
    echo '<p><strong>'.__('VAT Number').':</strong> ' . get_post_meta($order->id,'_billing_vat',true) . '</p>';
//Order the fields
function order_fields($fields){
    $order = array(
foreach($order as $field){$ordered_fields[$field] = $fields["billing"][$field];}
$fields["billing"] = $ordered_fields;
return $fields;

I also require it to be set on the Customer Billing Address in the account options. As I require to link this to the registration page as I’d like the users to register with all their credentials including the VAT number they own for a B2B Webstore.

Does anyone know or could anyone point me in the right direction how I would perform this task of not only showing those billing fields of the VAT number on the checkout page but also on the users profile page, as well as how to add all these fields on the registration page?

Thanks in advance for any assistance for this case!

Read more here: WooCommerce Customer Billing Address

Leave a Reply

Your email address will not be published. Required fields are marked *