1
eddie123
xoops2-mod_xoopsshop_v0_2b_michae_baecker Install issues
  • 2005/6/30 19:05

  • eddie123

  • Just popping in

  • Posts: 23

  • Since: 2005/6/17


After almost a week of playing with this code I still cannot get this module working.. It installed fine and then a massive amount of errors when I engage the admin menu. I have managed to solve a lot of them however there is one I cant figure out.. ANY HELP WOULD BE APPRECIATED!

Error - Fatal error: Cannot redeclare class currencies in E:\Website\modules\shop\includes\classes\currencies.php on line 16. Line 16 is the first item highlighted in blue below!

Here is the module code currencies.php - It appears that the areas highlighted in blue require some sort of setting. I am not sure what the "function () and the array () requires..

////
// Class to handle currencies
// TABLES: currencies
class currencies {
var $currencies;

// class constructor
function currencies() $this->currencies = array();
$currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
while ($currencies = tep_db_fetch_array($currencies_query)) {
$this->currencies[$currencies['code']] = array('title' => $currencies['title'],
'symbol_left' => $currencies['symbol_left'],
'symbol_right' => $currencies['symbol_right'],
'decimal_point' => $currencies['decimal_point'],
'thousands_point' => $currencies['thousands_point'],
'decimal_places' => $currencies['decimal_places'],
'value' => $currencies['value']);
}
}

// class methods
function format($number, $calculate_currency_value = true, $currency_type = DEFAULT_CURRENCY, $currency_value = '') {
if ($calculate_currency_value) {
$rate = ($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number * $rate, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
$format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
}
} else {
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
}

return $format_string;
}

function get_value($code) {
return $this->currencies[$code]['value'];
}

function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
}
?>

2
wtravel
Re: xoops2-mod_xoopsshop_v0_2b_michae_baecker Install issues

In this module look for all instances of the search term:

new currencies

Check if this line is stated in any other of the php files (as included) used in your script page or the php file itself (that shows you the error).

It should have been called in the same file before or in another included file.

Login

Who's Online

134 user(s) are online (69 user(s) are browsing Support Forums)


Members: 0


Guests: 134


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits