Custom order note in view order page
-
Hi, I want to add a custom note in view order page. This text will be automatically placed when an order is placed. Customer can view this text under Customer Note section.
I have tried using this code but of no result.
add_action( ‘woocommerce_new_order’, ‘add_engraving_notes’, 1, 1 );
function add_engraving_notes( $order_id ) {
//note this line is different
//because I already have the ID from the hook I am using.
$order = new WC_Order( $order_id );// The text for the note
$note = __(“Custom Order Note Here”);// Add the note
$order->add_order_note( $note );// Save the data
$order->save();
}Kindly help
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Custom order note in view order page’ is closed to new replies.