Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created April 4, 2014 09:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/9971115 to your computer and use it in GitHub Desktop.
Save mikejolley/9971115 to your computer and use it in GitHub Desktop.
WC customising checkout fields using actions and filters - Lesson 3 snippet 2
/**
* Process the checkout
*/
add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process');
function my_custom_checkout_field_process() {
// Check if set, if its not set add an error.
if ( ! $_POST['my_field_name'] )
wc_add_notice( __( 'Please enter something into this new shiny field.' ), 'error' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment