I have now managed to get the emails to show the invoice number:
Change
languages/english/modules/payment/dirbanknz.php to
Code:
define('MODULE_PAYMENT_DIRBANKNZ_TEXT_EMAIL_FOOTER',
"Thanks for your order which will ship once we receive payment in the account below:\n\n" .
"\nAccount No.: " . MODULE_PAYMENT_DIRBANKNZ_ACCNUM .
"\nAccount Name: " . MODULE_PAYMENT_DIRBANKNZ_ACCNAM .
"\nBank Name: " . MODULE_PAYMENT_DIRBANKNZ_BANKNAM );
The reference number will be added after this, so you want the last line to be part of the bank details, not instructions.
Add the following to /classes/order.php (code segment starts at about line 1060.
Code:
if (is_object($GLOBALS[$_SESSION['payment']])) {
$cc_num_display = (isset($this->info['cc_number']) && $this->info['cc_number'] != '') ? /*substr($this->info['cc_number'], 0, 4) . */ str_repeat('X', (strlen($this->info['cc_number']) - 8)) . substr($this->info['cc_number'], -4) . "\n\n" : '';
$email_order .= EMAIL_TEXT_PAYMENT_METHOD ;
$email_order .=EMAIL_SEPARATOR . "\n";
$payment_class = $_SESSION['payment'];
$email_order .= $GLOBALS[$payment_class]->title . "\n\n";
$email_order .= (isset($this->info['cc_type']) && $this->info['cc_type'] != '') ? $this->info['cc_type'] . ' ' . $cc_num_display . "\n\n" : '';
$email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n" : '';
//addition to add invoice number as reference for bank details
IF($_SESSION['payment']=="dirbanknz") {
$email_order.="Reference: ".$zf_insert_id."\n";
}
It isn't fully tested yet,, and I only send out plain text emails, but it gets the job done for me.
If I have committed major sins in the "right way to do things in Zen Cart" please let me know. I hope that these help someone else.
Pat