Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_process_shop_order_meta', 'woocommerce_process_shop_order', 10, 2 );
- function woocommerce_process_shop_order ( $order_id ) {
- //Get this order id dynamically
- $order = wc_get_order( $order_id );
- // The text for the note
- $note = __("Custom Order Note Here");
- $note_date = date('d.m.Y',strtotime("-1 days"));
- // Add the note
- $order->add_order_note( $note );
- $order->wp_insert_comment($note_date);
- // Save the data
- $order->save();
- }
Add Comment
Please, Sign In to add comment