40 lines
2.0 KiB
Smarty
40 lines
2.0 KiB
Smarty
{*
|
|
* @author Web In Color - addons@webincolor.fr
|
|
* @version 2.5
|
|
* @uses Prestashop modules
|
|
* @since 1.0 - 22 juillet 2013
|
|
* @package criteo
|
|
* @copyright Copyright © 2013, Web In Color
|
|
*}
|
|
<script type="text/javascript">
|
|
window.criteo_q = window.criteo_q || [];
|
|
window.criteo_q.push(
|
|
{literal}{ event: "setAccount", account:{/literal}{$wic_criteo_account|intval}{literal}},{/literal}
|
|
{if $id_customer}
|
|
{literal}{ event: "setCustomerId", id: {/literal}"{$id_customer|intval}"{literal}},{/literal}
|
|
{/if}
|
|
{if $customer_email}
|
|
{literal}{ event: "setHashedEmail", email:["{/literal}{$customer_email|escape:'htmlall':'UTF-8'}{literal}"]},{/literal}
|
|
{/if}
|
|
{literal}{ event: "setSiteType", type: {/literal}"{$wic_criteo_site_type|escape:'html'}"{literal}},{/literal}
|
|
{if $wic_action == 'productFooter'}
|
|
{literal}{ event: "viewItem", item: {/literal}"{$wic_product_id|escape:'html'}" {literal}}{/literal}
|
|
{elseif $wic_action == 'productList'}
|
|
{literal}{ event: "viewList", item: [{/literal}{$products_data|escape:'html'}{literal}]}{/literal}
|
|
{elseif $wic_action == 'shoppingCart'}
|
|
{literal}{ event: "viewBasket", item: [{/literal}{$wic_product_list|escape:'none'}{literal}]}{/literal}
|
|
{elseif $wic_action == 'search'}
|
|
{if isset($search_products)}
|
|
{literal}{ event: "viewList", item: [{/literal}{foreach from=$search_products item=product name=search_products}{if $smarty.foreach.search_products.index < 3}{$product.id_product|intval}{if !$smarty.foreach.search_products.last && $smarty.foreach.search_products.index < 2},{/if}{/if}{/foreach}], keywords: "{$searchQuery|escape:'html'}"{literal}}{/literal}
|
|
{/if}
|
|
{elseif $wic_action == 'orderConfirmation'}
|
|
{literal}{ event: "trackTransaction", id: "{/literal}{$wic_id_order|intval}{literal}", new_customer: {/literal}{if $old_customer}0{else}1{/if}{literal},
|
|
item: [{/literal}
|
|
{$wic_product_list|escape:'none'}{literal}
|
|
]}{/literal}
|
|
{elseif $wic_action == 'home'}
|
|
{literal}{ event: "viewHome"}{/literal}
|
|
{/if}
|
|
);
|
|
</script>
|