{block name='boxes-box-comparelist'}
    {if $Einstellungen.vergleichsliste.vergleichsliste_anzeigen === 'Y'}
    {assign var=maxItems value=$oBox->getItemCount()}
    {assign var=itemCount value=count($oBox->getProducts())}
    {if $itemCount > 0}
        <div class="box box-compare box-normal" id="sidebox{$oBox->getID()}">
            {block name='boxes-box-comparelist-content'}
                {block name='boxes-box-comparelist-toggle-title'}
                    <a id="crd-hdr-{$oBox->getID()}"
                        href="#crd-cllps-{$oBox->getID()}"
                        data-toggle="collapse"
                        role="button"
                        aria-expanded="false"
                        aria-controls="crd-cllps-{$oBox->getID()}"
                        class="box-normal-link dropdown-toggle"
                    >
                        {lang key='compare'}
                    </a>
                {/block}
                {block name='boxes-box-comparelist-title'}
                    <div class="productlist-filter-headline align-items-center-util d-none d-md-flex">
                        <i class='{et_getIcon key="comparelist"} icon-mr-2'></i>
                        {lang key='compare'}
                    </div>
                {/block}
                {block name='boxes-box-comparelist-collapse'}
                    <div
                        class="collapse d-md-block"
                        id="crd-cllps-{$oBox->getID()}"
                        aria-labelledby="crd-hdr-{$oBox->getID()}"
                        role="region"
                    >
                        {block name='boxes-box-comparelist-products'}
                            <table class="table table-vertical-middle table-striped table-img">
                                <tbody>
                                    {$id = '"a"'|escape:'html'}
                                    {foreach $oBox->getProducts() as $product}
                                        {if $product@iteration > $maxItems}
                                            {break}
                                        {/if}
                                        <tr>
                                        <td class="w-100-util" data-id={$product->kArtikel}>
                                            {block name='boxes-box-comparelist-dropdown-products-image-title'}
                                                <div class="form-row align-items-center-util">
                                                    <div class="col col-auto">
                                                        {block name='boxes-box-comparelist-dropdown-products-image'}
                                                            <a href="{$product->cURLFull}">
                                                                {include file='snippets/image.tpl' item=$product square=false srcSize='xs' sizes='45px'}
                                                            </a>
                                                        {/block}
                                                    </div>
                                                    <div class="col">
                                                        {block name='boxes-box-comparelist-dropdown-products-title'}
                                                            <a href="{$product->cURLFull}">{$product->cName|truncate:40:'...'}</a>
                                                        {/block}
                                                    </div>
                                                </div>
                                            {/block}
                                        </td>
                                        <td class="box-delete-button">
                                            {block name='boxes-box-comparelist-dropdown-products-remove'}
                                                <a href="{$product->cURLDEL}" class="remove"
                                                    title="{lang section="comparelist" key="removeFromCompareList"}"
                                                    data-name="Vergleichsliste.remove"
                                                    data-toggle="product-actions"
                                                    data-value="{ldelim}{$id}:{$product->kArtikel}{rdelim}"
                                                    aria-label="{lang section="comparelist" key="removeFromCompareList"}"
                                                >
                                                    <span class="{et_getIcon key="remove"}"></span>
                                                </a>
                                            {/block}
                                        </td>
                                    {/foreach}
                                </tbody>
                            </table>
                        {/block}
                        {if $itemCount > 1}
                            {block name='boxes-box-comparelist-link'}
                                <hr class="hr-no-top">
                                {include file="widgets/base/button.tpl" variant="primary" classes="btn-sm btn-block" href="{get_static_route id='vergleichsliste.php'}" target="{if $Einstellungen.vergleichsliste.vergleichsliste_target === 'blank'}_blank{else}_self{/if}" label="{lang key='gotToCompare'}" title="{lang key='gotToCompare'}"}
                            {/block}
                        {/if}
                    </div>
                {/block}
            {/block}
            {block name='boxes-box-comparelist-hr-end'}
                <hr class="box-normal-hr">
            {/block}
        </div>
    {else}
        {block name='blog-preview-no-items'}
            <section class="d-none box-compare" id="sidebox{$oBox->getID()}"></section>
        {/block}
    {/if}
    {/if}
{/block}
