{block name='boxes-box-wishlist'}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {if count($oBox->getItems()) > 0}
        <div class="box box-wishlist box-normal" id="sidebox{$oBox->getID()}">
            {block name='boxes-box-wishlist-content'}
                {block name='boxes-box-wishlist-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='wishlist'}
                    </a>
                {/block}
                {block name='boxes-box-wishlist-title'}
                    <div class="productlist-filter-headline align-items-center-util d-none d-md-flex">
                        <i class='{et_getIcon key="wishlist"} icon-mr-2'></i>
                        {lang key='wishlist'}
                    </div>
                {/block}
                {block name='boxes-box-wishlist-collapse'}
                    <div
                        class="collapse d-md-block"
                        id="crd-cllps-{$oBox->getID()}"
                        aria-labelledby="crd-hdr-{$oBox->getID()}"
                        role="region"
                    >
                        {assign var=maxItems value=$oBox->getItemCount()}
                        <table class="table table-vertical-middle table-striped table-img">
                            <tbody>
                                {block name='boxes-box-wishlist-wishlist-items'}
                                {foreach $oBox->getItems() as $wishlistItem}
                                    {if $wishlistItem@iteration > $maxItems}{break}{/if}
                                    <tr>
                                        {if $shopIsAtLeast52}
                                            <td class="w-100-util" data-id={$wishlistItem->getProductID()}>
                                                {block name='boxes-box-wishlist-dropdown-products-image-title'}
                                                    <div class="form-row align-items-center-util">
                                                        {if $oBox->getShowImages()}
                                                            <div class="col col-auto">
                                                                {block name='boxes-box-wishlist-dropdown-products-image'}
                                                                    <a href="{$wishlistItem->Artikel->cURLFull}" title="{$wishlistItem->getProductName()|unescape:'htmlall'|escape:'html'}">
                                                                        {include file='snippets/image.tpl'
                                                                        item=$wishlistItem->getProduct()
                                                                        square=false
                                                                        srcSize='xs'
                                                                        sizes='24px'}
                                                                    </a>
                                                                {/block}
                                                            </div>
                                                        {/if}
                                                        <div class="col">
                                                            {block name='boxes-box-wishlist-dropdown-products-title'}
                                                                <a href="{$wishlistItem->getProduct()->cURLFull}" title="{$wishlistItem->getProductName()|unescape:'htmlall'|escape:'html'}">
                                                                    {$wishlistItem->getQty()|replace_delim} &times; {$wishlistItem->getProductName()|truncate:40:'...'}
                                                                </a>
                                                            {/block}
                                                        </div>
                                                    </div>
                                                {/block}
                                            </td>
                                            <td class="box-delete-button">
                                                {block name='snippets-wishlist-dropdown-products-remove'}
                                                    <a class="remove"
                                                       href="{$wishlistItem->getURL()}"
                                                       data-name="Wunschliste.remove"
                                                       data-toggle="product-actions"
                                                       data-value="{json_encode(['a' => $wishlistItem->getID()])|escape:'html'}"
                                                       aria-label="{lang section='login' key='wishlistremoveItem'}"
                                                       title="{lang section='login' key='wishlistremoveItem'}"
                                                    >
                                                        <span class="{et_getIcon key="remove"}"></span>
                                                    </a>
                                                {/block}
                                            </td>
                                        {else}
                                            <td class="w-100-util" data-id={$wishlistItem->kArtikel}>
                                                {block name='boxes-box-wishlist-dropdown-products-image-title'}
                                                    <div class="form-row align-items-center-util">
                                                        {if $oBox->getShowImages()}
                                                            <div class="col col-auto">
                                                                {block name='boxes-box-wishlist-dropdown-products-image'}
                                                                    <a href="{$wishlistItem->Artikel->cURLFull}" title="{$wishlistItem->cArtikelName|unescape:'htmlall'|escape:'html'}">
                                                                        {include file='snippets/image.tpl'
                                                                        item=$wishlistItem->Artikel
                                                                        square=false
                                                                        srcSize='xs'
                                                                        sizes='24px'}
                                                                    </a>
                                                                {/block}
                                                            </div>
                                                        {/if}
                                                        <div class="col">
                                                            {block name='boxes-box-wishlist-dropdown-products-title'}
                                                                <a href="{$wishlistItem->Artikel->cURLFull}" title="{$wishlistItem->cArtikelName|unescape:'htmlall'|escape:'html'}">
                                                                    {$wishlistItem->fAnzahl|replace_delim} &times; {$wishlistItem->cArtikelName|truncate:40:'...'}
                                                                </a>
                                                            {/block}
                                                        </div>
                                                    </div>
                                                {/block}
                                            </td>
                                            <td class="box-delete-button">
                                                {block name='snippets-wishlist-dropdown-products-remove'}
                                                    <a class="remove"
                                                       href="{$wishlistItem->cURL}"
                                                       data-name="Wunschliste.remove"
                                                       data-toggle="product-actions"
                                                       data-value="{json_encode(['a' => $wishlistItem->kWunschlistePos])|escape:'html'}"
                                                       aria-label="{lang section='login' key='wishlistremoveItem'}"
                                                       title="{lang section='login' key='wishlistremoveItem'}"
                                                    >
                                                        <span class="{et_getIcon key="remove"}"></span>
                                                    </a>
                                                {/block}
                                            </td>
                                        {/if}
                                    </tr>
                                {/foreach}
                                {/block}
                            </tbody>
                        </table>
                        {block name='boxes-box-wishlist-actions'}
                            <hr class="hr-no-top">
                            {include file="widgets/base/button.tpl" href="{get_static_route id='wunschliste.php'}?wl={$oBox->getWishListID()}" variant="primary" classes="btn-block btn-sm" label="{lang key='goToWishlist'}" title="{lang key='goToWishlist'}"}
                        {/block}
                    </div>
                {/block}
            {/block}
            {block name='boxes-box-wishlist-hr-end'}
                <hr class="box-normal-hr">
            {/block}
        </div>
    {else}
        {block name='boxes-box-wishlist-no-items'}
            <section class="d-none box-wishlist" id="sidebox{$oBox->getID()}"></section>
        {/block}
    {/if}
{/block}
