I have tried everything, but can't seem to get this right.
I'm using the code from Disable WooCommerce New order email notification if order status is On hold
to only send New order email (admin) when order status is processing. But I want to include a second order status "partially_paid" (coming from at deposit plugin)
My code is:
add_filter( 'woocommerce_email_recipient_new_order', 'disable_new_order_for_on_hold_order_status', 10, 2 );
function disable_new_order_for_on_hold_order_status( $recipient, $order = false ) {
if ( ! $order || ! is_a( $order, 'WC_Order' ) )
return $recipient;
return $order->get_status() === 'processing, partially_paid' ? $recipient : '';
}
I have also tried with:'
return $order->get_status() === array('processing', 'partially_paid') ? $recipient : '';
None of them working.
Any help is highly appreciated. Thanks.