Created
March 11, 2020 13:48
-
-
Save sarangs07/8b73316d97b2d340fd6b5543f512dae0 to your computer and use it in GitHub Desktop.
Filter to hide the order_comments on the checkout page.
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
/* | |
* Code installation instructions: | |
* 1. Copy the below code. | |
* 2. Open your child theme's functions.php file. | |
* 3. Paste the copied code at the very bottom of it & save the file OR upload it on your server/hosting. | |
*/ | |
/* | |
* Filter to hide the order_comments on the checkout page. | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
unset($fields['order']['order_comments']); | |
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment