Skip to content

Instantly share code, notes, and snippets.

@webdados
Created July 8, 2019 09:14
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/2b453842df0709e682e9e53abe04e125 to your computer and use it in GitHub Desktop.
Save webdados/2b453842df0709e682e9e53abe04e125 to your computer and use it in GitHub Desktop.
Manipulate VAT field position on Invoicing with InoiceXpress for WooCommerce
<?php
add_filter( 'woocommerce_checkout_fields', 'my_woocommerce_checkout_fields', 60 );
function my_woocommerce_checkout_fields( $fields ) {
if ( isset( $fields['billing']['billing_VAT_code'] ) ) {
$fields['billing']['billing_VAT_code']['class'] = array( 'form-row-first' ); //Or form-row-last
$fields['billing']['billing_VAT_code']['clear'] = true; //Or false if we use form-row-last
$fields['billing']['billing_VAT_code']['priority'] = 120; //120 is the default position, change this to move it up or down on the form
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment