{**
 * Copyright since 2022 Inferendo Srl
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License version 3.0
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * @author    Inferendo SRL <hello@visidea.ai>
 * @copyright Since 2022 Inferendo Srl
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 *}

{if $page == 'home'}
    <div
        class="visidea-recommendations"
        language="{$language.iso_code}"
        page="home"
        user_id="{Context::getContext()->customer->id|escape:'htmlall':'UTF-8'}"
    ></div>
{/if}
{if $page == 'product'}
    <div
        class="visidea-recommendations"
        language="{$language.iso_code}"
        page="product"
        user_id="{Context::getContext()->customer->id|escape:'htmlall':'UTF-8'}"
        item_id="{$product->id|intval|escape:'htmlall':'UTF-8'}"
    ></div>
    <meta
        class="visidea-interaction"
        type="item"
        user_id="{Context::getContext()->customer->id|escape:'htmlall':'UTF-8'}"
        item_id="{$product->id|intval|escape:'htmlall':'UTF-8'}"
    />
{/if}
{if $page == 'cart'}
    {assign var="item_ids" value=[]}
    {foreach from=$cart.products item=product}
        {append var="item_ids" value=$product.id_product}
    {/foreach}
    {assign var="item_ids_string" value=$item_ids|@implode:','}
    <div
        class="visidea-recommendations"
        language="{$language.iso_code}"
        page="cart"
        user_id="{$cart->id_customer|escape:'htmlall':'UTF-8'}"
        item_id="{$item_ids_string}">
    </div>
{/if}
{if $page == 'order'}
    <div
        class="visidea-recommendations"
        language="{$language.iso_code}"
        page="order"
        user_id="{Context::getContext()->customer->id|escape:'htmlall':'UTF-8'}"
    ></div>
{/if}
