Skip to content

Instantly share code, notes, and snippets.

@webdados
Last active November 23, 2020 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/1c2e6063e84fb1981af0dde358128fd3 to your computer and use it in GitHub Desktop.
Save webdados/1c2e6063e84fb1981af0dde358128fd3 to your computer and use it in GitHub Desktop.
Customize the "Invoicing with InvoiceXpress for WooCommerce" VAT field
<?php
//We hook woocommerce_checkout_fields at 50, so this needs to be at least 51
add_filter( 'woocommerce_checkout_fields', 'ix_vat_woocommerce_checkout_fields', 51 );
function ix_vat_woocommerce_checkout_fields( $fields ) {
//Change label - originally __( 'VAT number', 'woo-billing-with-invoicexpress' )
$fields['billing']['billing_VAT_code']['label'] = 'My VAT label';
//Change priority - originally 120, 31 is after company
$fields['billing']['billing_VAT_code']['priority'] = 31;
//Make it half size and on the left
$fields['billing']['billing_VAT_code']['class'] = array( 'form-row', 'form-row-first' );
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment