Untitled

 avatar
unknown
plain_text
a year ago
996 B
6
Indexable
global $marketking_public;

remove_filter( 'woocommerce_email_recipient_customer_processing_order', array($marketking_public,'filter_customer_received_order_email_recipient'), 10, 2 );

add_filter( 'woocommerce_email_recipient_customer_processing_order', function( $recipient, $order ){
	// do not send this email for composite order
	if ($order){
		if (marketking()->is_multivendor_order($order->get_id())){
			$recipient = '';
		}
	}
    return $recipient;
}, 10, 2);

add_action('plugins_loaded', function(){
	global $marketking_public;

	remove_filter( 'woocommerce_email_recipient_customer_processing_order', array($marketking_public,'filter_customer_received_order_email_recipient'), 10, 2 );

	add_filter( 'woocommerce_email_recipient_customer_processing_order', function( $recipient, $order ){
		// do not send this email for composite order
		if ($order){
			if (marketking()->is_multivendor_order($order->get_id())){
				$recipient = '';
			}
		}
	    return $recipient;
	}, 10, 2);
});
Editor is loading...
Leave a Comment