Skip to content

Instantly share code, notes, and snippets.

@sarangs07
Created March 11, 2020 13:48
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 sarangs07/8b73316d97b2d340fd6b5543f512dae0 to your computer and use it in GitHub Desktop.
Save sarangs07/8b73316d97b2d340fd6b5543f512dae0 to your computer and use it in GitHub Desktop.
Filter to hide the order_comments on the checkout page.
/*
* 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