Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. add_action ( 'woocommerce_order_status_completed_notification', 'eg_maybe_remove_order_status_completed_notification', 5 );
  4.  
  5. function eg_maybe_remove_order_status_completed_notification( $order_id ) {
  6. global $woocommerce;
  7.  
  8. if ( $order_id && class_exists( 'WC_Subscriptions_Order' ) && WC_Subscriptions_Renewal_Order::is_renewal( $order, array( 'order_role' => 'child' ) ) {
  9. $mailer = $woocommerce->mailer();
  10. remove_action( 'woocommerce_order_status_completed_notification', array( $mailer->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement