Skip to content

Instantly share code, notes, and snippets.

@MindyPostoff
Last active July 31, 2020 13:16
Show Gist options
  • Save MindyPostoff/cbf34de936445972737f to your computer and use it in GitHub Desktop.
Save MindyPostoff/cbf34de936445972737f to your computer and use it in GitHub Desktop.
Make the Order Notes field required in the WooCommerce Checkout
// Place this code in your theme's functions.php file
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields['order']['order_comments']['required'] = true;
return $fields;
}
@ikazi1
Copy link

ikazi1 commented Feb 11, 2019

Any chance to change place holder text?

@auludag
Copy link

auludag commented May 13, 2019

Any chance to change place holder text?

this would help. https://gist.github.com/13122310958/48690a4adec05e50acd8b51011e23de5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment