Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
996 B
3
Indexable
Never
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);
});
Leave a Comment