Skip to content

Instantly share code, notes, and snippets.

@webdados
Last active December 16, 2017 03:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/a66c1815d4bfebd13586f5ec11927e31 to your computer and use it in GitHub Desktop.
Save webdados/a66c1815d4bfebd13586f5ec11927e31 to your computer and use it in GitHub Desktop.
WooCommerce Cancelled orders sent to client also
<?php
add_filter( 'woocommerce_email_recipient_cancelled_order', 'cancelled_order_add_customer_email', 10, 2 );
function cancelled_order_add_customer_email( $recipient, $order ) {
if ( $order ) {
return $recipient . ',' . ( version_compare( WC_VERSION, '3.0', '>=' ) ? $order->get_billing_email() : $order->billing_email );
} else {
return $recipient;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment