I am trying to remove the order details table from every completed order mail:
I have tried something like this:
function so_39251827_remove_order_details( $order, $sent_to_admin, $plain_text, $email ){
$mailer = WC()->mailer(); // get the instance of the WC_Emails class
remove_action( 'woocommerce_email_order_details', array( $mailer, 'order_details' ), 10, 4 );
}
add_action('woocommerce_email_order_details','so_39251827_remove_order_details', 5, 4 );
It actually did remove the table but I am thinking the hook is removed from entirely all mail notifications, that's both the admin and customer mail template.
Can somebody help me on how to remove it from only completed order mail sent to customers?