Last active
August 29, 2015 14:04
-
-
Save acanza/db41e6eb5b5100a94378 to your computer and use it in GitHub Desktop.
Almacena los datos del nuevo campo junto con el resto de información del pedido
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
/** | |
* Actualiza la información del pedido con el nuevo campo | |
*/ | |
add_action( 'woocommerce_checkout_update_order_meta', 'actualizar_info_pedido_con_nuevo_campo' ); | |
function actualizar_info_pedido_con_nuevo_campo( $order_id ) { | |
if ( ! empty( $_POST['nif'] ) ) { | |
update_post_meta( $order_id, 'NIF', sanitize_text_field( $_POST['nif'] ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment