Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action ( 'woocommerce_order_status_completed_notification', 'eg_maybe_remove_order_status_completed_notification', 5 );
- function eg_maybe_remove_order_status_completed_notification( $order_id ) {
- global $woocommerce;
- if ( $order_id && class_exists( 'WC_Subscriptions_Order' ) && WC_Subscriptions_Renewal_Order::is_renewal( $order, array( 'order_role' => 'child' ) ) {
- $mailer = $woocommerce->mailer();
- remove_action( 'woocommerce_order_status_completed_notification', array( $mailer->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement