{block name='productdetails-popups'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {assign var=kArtikel value=$Artikel->kArtikel}
    {if $Artikel->kArtikelVariKombi > 0}
        {assign var=kArtikel value=$Artikel->kArtikelVariKombi}
    {/if}
    {$lazyLoadImages=$lazyLoadImages|default:true}

    {if $verfuegbarkeitsBenachrichtigung !== 0}
        {block name="productdetails-popups-include-availability"}
            <div class="modal" tabindex="-1" id="availability-popup-{$kArtikel}" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title">{lang key='notifyMeWhenProductAvailableAgain'}</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="{if $shopIsAtLeast55}{lang key="close" section="aria"}{else}Close{/if}">
                                <i class="{et_getIcon key="close"}"></i>
                            </button>
                        </div>
                        <div class="modal-body">
                            {include file='productdetails/availability_notification_form.tpl' position='popup' tplscope='artikeldetails'}
                        </div>
                    </div>
                </div>
            </div>
        {/block}
    {/if}

    {if $Einstellungen.artikeldetails.artikeldetails_fragezumprodukt_anzeigen === 'P'}
        {block name='productdetails-popups-include-question-on-item'}
            <div class="modal" tabindex="-1" id="question-popup-{$kArtikel}" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title">{lang key='productQuestion' section='productDetails'}</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="{if $shopIsAtLeast55}{lang key="close" section="aria"}{else}Close{/if}">
                                <i class="{et_getIcon key="close"}"></i>
                            </button>
                        </div>
                        <div class="modal-body">
                            {include file='productdetails/question_on_item.tpl' position='popup'}
                        </div>
                    </div>
                </div>
            </div>
        {/block}
    {/if}

    {if isset($bWarenkorbHinzugefuegt) && $bWarenkorbHinzugefuegt}
        {et_getGlobalSettings assign="et360GlobalSettings"}
        {if $et360GlobalSettings.pushToBasketAction === 'showPushedSuccess' || $et360GlobalSettings.pushToBasketAction === 'both'}
            {if !isset($kArtikel)}
                {assign var=kArtikel value=$Artikel->kArtikel}
                {if $Artikel->kArtikelVariKombi > 0}
                    {assign var=kArtikel value=$Artikel->kArtikelVariKombi}
                {/if}
            {/if}
            {block name='productdetails-popups-include-pushed'}
                <div id="popupa{$kArtikel}" class="product-popup">
                    {include file='productdetails/pushed.tpl' oArtikel=$Artikel fAnzahl=$bWarenkorbAnzahl lazyLoadImages=$lazyLoadImages}
                </div>
            {/block}
        {/if}
    {/if}
    {block name='productdetails-popups-script'}
        {inline_script}<script>
            $(function() {
                {if isset($fehlendeAngaben_benachrichtigung) && count($fehlendeAngaben_benachrichtigung) > 0 && ($verfuegbarkeitsBenachrichtigung == 2 || $verfuegbarkeitsBenachrichtigung == 3)}
                    show_popup('n{$kArtikel}', '{lang key='requestNotification' addslashes=true}');
                {/if}

                {if isset($fehlendeAngaben_fragezumprodukt) && count($fehlendeAngaben_fragezumprodukt) > 0 && $Einstellungen.artikeldetails.artikeldetails_fragezumprodukt_anzeigen === 'P'}
                    $('#question-popup-{$kArtikel}').modal('show');
                {/if}
            });

            function show_popup(item, title) {
                var html = $('#popup' + item).html();
                if (typeof title === 'undefined' || title.length === 0) {
                    title = $(html).find('h3').text();
                }
                eModal.alert({
                    message: html,
                    title: title
                });
            }
        </script>{/inline_script}
    {/block}
{/block}
