Woocommerce BACS GATEWAY : display bank account info on order page

default woocommerce order page suffers on major drawback, it does not display bank account info for customers who have chose to pay via BACS  (Bank Account Clearing System), more commonly known as direct bank/wire transfer. This payment method comes integrated within standard woocommerce plugin (more info). The bank account number can be configured in the payment config area of woocommerce, and it is displayed on the confirmation page. But not on the order page that the customer can view any time after the order. Here is a piece of code that displays specific bank transfer information  at the bottom of  the order display page :

 

add_action('woocommerce_view_order','po201407view_order');

function po201407view_order($order_id)
{
 echo $order_id;
 $order=new WC_Order( $order_id );
  if ( $order->payment_method !== 'bacs') return;
	//echo $order->payment_method_title;
	$bacs = new WC_Gateway_BACS();
	//print_r( $bacs->account_details);
	  $bacs->thankyou_page( $order_id);
}

 

1 reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *