Process the checkout and set error message
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. | |
//* Process the checkout | |
add_action('woocommerce_checkout_process', 'wps_select_checkout_field_process'); | |
function wps_select_checkout_field_process() { | |
global $woocommerce; | |
// Check if set, if its not set add an error. | |
if ($_POST['daypart'] == "blank") | |
wc_add_notice( '<strong>Please select a day part under Delivery options</strong>', 'error' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment