Guest User

Untitled

a guest
Jul 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. add_action( 'woocommerce_process_shop_order_meta', 'woocommerce_process_shop_order', 10, 2 );
  2. function woocommerce_process_shop_order ( $order_id ) {
  3.  
  4. //Get this order id dynamically
  5. $order = wc_get_order( $order_id );
  6.  
  7. // The text for the note
  8. $note = __("Custom Order Note Here");
  9. $note_date = date('d.m.Y',strtotime("-1 days"));
  10.  
  11. // Add the note
  12. $order->add_order_note( $note );
  13. $order->wp_insert_comment($note_date);
  14.  
  15. // Save the data
  16. $order->save();
  17.  
  18. }
Add Comment
Please, Sign In to add comment