{block name='snippets-comparelist-dropdown'}
    {$lazyLoadImages=$lazyLoadImages|default:true}
    {et_isShopVersionAtLeast value="5.4.0-rc.1" assign='shopIsAtLeast54'}
    {block name='snippets-comparelist-dropdown-products'}
        <div class="comparelist-dropdown-table table-responsive max-h-sm lg-max-h">
            {if count(JTL\Session\Frontend::getCompareList()->oArtikel_arr) > 0}
                {$baseURL = $ShopURL|cat:'/?vlplo='}
                {if $shopIsAtLeast54}
                    {$baseURL = $ShopURL|cat:'/?'|cat:$smarty.const.QUERY_PARAM_COMPARELIST_PRODUCT|cat:'='}
                {/if}
                <table class="table table-vertical-middle table-img">
                    <tbody>
                    {foreach JTL\Session\Frontend::getCompareList()->oArtikel_arr as $product}
                        {block name='snippets-comparelist-dropdown-products-body'}
                            <tr>
                                <td class="w-100-util">
                                    <div class="form-row align-items-center-util">
                                        <div class="col col-auto">
                                            {block name='snippets-comparelist-dropdown-products-image'}
                                                <a href="{$product->cURLFull}">
                                                    {image lazy=$lazyLoadImages webp=true
                                                    src=$product->image->cURLMini
                                                    srcset="{$product->image->cURLMini} {$Einstellungen.bilder.bilder_artikel_mini_breite}w,
                                                            {$product->image->cURLKlein} {$Einstellungen.bilder.bilder_artikel_klein_breite}w,
                                                            {$product->image->cURLNormal} {$Einstellungen.bilder.bilder_artikel_normal_breite}w"
                                                    sizes="45px"
                                                    alt=$product->cName
                                                    class="img-sm"}
                                                </a>
                                            {/block}
                                        </div>
                                        <div class="col">
                                            {block name='snippets-comparelist-dropdown-products-title'}
                                                <a href="{$product->cURLFull}">{$product->cName}</a>
                                            {/block}
                                        </div>
                                    </div>
                                </td>
                                <td  class="text-right-util text-nowrap-util">
                                    {block name='snippets-comparelist-dropdown-products-remove'}
                                        <a href="{$baseURL}{$product->kArtikel}" class="remove"
                                            title="{lang section="comparelist" key="removeFromCompareList"}"
                                            data-name="Vergleichsliste.remove"
                                            data-toggle="product-actions"
                                            data-value="{ldelim}{'"a"'|escape:'html'}:{$product->kArtikel}{rdelim}"
                                        >
                                            <i class="{et_getIcon key="remove"}"></i>
                                        </a>
                                    {/block}
                                </td>
                            </tr>
                        {/block}
                    {/foreach}
                    </tbody>
                </table>
            {/if}
        </div>
    {/block}
    {block name='snippets-comparelist-dropdown-hint'}
        <div class="comparelist-dropdown-table-body dropdown-body">
            {if count(JTL\Session\Frontend::getCompareList()->oArtikel_arr) <= 1}
                {block name='snippets-comparelist-dropdown-more-than-one'}
                    {lang key='productNumberHint' section='comparelist'}
                {/block}
            {else}
                {block name='snippets-comparelist-dropdown-hint-to-compare'}
                    {include file="widgets/base/button.tpl" variant="primary" classes="comparelist-dropdown-table-body-button btn btn-block btn-sm" id="nav-comparelist-goto" href="{get_static_route id='vergleichsliste.php'}" label="{lang key='gotToCompare'}" title="{lang key='gotToCompare'}"}
                {/block}
            {/if}
        </div>
    {/block}
{/block}
