Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Last active August 29, 2015 14:07
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 SiR-DanieL/21899c057aad33fd9fdd to your computer and use it in GitHub Desktop.
Save SiR-DanieL/21899c057aad33fd9fdd to your computer and use it in GitHub Desktop.
add woocommerce admin order vat and ssn fields
// Add VAT and SSN fields in billing address display
add_filter( 'woocommerce_order_formatted_billing_address', 'custom_add_vat_ssn_formatted_billing_address', 10, 2 );
function custom_add_vat_ssn_formatted_billing_address( $fields, $order ) {
$fields['vat'] = $order->billing_vat;
$fields['ssn'] = $order->billing_ssn;
return $fields;
}
add_filter( 'woocommerce_admin_billing_fields', 'custom_admin_billing_fields' );
function custom_admin_billing_fields( $fields ) {
$fields['vat'] = array(
'label' => __( 'VAT', 'your-domain' ),
'show' => true
);
$fields['ssn'] = array(
'label' => __( 'SSN', 'your-domain' ),
'show' => true
);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment