// Validate the custom field.

add_action('woocommerce_checkout_process', 'webt_checkout_field_process');

function webt_checkout_field_process() {

// Check if set, if its not set add an error.

if ( ! $_POST['webt_delivery_date'] )


wc_add_notice( __( 'Enter your desired delivery date.','webt-woo-order-delivery-time' ), 'error' );
if ( ! $_POST['webt_delivery_time'] )
wc_add_notice( __( 'Enter your desired delivery time.','webt-woo-order-delivery-time' ), 'error' );

}
Your Answer
Sign In
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.