I was wondering if there was any way to add the Swift Code to the US version? I know when getting international transfers, a Swift code is needed, which our site does get international wire transfer to pay for some items. If thought about just using the Australian version, but it uses BSB numbers and what not and wouldn't really work. Thanks!
Yep just add the field to the code in both files and make sure you add it to the database insert statement in the file as well
Webzings Design
Semi retired from Web Design
If you have this payment module already installed, uninstall it first but take note of your details as you will need them again later.
Open includes/languages/english/modules/payment/dirbankusa.php
find the 2 instances of
Code:"\nBank Name: " . MODULE_PAYMENT_DIRBANKUSA_BANKNAM .
just after each of the 2 lines add this
Code:"\nSwift Code: " . MODULE_PAYMENT_DIRBANKUSA_SWIFT .
Then open includes/modules/payment/dirbankusa.php
find
and change toCode:$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank Account No.', 'MODULE_PAYMENT_DIRBANKUSA_ACCNUM', '12345678', 'Bank Account No.', '6', '1', now());"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank Account Name', 'MODULE_PAYMENT_DIRBANKUSA_ACCNAM', 'Joe Bloggs', 'Bank Account Name', '6', '1', now());");
In the same file now changeCode:$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank Account No.', 'MODULE_PAYMENT_DIRBANKUSA_ACCNUM', '12345678', 'Bank Account No.', '6', '1', now());"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Swift Code.', 'MODULE_PAYMENT_DIRBANKUSA_SWIFT', '12345678', 'Swift Code.', '6', '1', now());"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank Account Name', 'MODULE_PAYMENT_DIRBANKUSA_ACCNAM', 'Joe Bloggs', 'Bank Account Name', '6', '1', now());");
to readCode:function keys() { return array('MODULE_PAYMENT_DIRBANKUSA_STATUS', 'MODULE_PAYMENT_DIRBANKUSA_ZONE', 'MODULE_PAYMENT_DIRBANKUSA_SORT_ORDER', 'MODULE_PAYMENT_DIRBANKUSA_ROUTING', 'MODULE_PAYMENT_DIRBANKUSA_ACCNUM', 'MODULE_PAYMENT_DIRBANKUSA_ACCNAM', 'MODULE_PAYMENT_DIRBANKUSA_BANKNAM', 'MODULE_PAYMENT_DIRBANKUSA_ORDER_STATUS_ID'); }
Upload your changed files and reinstall the mod in your admin.Code:function keys() { return array('MODULE_PAYMENT_DIRBANKUSA_STATUS', 'MODULE_PAYMENT_DIRBANKUSA_ZONE', 'MODULE_PAYMENT_DIRBANKUSA_SORT_ORDER', 'MODULE_PAYMENT_DIRBANKUSA_ROUTING', 'MODULE_PAYMENT_DIRBANKUSA_ACCNUM', 'MODULE_PAYMENT_DIRBANKUSA_ACCNAM', 'MODULE_PAYMENT_DIRBANKUSA_SWIFT', 'MODULE_PAYMENT_DIRBANKUSA_BANKNAM', 'MODULE_PAYMENT_DIRBANKUSA_ORDER_STATUS_ID'); }
Let us know if this works for you.
Cheers / Frank
Managed to get the reference number (= the order id) to show up in the order confirmation email (HTML email) directly below the emailed bank details.
The reference number will only show in the email when Direct Bank Deposit is selected as payment method.
To get this working you need to
1. create a language define file includes/languages/english/extra_definitions/dirbankaus.php asf:
2. Open includes/classes/order.php and find this code:PHP Code:
<?php
/**
* @package languageDefines
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: dirbankaus.php v1.51 $
*/
// $Id: DIRBANKAUS.php 1975 2014-03-23 02:48:21Z frank18 $
//
// this is used to display the order number as reference number in the order confirmation email
define('EMAIL_TEXT_REFERENCE_NUMBER', 'Reference Number:');
?>
Change to:PHP Code:
$html_msg['PAYMENT_METHOD_TITLE'] = EMAIL_TEXT_PAYMENT_METHOD;
$html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : (isset($this->info['cc_type']) && $this->info['cc_type'] != '' ? $this->info['cc_type'] . ' ' . $cc_num_display . "\n\n" : '');
PHP Code:
$html_msg['PAYMENT_METHOD_TITLE'] = EMAIL_TEXT_PAYMENT_METHOD;
$html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : (isset($this->info['cc_type']) && $this->info['cc_type'] != '' ? $this->info['cc_type'] . ' ' . $cc_num_display . "\n\n" : '');
// BOF add invoice number as reference number for direct bank transfer
if($_SESSION['payment']=="dirbankaus") {
$html_msg['FOOTER_REFERENCE_NUM_TITLE'] = EMAIL_TEXT_REFERENCE_NUMBER;
$html_msg['FOOTER_REFERENCE_NUMBER'] = $zf_insert_id;
} else {
$html_msg['FOOTER_REFERENCE_NUM_TITLE'] = '';
$html_msg['FOOTER_REFERENCE_NUMBER'] = '';
}
// EOF add invoice number as reference number for direct bank transfer
3. Open email/email_template_checkout.html and find this code:
Change to:Code:<td class="payment-footer">$PAYMENT_METHOD_FOOTER</td> </tr>
That's itCode:<td class="payment-footer">$PAYMENT_METHOD_FOOTER<br /><b>$FOOTER_REFERENCE_NUM_TITLE $FOOTER_REFERENCE_NUMBER</b></td> </tr>
If you want to use this modification for countries other than Australia you need to change every instance of dirbankaus in the above coding to the corresponding dirbankxxx - eg dirbanknz or dirbankusa or dirbankcan - whatever....
Backup your live files then upload the changed/new files
I have not tested this with text emails. Any feedback relating to text emails is most welcome!
Cheers / Frank
Last edited by frank18; 26 Mar 2014 at 09:43 AM.
Hi nigelt
I am using your linked version and I have also made the changes like below and I still can't see it on the check out page. It only displays PayPal option. My version zencart is 1.5.3
Can you please suggest what else can be done to make it work. I have also re uploaded files using FTP and still no luck.
---------- locate the code that reads like -----
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_DIRBANK_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ ................
--------------------------------------------------
And change the $check_flag = false ; to $check_flag = true ;
Downunder QLD
Just upgraded a site to 1.5.4 running on PHP 5.4.39 and had this error whilst testing:
To fix this open your /includes/modules/payment/dirbankaus.php[13-Apr-2015 12:09:16 Australia/Brisbane] PHP Warning: Illegal string offset 'id' in /home/XXXXXXX/public_html/includes/modules/payment/dirbankaus.php on line 50
Change
to thisPHP Code:
// class methods
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_DIRBANKAUS_ZONE > 0) ) {
$check_flag = false;
Note that I am in Australia, if you are using the USA equivalent replace DIRBANKAUS with DIRBANKUSA and similar for other countries.PHP Code:
// class methods
function update_status() {
global $order, $db;
if ($this->enabled && (int)MODULE_PAYMENT_DIRBANKAUS_ZONE > 0 && isset($order->billing['country']['id'])) {
$check_flag = false;
Hi. I'm using Zen Cart v1.5.4. I noticed Direct Bank Deposit - Version 1.5.2 contributed by nigelt74 below is for Zen Cart v1.3.9, v1.5.0 and v1.5.1.
http://www.zen-cart.com/downloads.php?do=file&id=60
I wonder if it's compatible with Zen Cart v1.5.4 as well? If not, is there one that can be used by Zen Cart v1.5.4? Or is there a similar module that can be used instead? I'll be using local bank transfer as the only payment method.
Thanks.
Bookmarks