Skip to content

Instantly share code, notes, and snippets.

@mio31337
Last active April 8, 2020 16:56
Show Gist options
  • Save mio31337/60341b162b17046e76d2b1d0bee45bf7 to your computer and use it in GitHub Desktop.
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)
/**
* 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