{block name='productlist-item-slider'}
{if isset($Artikel, $Artikel->kArtikel) && !empty($Artikel->kArtikel)}
    {* Setup Default options *}
    {if !isset($hideManufacturers)}
        {assign var=hideManufacturers value=false}
    {/if}
    {if !isset($hideRatings)}
        {assign var=hideRatings value=false}
    {/if}
    {if !isset($hideAvailability)}
        {assign var=hideAvailability value=false}
    {/if}
    {$lazyLoadImages=$lazyLoadImages|default:true}
    {et_getGlobalSettings assign="etGlobalSettings"}

    {* Image + Ribbon *}
    {block name='productlist-item-slider-link'}
        <a href="{$Artikel->cURLFull}" target="_self">
            <div class="item-slider {if empty($etGlobalSettings.freeAspectRatioImagesEnabled)}square square-image {/if}productbox-image">
                {* Ribbon *}
                {if isset($Artikel->oSuchspecialBild)}
                    {block name='productlist-item-slider-include-ribbon'}
                        {include file='snippets/ribbon.tpl'}
                    {/block}
                {/if}

                {* Image *}
                {block name='productlist-item-slider-link-inner'}
                    <div class="inner">
                        {if isset($Artikel->Bilder[0]->cAltAttribut)}
                            {assign var=alt value=$Artikel->Bilder[0]->cAltAttribut|truncate:60}
                        {else}
                            {assign var=alt value=$Artikel->cName}
                        {/if}

                        {block name='productlist-item-slider-image'}
                            {* Include image, but as the image *might* be used for full width and lazysizes is bad at computing the width of images in sliders, we cannot use auto *}
                            {include file='snippets/image.tpl' item=$Artikel square=false srcSize='md' class='product-image' lazy=$lazyLoadImages}
                        {/block}
                        {if $tplscope !== 'box'}
                            <meta itemprop="image" content="{$Artikel->Bilder[0]->cURLNormal}">
                            <meta itemprop="url" content="{$Artikel->cURLFull}">
                        {/if}
                    </div>
                {/block}
            </div>
        </a>
    {/block}

    {* Slider Caption / Content *}
    {block name='productlist-item-slider-caption'}
        {if empty($noCaptionSlider)}
        <div class="productbox-caption">
            {* Show Manufacturer *}
            {if $Einstellungen.artikeldetails.artikeldetails_hersteller_anzeigen !== 'N' && isset($Artikel->cHersteller) && !$hideManufacturers}
                {block name='productdetails-details-product-info-manufacturer'}
                    <div class="productbox-manufacturer" itemprop="brand" itemscope itemtype="https://schema.org/Brand">
                        <meta itemprop="name" content="{$Artikel->cHersteller|escape:'quotes'}" />
                        <a href="{if !empty($Artikel->cHerstellerHomepage)}{$Artikel->cHerstellerHomepage}{else}{$ShopURL}/{$Artikel->cHerstellerSeo}{/if}"
                            class="link-discreet"
                            {if $Einstellungen.artikeldetails.artikeldetails_hersteller_anzeigen === 'B'}
                                data-toggle="tooltip"
                                data-placement="left"
                                title="{$Artikel->cHersteller}"
                            {/if}
                        itemprop="url"
                        >
                            {* Show Manufacturer Image *}
                            {if ($Einstellungen.artikeldetails.artikeldetails_hersteller_anzeigen === 'B'
                                || $Einstellungen.artikeldetails.artikeldetails_hersteller_anzeigen === 'BT')
                                && !empty($Artikel->cHerstellerBildURLKlein)
                            }
                                {block name='productdetails-details-product-info-manufacturer-image'}
                                    {image lazy=$lazyLoadImages
                                        webp=true
                                        src=$Artikel->cHerstellerBildURLKlein
                                        alt=$Artikel->cHersteller
                                    }
                                    <meta itemprop="logo" content="{$Artikel->cHerstellerBildURLKlein}">
                                {/block}
                            {/if}

                            {* Show Manufacturer Name *}
                            {if $Einstellungen.artikeldetails.artikeldetails_hersteller_anzeigen !== 'B'}
                                {block name='productdetails-details-product-info-manufacturer-name'}
                                    <span>{$Artikel->cHersteller}</span>
                                {/block}
                            {/if}
                        </a>
                    </div>
                {/block}
            {/if}

            {* Show short description and parts-List in case of bundle *}
            {block name='productlist-item-slider-caption-short-desc'}
                <div class="productbox-title">
                    <a href="{$Artikel->cURLFull}" target="_self" class="link-discreet">
                        <span class="item-slider-desc {block name='productlist-item-slider-caption-short-desc-text-clamp-class'}text-clamp-2{/block}">
                            {if isset($showPartsList) && $showPartsList === true && isset($Artikel->fAnzahl_stueckliste)}
                                {block name='productlist-item-slider-caption-bundle'}
                                    {$Artikel->fAnzahl_stueckliste}x
                                {/block}
                            {/if}

                            {block name='productlist-item-slider-caption-short-desc-content'}
                                <span {if $tplscope !== 'box'}itemprop="name"{/if}>{$Artikel->cKurzbezeichnung}</span>
                            {/block}
                        </span>
                    </a>
                </div>
            {/block}

            {* Show Ratings *}
            {if $Einstellungen.bewertung.bewertung_anzeigen === 'Y' && $Artikel->fDurchschnittsBewertung > 0 && !$hideRatings}
                {block name='productlist-item-slider-include-rating'}
                    <small class="item-slider-rating" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
                        <meta itemprop="ratingValue" content="{$Artikel->fDurchschnittsBewertung}"/>
                        <meta itemprop="bestRating" content="5"/>
                        <meta itemprop="worstRating" content="1"/>
                        <meta itemprop="reviewCount" content="{et_getReviewCount article=$Artikel}">
                        {include file='productdetails/rating.tpl' stars=$Artikel->fDurchschnittsBewertung link=$Artikel->cURLFull}
                    </small>
                {/block}
            {/if}

            {* GPSR *}
            {block name='productlist-item-slider-gpsr'}
                {if !empty($etGlobalSettings.gpsrSource) && $etGlobalSettings.gpsrSource !== 'none'}
                    {include file="widgets/snippets/gpsr.tpl" etGlobalSettings=$etGlobalSettings gpsrContext='slider'}
                {/if}
            {/block}

            {* Show Stock Information, ie. availability and delivery time *}
            {if !$hideAvailability}
                {block name='productlist-item-slider-include-stock'}
                    {include file='productdetails/stock.tpl' skipMicrodata=true focusable=false}
                {/block}
            {/if}

            {* Show Price *}
            {block name='productlist-item-slider-include-price'}
                <div class="productbox-price item-slider-price" itemprop="offers" itemscope itemtype="https://schema.org/Offer">
                    <link itemprop="businessFunction" href="http://purl.org/goodrelations/v1#Sell"/>
                    {include file='productdetails/price.tpl' Artikel=$Artikel tplscope=$tplscope}
                    {include file='productdetails/stock_microdata.tpl' Artikel=$Artikel}
                </div>
            {/block}
        </div>
        {/if}
    {/block}
{/if}
{/block}
