Guest User

Untitled

a guest
Feb 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php printf( '<time datetime="%s">%s</time>', $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ); ?>
  2.  
  3. $date_modified = $order->get_date_modified();
  4. echo sprintf( '<p>Order NO. %s (placed on <time>%s</time>)</p>',
  5. $order->get_order_number( ),
  6. $date_modified->date("F j, Y, g:i:s A T")
  7. );
  8.  
  9. $date_paid = $order->get_date_paid();
  10. if( ! empty( $date_paid) ){
  11. echo sprintf( '<p>Order NO. %s (placed on <time>%s</time>)</p>',
  12. $order->get_order_number( ),
  13. $date_paid->date("F j, Y, g:i:s A T")
  14. );
  15. }
  16.  
  17. add_action( 'woocommerce_email_order_details', 'custom_processing_order_notification', 1, 4 );
  18. function custom_processing_order_notification( $order, $sent_to_admin, $plain_text, $email ) {
  19. // Only for processing email notifications to customer
  20. if( ! 'customer_processing_order' == $email->id ) return;
  21.  
  22. $date_modified = $order->get_date_modified();
  23. $date_paid = $order->get_date_paid();
  24.  
  25. $date = empty( $date_paid ) ? $date_modified : $date_paid;
  26.  
  27. echo sprintf( '<p>Order NO. %s (placed on <time>%s</time>)</p>',
  28. $order->get_order_number( ),
  29. $date->date("F j, Y, g:i:s A T")
  30. );
  31. }
Add Comment
Please, Sign In to add comment