Add Automatic custom order note to Admin Order page
-
Hello All!
I am interested in adding an automatic note to the order notes section of the Admin orders page. I do not know PHP, but came across the following code in a previous post from 8 months ago. Is there anyway to do this using CSS? If no, where should I place the PHP code and how safe is it?
add_action( ‘woocommerce_new_order’, ‘add_engraving_notes’ );
function add_engraving_notes( $order_id ) {
//note this line is different
//because I already have the ID from the hook I am using.
$order = wc_get_order( $order_id );// The text for the note
$note = ‘No special message yet’;// Add the note
$order->add_order_note( $note );// Save the data
$order->save();
}
- The topic ‘Add Automatic custom order note to Admin Order page’ is closed to new replies.