Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.