Last active
April 8, 2020 16:56
-
-
Save mio31337/60341b162b17046e76d2b1d0bee45bf7 to your computer and use it in GitHub Desktop.
WooCommerce: Add reference ID in BACS Payment Method - Bank Details (Displayed on confirmation E-mail and Thank You Page)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WooCommerce: Add reference ID in BACS Payment Method - Bank Details (Displayed on confirmation E-mail and Thank You Page) | |
* Author: MarioMarkovic.com | |
*/ | |
add_filter( 'woocommerce_bacs_account_fields', 'custom_bacs_account_field', 10, 2); | |
function custom_bacs_account_field( $account_fields, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$account_fields['reference_no' ] = array( | |
'label' => "Reference No.", | |
'value' => $order->get_id() | |
); | |
return $account_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment