Created
June 9, 2016 14:29
-
-
Save frankschrijvers/8417327862be07f25f7bf1ac920c7930 to your computer and use it in GitHub Desktop.
Update the order meta with the field value
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. | |
//* Update the order meta with field value | |
add_action('woocommerce_checkout_update_order_meta', 'wps_select_checkout_field_update_order_meta'); | |
function wps_select_checkout_field_update_order_meta( $order_id ) { | |
if ($_POST['daypart']) update_post_meta( $order_id, 'daypart', esc_attr($_POST['daypart'])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment