{assign var='isOnCompareList' value=false}
{foreach JTL\Session\Frontend::getCompareList()->oArtikel_arr as $product}
    {if $product->kArtikel === $Artikel->kArtikel}
        {$isOnCompareList=true}
        {break}
    {/if}
{/foreach}

{if !isset($btnType)}
    {assign var="btnType" value="badge"}
{/if}

{block name='snippets-comparelist-button-main'}
    {assign var='tabIndx' value=0}
    {if isset($tplscope) && $tplscope === 'list'}
        {assign var='tabIndx' value=-1}
    {/if}
    <button name="Vergleichsliste"
        type="submit"
        class="{$classes|default:''} compare {if $btnType == 'badge'}badge badge-circle-1{elseif $btnType == 'link'}btn btn-link{/if} action-tip-animation-b {if $isOnCompareList}on-list{/if}"
        aria-label="{lang key='addToCompare' section='productOverview'}"
        data-product-id-cl="{$Artikel->kArtikel}"
        data-toggle="tooltip"
        data-trigger="hover"
        title="{lang key='addToCompare' section='productOverview'}"
        tabindex="{$tabIndx}"
    >
        <span class="{et_getIcon key="comparelist"}"></span>
        {if $btnType == 'link'}
            <span class="hidden-xs hidden-sm">{lang key='addToCompare' section='productOverview'}</span>
        {/if}
    </button>
{/block}
