From 9be7d4e389e9e8282c9ca2d5b7a6a52eadd898d0 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Thu, 3 May 2012 15:13:10 +0000 Subject: [PATCH] [-] BO : #PSCFV-71 - Fix bug with currency conversion git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15055 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Tools.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 0559c8101..55074024a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -537,26 +537,17 @@ class ToolsCore return $amount; if ($currency_from === null) - { $currency_from = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); - $default_currency = $currency_from; - } if ($currency_to === null) - { $currency_to = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); - $default_currency = $currency_to; - } if ($currency_from->id == Configuration::get('PS_CURRENCY_DEFAULT')) $amount *= $currency_to->conversion_rate; else { - if (!isset($default_currency)) - $default_currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); - - // Convert amount to default currency - $amount = Tools::ps_round($amount / $default_currency->conversion_rate, 2); + // Convert amount to default currency (using the old currency rate) + $amount = Tools::ps_round($amount / $currency_from->conversion_rate, 2); // Convert to new currency $amount *= $currency_to->conversion_rate; }