From cd7483274da689e9db377367100910a7a12be3b7 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 15 Jan 2018 12:52:00 +0100 Subject: [PATCH] Facebook currency --- .../OrderConfirmationController.php | 18 +- themes/site/header.tpl | 793 +++++++++--------- themes/site_mobile/header.tpl | 718 ++++++++-------- 3 files changed, 791 insertions(+), 738 deletions(-) diff --git a/override/controllers/OrderConfirmationController.php b/override/controllers/OrderConfirmationController.php index 7cd454bb..50d85b5c 100755 --- a/override/controllers/OrderConfirmationController.php +++ b/override/controllers/OrderConfirmationController.php @@ -16,19 +16,11 @@ 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' => $currencyIsoCode, - ) - ); + self::$smarty->assign(array( + 'order' => $order, + 'productIds' => $productIds, + 'currency' => Currency::getCurrency((int) $order->id_currency), + )); } public function displayContent() diff --git a/themes/site/header.tpl b/themes/site/header.tpl index 9c7aa596..6874e81b 100755 --- a/themes/site/header.tpl +++ b/themes/site/header.tpl @@ -27,416 +27,451 @@ - {$meta_title|escape:'htmlall':'UTF-8'} -{if isset($meta_description) AND $meta_description} - -{/if} -{if isset($meta_keywords) AND $meta_keywords} - -{/if} -{if isset($meta_fb_img) AND $meta_fb_img} - -{/if} - - - - - - {if isset($page_name) && $page_name == 'authentication'} - - {/if} - -{if isset($css_files)} + {$meta_title|escape:'htmlall':'UTF-8'} + {if isset($meta_description) AND $meta_description} + + {/if} + {if isset($meta_keywords) AND $meta_keywords} + + {/if} + {if isset($meta_fb_img) AND $meta_fb_img} + + {/if} + + + + + + + {if isset($page_name) && $page_name == 'authentication'} + + {/if} + + {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} {/foreach} -{/if} -{if isset($js_files)} + {/if} + {if isset($js_files)} {foreach from=$js_files item=js_uri} {/foreach} -{/if} - - {$HOOK_HEADER} - - - + {/if} + + {$HOOK_HEADER} + + + - - {literal} - - {/literal} - + + {literal} + + {/literal} + - {assign var='isEC' value=Configuration::get('GANALYTICS_EC')} - {if $cookie->id_lang == 2} - {literal} - + {/literal} + {elseif $cookie->id_lang == 3} + {literal} + - {/literal} - {elseif $cookie->id_lang == 3} - {literal} - + {/literal} + {/if} - {/literal}{else if isset($page_name) && $page_name == 'product'}{literal} - ga('require', 'ec'); - ga('ec:addProduct', { - 'id': {/literal}{$product->id}{literal}, - 'name': "{/literal}{$product->name|escape:'htmlall':'UTF-8'}{literal}", - 'category': "{/literal}{$sale->title[$cookie->id_lang]}{literal}" - }); + + {if $cookie->id_lang == 2} + {literal} + + {/literal} + + {elseif $cookie->id_lang == 3} + {literal} + - {/literal} - {/if} - - - {if $cookie->id_lang == 2} - {literal} - - {/literal} - - {elseif $cookie->id_lang == 3} - {literal} - - {/literal} - - {/if} - - {literal} - + {/literal} + + {/if} + + {literal} + + {/literal} + {if isset($facebook_validation) && $facebook_validation} + {literal} + + {/literal} + {/if} + + {$currency|@print_r} + + {if isset($page_name)} + {if $page_name == 'order-confirmation' && isset($order)} + {literal} + - {/literal} - {if isset($facebook_validation) && $facebook_validation} - {literal} - - {/literal} - {/if} - - {if isset($page_name)} - {if $page_name == 'order-confirmation' && isset($order)} - {literal} - - {/literal} - {/if} - {/if} - - - - {literal} - - {/literal} + + {/literal} + {/if} + {/if} + + + + {literal} + + {/literal} - + {if !$content_only} diff --git a/themes/site_mobile/header.tpl b/themes/site_mobile/header.tpl index 7b4dcfef..83e94811 100755 --- a/themes/site_mobile/header.tpl +++ b/themes/site_mobile/header.tpl @@ -79,372 +79,398 @@ {literal} + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); + })(window,document,'script','dataLayer','GTM-PT7ZGQF'); {/literal} {assign var='isEC' value=Configuration::get('GANALYTICS_EC')} - {if $cookie->id_lang == 2} - {literal} - - {/literal} - {elseif $cookie->id_lang == 3} - {literal} - - {/literal} - {/if} - - - {if $cookie->id_lang == 2} - {literal} - - {/literal} - - {elseif $cookie->id_lang == 3} - {literal} - - {/literal} - - {/if} - + {if $cookie->id_lang == 2} {literal} {/literal} + {elseif $cookie->id_lang == 3} + {literal} + + {/literal} + {/if} + + + {if $cookie->id_lang == 2} + {literal} + + {/literal} + + {elseif $cookie->id_lang == 3} + {literal} + + {/literal} + + {/if} + + {literal} + + {/literal} + + {if isset($facebook_validation) && $facebook_validation} + {literal} + + {/literal} + {/if} + + {if isset($page_name)} + {if $page_name == 'order-confirmation'} {literal} {/literal} {/if} + {/if} + - {if isset($page_name)} - {if $page_name == 'order-confirmation'} - {literal} - - {/literal} - {/if} - {/if} - - - - {literal} - - {/literal} - - {include file="$tpl_dir./header-meta-fb.tpl"} + + {literal} + + {/literal} + + {include file="$tpl_dir./header-meta-fb.tpl"} - - - - - + + + {if !$content_only} {if isset($restricted_country_mode) && $restricted_country_mode}