Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Created June 9, 2016 14:29
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Update the order meta with the field value
<?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