Last active
August 29, 2015 14:07
-
-
Save SirDarcanos/21899c057aad33fd9fdd to your computer and use it in GitHub Desktop.
add woocommerce admin order vat and ssn fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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