Hello!
I have a problem with the Addon Module - invoice_1.30 - that i Downloaded from osc homepage.
It works under language english but not under language swedish . When I change from English to swedish and test to buy something and selecting invoice - when the checkout_success.php should load i get error -
Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/jbnmedia/domains/jbnmedia.net/public_html/home/catalog/includes/functions/database.php:13) in /home/jbnmedia/domains/jbnmedia.net/public_html/home/catalog/includes/functions/database.php on line 25
-------------------
It works fine under english an the only thing that separates each other is the invocie file under each language :
/CATALOG/INCLUDES/LANGUAGE/SWEDISH/MODULES/INVOICE.PHP
Swedish
<?
/*
$Id: invoice.php,v 1.30 2004/09/20 mm $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
define('MODULE_PAYMENT_INVOICE_TEXT_DESCRIPTION', 'Faktura');
define('MODULE_PAYMENT_INVOICE_TEXT_TITLE', 'Faktura');
?>
------------------------------------------------------------------------
/CATALOG/INCLUDES/LANGUAGE/ENGLISH/MODULES/INVOICE.PHP
English
<?
/*
$Id: invoice.php,v 1.30 2004/09/20 mm $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
define('MODULE_PAYMENT_INVOICE_TEXT_DESCRIPTION', 'Invoice');
define('MODULE_PAYMENT_INVOICE_TEXT_TITLE', 'Invoice');
?>
-----------------------------------------------------------------------------------------------
/CATALOG/INCLUDES/MODULES/PAYMENT/INVOICE.PHP
The Module
<?
/*
$Id: invoice.php,v 1.30 2004/09/20 mm $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
class invoice {
var $code, $title, $description, $enabled;
// class constructor
function invoice() {
$this->code = 'invoice';
$this->title = MODULE_PAYMENT_INVOICE_TEXT_TITLE;
$this->description = MODULE_PAYMENT_INVOICE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_PAYMENT_INVOICE_SORT_ORDER;
$this->enabled = MODULE_PAYMENT_INVOICE_STATUS;
}
// class methods
function javascript_validation() {
return false;
}
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
function pre_confirmation_check(){
return false;
}
function confirmation() {
return false;
}
function process_button() {
return false;
}
function before_process() {
return false;
}
function after_process() {
return false;
}
function output_error() {
return false;
}
function check() {
if (!isset($this->check)) {
$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_INVOICE_STATUS'");
$this->check = tep_db_num_rows($check_query);
}
return $this->check;
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('Allow Invoice', 'MODULE_PAYMENT_INVOICE_STATUS', 'True', 'Do you want to accept invoice payments?', '6', '10', now(), 'tep_cfg_select_option(array(\"True\", \"False\"),')");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_INVOICE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0' , now())");
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_INVOICE_STATUS'");
}
function keys() {
$keys = array('MODULE_PAYMENT_INVOICE_STATUS', 'MODULE_PAYMENT_INVOICE_SORT_ORDER');
return $keys;
}
}
-------------------------------------------------------------------------------------
/ Johan
