Last active
July 31, 2020 13:16
-
-
Save MindyPostoff/cbf34de936445972737f to your computer and use it in GitHub Desktop.
Make the Order Notes field required in the WooCommerce Checkout
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
// 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this would help. https://gist.github.com/13122310958/48690a4adec05e50acd8b51011e23de5