Created
April 9, 2021 08:58
-
-
Save alamgircsebd/2466f7fc7a5f0b70ebf60a4ba2cf8342 to your computer and use it in GitHub Desktop.
Disabled refund emails for dokan sub order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Disabled refund emails for dokan sub order | |
* | |
* @param string $recipient | |
* @param string $order | |
* | |
* @return mix | |
*/ | |
function disable_refund_email_for_dokan_sub_order( $recipient, $order ) { | |
if ( wp_get_post_parent_id( $order->get_id() ) ){ | |
return; | |
} else { | |
return $recipient; | |
} | |
} | |
add_filter( 'woocommerce_email_recipient_customer_refunded_order', 'disable_refund_email_for_dokan_sub_order', 10, 2 ); | |
add_filter( 'woocommerce_email_recipient_customer_partially_refunded_order', 'disable_refund_email_for_dokan_sub_order', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment