Merge branch 'ticket/15099-facebookpixel' into develop

This commit is contained in:
Michael RICOIS 2017-12-13 09:52:18 +01:00
commit 58fc0ef064
3 changed files with 16 additions and 8 deletions

View File

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

View File

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

View File

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