VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: man.of.earth on September 13, 2019, 13:37:44 PM

Title: Currency code instead of currency name used in editing orders page in admin
Post by: man.of.earth on September 13, 2019, 13:37:44 PM
Hello,
I noticed that on the admin order edit page (standard payment plugin) it is used the currency code instead of currency name (the latter is more humanly readable):

if ($paymentTable->email_currency) {
$html .= $this->getHtmlRowBE ('STANDARD_EMAIL_CURRENCY', $paymentTable->email_currency );
}

can be replaced for
if ($paymentTable->email_currency) {
$html .= $this->getHtmlRowBE ('STANDARD_EMAIL_CURRENCY', $paymentTable->payment_currency );
}

in /plugins/vmpayment/standard/standard.php, lines 217-219

Later edit: this is wrong; see edits in the following messages.
Title: Re: Currency code instead of currency name used in editing orders page in admin
Post by: Milbo on September 16, 2019, 15:01:52 PM
The email currency is always the same as the payment currency? I doubt that. Paypal has a special option, you see anything in currency x, but you pay in y.
Title: Re: Currency code instead of currency name used in editing orders page in admin
Post by: man.of.earth on September 16, 2019, 19:31:31 PM
Right, they can be different, indeed.
However, what I meant was to express the currency as its name, rather than its code.
For example, for euros, it shows
Email Currency 47

The solution could be
$html .= $this->getHtmlRowBE ('STANDARD_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($paymentTable->email_currency, 'currency_code_3') );
in line 218.

After this modification, it shows
Email Currency EUR
which is humanly readable.