Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alamgircsebd/2466f7fc7a5f0b70ebf60a4ba2cf8342 to your computer and use it in GitHub Desktop.
Save alamgircsebd/2466f7fc7a5f0b70ebf60a4ba2cf8342 to your computer and use it in GitHub Desktop.
Disabled refund emails for dokan sub order
/**
* 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