DEV Community

Ali Raza
Ali Raza

Posted on

2 2

Remove or Update order notes in WooCommerce checkout page

By using following hooks, we can remove or update order's notes in woocommerce checkout page.


// removes Order Notes Title - Additional Information
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );

// remove Order Notes Field
add_filter( 'woocommerce_checkout_fields' , 'raza_remove_order_notes' );
function raza_remove_order_notes( $fields ) {

    unset($fields['order']['order_comments']); // for removing
    $fields['order']['order_comments']['label'] = 'Hotel Information'; // change label
    $fields['order']['order_comments']['placeholder'] = 'Hotel Information'; // change placeholder
    $fields['order']['order_comments']['required'] = true; // make it required

    return $fields;

}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay