Created
August 7, 2017 15:41
-
-
Save ravimallya/5cf2842bfad00ec0f42042e4b2c55370 to your computer and use it in GitHub Desktop.
WooCommerce disable New Order email for Admin/ShopManager orders.
This file contains hidden or 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
<?php | |
// Change new order email recipient for registered customers | |
function wc_change_admin_new_order_email_recipient( $recipient, $order ) { | |
global $woocommerce; | |
if($order) | |
{ | |
$order_data = $order->get_data(); | |
if('checkout' == $order_data['created_via']) { | |
$recipient = "[email protected]"; // don't forget to put your actual email | |
} else { | |
$recipient = ""; | |
} | |
} | |
return $recipient; | |
} | |
add_filter('woocommerce_email_recipient_new_order', 'wc_change_admin_new_order_email_recipient', 1, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment