Last active
August 22, 2017 14:38
-
-
Save swoboda/190eef9293c3c0acf7dc9a8d43ec8a4b to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_action( 'woocommerce_checkout_update_order_meta', 'wpdesk_checkout_vat_number_update_order_meta' ); | |
/** | |
* Save VAT Number in the order meta | |
*/ | |
function wpdesk_checkout_vat_number_update_order_meta( $order_id ) { | |
if ( ! empty( $_POST['vat_number'] ) ) { | |
update_post_meta( $order_id, '_vat_number', sanitize_text_field( $_POST['vat_number'] ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment