Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Fix admin currency display
Browse files Browse the repository at this point in the history
  • Loading branch information
ecartz committed Nov 14, 2020
1 parent e16b18b commit 542dc0f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions includes/system/versioned/1.0.7.9/currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public function __construct() {
}

// class methods
public function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
public function format($number, $calculate_currency_value = true, $currency_type = null, $currency_value = null) {
if (empty($currency_type)) {
$currency_type = $_SESSION['currency'];
$currency_type = $_SESSION['currency'] ?? DEFAULT_CURRENCY;
}

if ($calculate_currency_value) {
$number *= tep_not_null($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
$number *= ($currency_value ?? $this->currencies[$currency_type]['value']);
}

return $this->currencies[$currency_type]['symbol_left']
Expand Down Expand Up @@ -73,13 +73,13 @@ public function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}

public function format_raw($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
public function format_raw($number, $calculate_currency_value = true, $currency_type = null, $currency_value = null) {
if (empty($currency_type)) {
$currency_type = $_SESSION['currency'];
$currency_type = $_SESSION['currency'] ?? DEFAULT_CURRENCY;
}

if ($calculate_currency_value) {
$number *= tep_not_null($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
$number *= ($currency_value ?? $this->currencies[$currency_type]['value']);
}

return number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], '.', '');
Expand Down

0 comments on commit 542dc0f

Please sign in to comment.