Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Open Cart 2.0 $this->model_checkout_order->getOrder() method does not convert cart total on multiple currency site

If you have multiple currency configured on your OpenCart 2.0 eCommerce application you will notice that order total is not being converted from the default currency to the other configured currencies. I won't say this is a bug but it works just fine in lower version of OpenCart.

Anyway, if you are in this dillemma, you would have to manually convert the total. Below is how your code currently looks like:

$orderinfo = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['ordertotal'] = $orderinfo['total']

Here is how to convert it

$orderinfo = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$data['ordertotal'] = $this->currency->format($orderinfo['total'], $orderinfo['currency_code'], $orderinfo['currency_value'], false);

I hope this saves someone from trouble.

Happy Coding!

comments powered by Disqus