{if !$product}
   {$product = $body.product}
{/if}

{$isLogged = $ctrl.logged}
{ifmodule PRODUCTS_FAVORITES__PRODUCTS_FAVORITES_NOT_LOGGED}
    {$isLogged = true}
{/ifmodule}

{if $isLogged and {get_product_info id=$product.id type='is_favorite'}}
   <a href="{path('kupshop_catalog_favorite_remove', ['id' => $product.id])}" rel="nofollow"
      class="{$btn_class|default:"btn btn-fav"} active" title="{t}Odebrat z oblíbených{/t}">
      <span class="fc icons_heart"></span> {if $btn_text}{t}Odebrat z oblíbených{/t}{/if}
   </a>
{else}
   <a href="{path('kupshop_catalog_favorite_add', ['id' => $product.id])}" class="{$btn_class|default:"btn btn-fav"} {if !$isLogged}cart-signin{/if}"
      {if $isLogged} data-tracking-click='{get_gtm_data encode=true type='ecommerce' method='AddToWishList' data=['products' => [$product], 'listType' => $listType, 'listId' => $listId]}'{/if}
      title="{$btn_text|default:"{t}Přidat mezi oblíbené{/t}"}" rel="nofollow"
      {if !$isLogged} data-signin-next="{path('kupshop_catalog_favorite_add', ['id' => $product.id])}"{elseif $dynamic_reload} data-favorites-add{/if}>
      <span class="fc icons_heart"></span> {$btn_text}
   </a>
{/if}
