We can remove the Additional Information and Order Notes fields in WooCommerce checkout page with 2 filters that you add to functions.php file.
Was this article helpful?
YesNo
We can remove the Additional Information and Order Notes fields in WooCommerce checkout page with 2 filters that you add to functions.php file.
It just works perfectly. I haven’t even needed to use the support it’s so simple and effective, so no idea if they’re any good or not on that front. I’ll just assume they’re very helpful 🙂
I have replaced code but still not working now.
Make public function like below my code.
public function woocommerce_remove_order_notes( $fields ) {
unset($fields['order']['order_comments']);
return $fields;
}
I have put your code on construct method. see below code.
public function __construct($plugin_name, $version) {
$this->plugin_name = $plugin_name;
$this->version = $version;
add_filter( 'woocommerce_checkout_fields' , 'woocommerce_remove_order_notes' );
}
Update your this code with below code. You have to use
$this
object on call back function.public function __construct($plugin_name, $version) {
$this->plugin_name = $plugin_name;
$this->version = $version;
add_filter( ‘woocommerce_checkout_fields’ , array($this, ‘woocommerce_remove_order_notes’) );
}
I want to use this code on plugins. Where am i put this code.
On which plugin do you want to put this code? Is this your own plugin? then you have to share your plugin file.
bookmarked!!, I really like your blog!