1

how can i move BACS Bank Details in Woocommerce Mail Template "customer-processing-order.php".

I want to remove/move it from

do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );

And and it after

do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );

But only the Bank Details not the other stuff from order_details action?

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399

1 Answers1

0

Is not possible to target specific email notification… Now to move BACS Bank Details from Woocommerce email notifications after customer details, use the following:

add_action( 'init', 'move_bacs_bank_details', 1000 );
function move_bacs_bank_details() {
    if ( class_exists( 'WC_Payment_Gateways' ) ) {
        $gateways = WC_Payment_Gateways::instance();

        $available_gateways = $gateways->get_available_payment_gateways();

        if ( isset( $available_gateways['bacs'] ) ) {
            remove_action( 'woocommerce_email_before_order_table', array( $available_gateways['bacs'], 'email_instructions' ), 10 );
            add_action( 'woocommerce_email_customer_details', array( $available_gateways['bacs'], 'email_instructions' ), 30, 3 );
        }
    }
}

Code goes in functions.php file of the active child theme (or active theme). Tested and works.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399