Php Prestashop 1.4购物车更新问题(货币转换)

Php Prestashop 1.4购物车更新问题(货币转换),php,prestashop,currency,currency-exchange-rates,Php,Prestashop,Currency,Currency Exchange Rates,我在执行$cart->update()时遇到了一个奇怪的问题更改货币后 e、 g.以磅为单位,购物车的总金额为896.32英镑 当前兑换率1.388889(欧元) 因此,欧元应为896.32*1.388889=1244.89(四舍五入2) 但如果我在结账和付款模块上,我会: $cookie->id_currency = 1; //1 for EUR $cart->id_currency = $cookie->id_currency; $cart->update(); //

我在执行$cart->update()时遇到了一个奇怪的问题更改货币后

e、 g.以磅为单位,购物车的总金额为896.32英镑 当前兑换率1.388889(欧元)

因此,欧元应为896.32*1.388889=1244.89(四舍五入2)

但如果我在结账和付款模块上,我会:

$cookie->id_currency = 1; //1 for EUR
$cart->id_currency = $cookie->id_currency;
$cart->update();
//and then...
$amount = number_format($cart->getOrderTotal(true, 3), 2, '.', '');
它完全错了。。。最后的$total变量错误

调试控制台: 在$cart->update()之前

$cart   Smarty_Variable Object (3)
->value = Cart Object (14)
   ->id = 2899
   ->id_address_delivery = "5"
   ->id_address_invoice = "5"
   ->id_currency = "3"
   ->id_customer = "3"
   ->id_guest = "998683"
   ->id_lang = "1"
   ->id_carrier = "14"
   ->recyclable = "1"
   ->gift = "0"
   ->gift_message = ""
   ->date_add = "2015-12-09 10:08:27"
   ->secure_key = "5b5c81dbecc7b7e1d9603752071321b7"
   ->date_upd = "2015-12-09 17:17:15"
->nocache = false
->scope = "Smarty root"


$total  Smarty_Variable Object (3)
->value = "£896.32"
->nocache = false
->scope = "Smarty root"
$cart   Smarty_Variable Object (3)
->value = Cart Object (14)
   ->id = 2899
   ->id_address_delivery = "5"
   ->id_address_invoice = "5"
   ->id_currency = 1
   ->id_customer = "3"
   ->id_guest = "998683"
   ->id_lang = "1"
   ->id_carrier = "14"
   ->recyclable = "1"
   ->gift = "0"
   ->gift_message = ""
   ->date_add = "2015-12-09 10:08:27"
   ->secure_key = "5b5c81dbecc7b7e1d9603752071321b7"
   ->date_upd = "2015-12-09 17:19:41"
->nocache = false
->scope = "Smarty root"

$total  Smarty_Variable Object (3)
->value = "1 239,67 €"
->nocache = false
->scope = "Smarty root"
在$cart->update()之后

$cart   Smarty_Variable Object (3)
->value = Cart Object (14)
   ->id = 2899
   ->id_address_delivery = "5"
   ->id_address_invoice = "5"
   ->id_currency = "3"
   ->id_customer = "3"
   ->id_guest = "998683"
   ->id_lang = "1"
   ->id_carrier = "14"
   ->recyclable = "1"
   ->gift = "0"
   ->gift_message = ""
   ->date_add = "2015-12-09 10:08:27"
   ->secure_key = "5b5c81dbecc7b7e1d9603752071321b7"
   ->date_upd = "2015-12-09 17:17:15"
->nocache = false
->scope = "Smarty root"


$total  Smarty_Variable Object (3)
->value = "£896.32"
->nocache = false
->scope = "Smarty root"
$cart   Smarty_Variable Object (3)
->value = Cart Object (14)
   ->id = 2899
   ->id_address_delivery = "5"
   ->id_address_invoice = "5"
   ->id_currency = 1
   ->id_customer = "3"
   ->id_guest = "998683"
   ->id_lang = "1"
   ->id_carrier = "14"
   ->recyclable = "1"
   ->gift = "0"
   ->gift_message = ""
   ->date_add = "2015-12-09 10:08:27"
   ->secure_key = "5b5c81dbecc7b7e1d9603752071321b7"
   ->date_upd = "2015-12-09 17:19:41"
->nocache = false
->scope = "Smarty root"

$total  Smarty_Variable Object (3)
->value = "1 239,67 €"
->nocache = false
->scope = "Smarty root"
正如您所看到的,1239,67€是错误的,应该是1244,89€

请问,错误在哪里?我快疯了。 非常感谢您的帮助。

发现了问题

数据库中有附加装运成本字段,当您更改货币时,该字段不会更新。 我不知道在最新的PS版本中,行为是否有所不同,但这肯定是开发人员的疏忽