From 45732d49d0012f6075c39fce8fd5b03edaceb895 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 22 May 2013 12:20:47 +0100 Subject: [PATCH] Define account fields once, and pass order ID during filter. Closes #3201 --- .../gateways/bacs/class-wc-gateway-bacs.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/classes/gateways/bacs/class-wc-gateway-bacs.php b/classes/gateways/bacs/class-wc-gateway-bacs.php index 32f583ffa9e..b6f22c94781 100644 --- a/classes/gateways/bacs/class-wc-gateway-bacs.php +++ b/classes/gateways/bacs/class-wc-gateway-bacs.php @@ -41,6 +41,16 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { $this->iban = $this->get_option( 'iban' ); $this->bic = $this->get_option( 'bic' ); + // BACS account fields shown on the thanks page and in emails + $this->account_fields = array( + 'account_name' => __( 'Account Name', 'woocommerce' ), + 'account_number'=> __( 'Account Number', 'woocommerce' ), + 'sort_code' => __( 'Sort Code', 'woocommerce' ), + 'bank_name' => __( 'Bank Name', 'woocommerce' ), + 'iban' => __( 'IBAN', 'woocommerce' ), + 'bic' => __( 'BIC', 'woocommerce' ) + ); + // Actions add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_thankyou_bacs', array( $this, 'thankyou_page' ) ); @@ -151,7 +161,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { * @access public * @return void */ - function thankyou_page() { + function thankyou_page( $order_id ) { if ( $description = $this->get_description() ) echo wpautop( wptexturize( wp_kses_post( $description ) ) ); @@ -159,14 +169,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { echo '