Skip to content

Instantly share code, notes, and snippets.

@andrii-kvlnko
Created August 29, 2019 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrii-kvlnko/25b5b40f47055b0964ff4b0bc12c3e6a to your computer and use it in GitHub Desktop.
Save andrii-kvlnko/25b5b40f47055b0964ff4b0bc12c3e6a to your computer and use it in GitHub Desktop.
Wordpress | Woocommerce | Custom validation
add_action( 'woocommerce_after_checkout_validation', 'prefix_validate', 10, 2);
function prefix_validate( $fields, $errors ){
if ( true ){
$errors->add( 'validation', 'Validation Message' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment