Get currency ISO

This commit is contained in:
Michael RICOIS 2017-12-12 17:58:23 +01:00
parent 850a678976
commit 3382d89a7e
3 changed files with 16 additions and 8 deletions

View File

@ -1,9 +1,10 @@
<?php
class OrderConfirmationController extends OrderConfirmationControllerCore {
public function preProcess() {
// Fix : delay after payment from paybox or paypal
class OrderConfirmationController extends OrderConfirmationControllerCore
{
public function preProcess()
{
// Fix : delay after payment from paybox or paypal
// so that the order has enough time to be created.
sleep(5);
@ -15,16 +16,23 @@ class OrderConfirmationController extends OrderConfirmationControllerCore {
$productIds[] = (int) $product['product_id'];
}
$currency = Currency::getCurrency((int) $order->id_currency);
$currencyIsoCode = 'EUR';
if (!empty($currency['iso_code'])) {
$currencyIsoCode = $currency['iso_code'];
}
self::$smarty->assign(
array(
'order' => $order,
'productIds' => $productIds,
'currency' => Currency::getCurrency((int) $order->id_currency),
'currency' => $currencyIsoCode,
)
);
}
public function displayContent() {
public function displayContent()
{
$customer = Context::getContext()->customer;
$order = new Order($this->id_order);

View File

@ -413,7 +413,7 @@
<script>
fbq('track', 'Purchase', {
value: '{/literal}{$order->total_paid}{literal}',
currency: "{/literal}{$currency['name']}{literal}"
currency: "{/literal}{$currencyIsoCode}{literal}"
});
</script>
{/literal}

View File

@ -395,7 +395,7 @@
<script>
fbq('track', 'Purchase', {
value: '{/literal}{$order->total_paid}{literal}',
currency: "{/literal}{$currency['name']}{literal}"
currency: "{/literal}{$currencyIsoCode}{literal}"
});
</script>
{/literal}