{if $tnt_coupons_active === "Y" && $tnt_coupons_sale_active == 1}
    {block name='basket-cart-dropdown-cart-item-total'}
        <li class="font-weight-bold-util">
            {if empty($smarty.session.Versandart)}
                {lang key='subtotal' section='account data'}
            {else}
                {lang key='totalSum'}
            {/if}: <span class="cart-dropdown-total-item-price" id="tnt_coupons_total_basket_value"
                         data-plugin_total="{$tnt_coupons_missing_amount}">{$WarensummeLocalized[0]}</span>
        </li>
    {/block}
    {block name='basket-cart-dropdown-cart-items-content' prepend}
        <script type="text/javascript">
            function modifyProgress() {
                var progressBar = $("#tnt_coupons_basket_progress .progress-bar");
                //var n_val = $("#tnt_coupons_total_basket_value").html();
                //n_val = n_val.replace(/[^0-9\,]/g, "");
                //n_val = n_val.replace(",", ".");
                var n_val = $("#tnt_coupons_total_basket_value").data("plugin_total");
                if (parseFloat(n_val) > parseFloat("{$tnt_coupons_basket_max}")) {
                    $("#tnt_coupons_congratulation").removeClass("d-none");
                } else {
                    $("#tnt_coupons_still_missing").removeClass("d-none");
                }

                var percent = (parseFloat(n_val) * 100) / parseFloat(progressBar.attr('aria-valuemax'));
                if (percent > 100) percent = 100;
                n_val = n_val.toFixed(2);
                progressBar.attr('aria-valuenow', n_val).css('width', percent + '%').html(n_val + " {$tnt_coupons_currency_symbol}");
            }
        </script>
        <div class="d-none px-2 text-center row align-items-center mt-0" id="tnt_coupons_congratulation">
            <div class="col-auto">
                <div class="feature-icon bg-primary bg-gradient">
                    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="currentColor"
                         class="bi bi-trophy" viewBox="0 0 16 16">
                        <path d="M2.5.5A.5.5 0 0 1 3 0h10a.5.5 0 0 1 .5.5c0 .538-.012 1.05-.034 1.536a3 3 0 1 1-1.133 5.89c-.79 1.865-1.878 2.777-2.833 3.011v2.173l1.425.356c.194.048.377.135.537.255L13.3 15.1a.5.5 0 0 1-.3.9H3a.5.5 0 0 1-.3-.9l1.838-1.379c.16-.12.343-.207.537-.255L6.5 13.11v-2.173c-.955-.234-2.043-1.146-2.833-3.012a3 3 0 1 1-1.132-5.89A33.076 33.076 0 0 1 2.5.5zm.099 2.54a2 2 0 0 0 .72 3.935c-.333-1.05-.588-2.346-.72-3.935zm10.083 3.935a2 2 0 0 0 .72-3.935c-.133 1.59-.388 2.885-.72 3.935zM3.504 1c.007.517.026 1.006.056 1.469.13 2.028.457 3.546.87 4.667C5.294 9.48 6.484 10 7 10a.5.5 0 0 1 .5.5v2.61a1 1 0 0 1-.757.97l-1.426.356a.5.5 0 0 0-.179.085L4.5 15h7l-.638-.479a.501.501 0 0 0-.18-.085l-1.425-.356a1 1 0 0 1-.757-.97V10.5A.5.5 0 0 1 9 10c.516 0 1.706-.52 2.57-2.864.413-1.12.74-2.64.87-4.667.03-.463.049-.952.056-1.469H3.504z"/>
                    </svg>
                </div>
            </div>
            <div class="col">
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
                     class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
                </svg>
                <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor"
                     class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
                </svg>
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
                     class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
                </svg>
                <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor"
                     class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
                </svg>
                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
                     class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
                </svg>
                <p class="lead mb-0">{$tnt_coupons_lang_var_congratulation}</p>
            </div>
        </div>
        <div class="d-none px-2 text-center row align-items-center mt-0" id="tnt_coupons_still_missing">
            <div class="col-auto">
                <div class="feature-icon bg-primary bg-gradient">
                    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" fill="currentColor"
                         class="bi bi-percent" viewBox="0 0 16 16">
                        <path d="M13.442 2.558a.625.625 0 0 1 0 .884l-10 10a.625.625 0 1 1-.884-.884l10-10a.625.625 0 0 1 .884 0zM4.5 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm7 6a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/>
                    </svg>
                </div>
            </div>
            <div class="col">
                <p class="lead mb-0">{$tnt_coupons_lang_var_still_missing}</p>
            </div>
        </div>
        <div class="progress my-3 {$tnt_coupons_basket_display}" id="tnt_coupons_basket_progress">
            <div class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0"
                 aria-valuemax="{$tnt_coupons_basket_max}"></div>
        </div>
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", function (e) {
                var is_correct_io = false;
                var send = window.XMLHttpRequest.prototype.send, onReadyStateChange;

                function sendReplacement(data) {
                    var tmp = decodeURIComponent(data);
                    if (tmp.substring(0, 3) == "io=") {
                        tmp = JSON.parse(tmp.substring(3));
                        if (tmp.name == "pushToBasket") {
                            is_correct_io = true;
                        } else {
                            is_correct_io = false;
                        }
                    }
                    if (this.onreadystatechange) {
                        this._onreadystatechange = this.onreadystatechange;
                    }
                    this.onreadystatechange = onReadyStateChangeReplacement;
                    return send.apply(this, arguments);
                }

                function onReadyStateChangeReplacement() {
                    if (this.readyState == 4) {
                        window.setTimeout(function () {
                            modifyProgress();//need delay because content is still not ready at this point
                        }, 1000);
                    }
                    if (this._onreadystatechange) {
                        return this._onreadystatechange.apply(this, arguments);
                    }
                }

                window.XMLHttpRequest.prototype.send = sendReplacement;

                $(function () {
                    modifyProgress();
                });
            });
        </script>
    {/block}
    {block name='basket-cart-dropdown-hint-empty' prepend}
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", function (e) {
                var is_correct_io = false;
                var send = window.XMLHttpRequest.prototype.send, onReadyStateChange;

                function sendReplacement(data) {
                    var tmp = decodeURIComponent(data);
                    if (tmp.substring(0, 3) == "io=") {
                        tmp = JSON.parse(tmp.substring(3));
                        if (tmp.name == "pushToBasket") {
                            is_correct_io = true;
                        } else {
                            is_correct_io = false;
                        }
                    }
                    if (this.onreadystatechange) {
                        this._onreadystatechange = this.onreadystatechange;
                    }
                    this.onreadystatechange = onReadyStateChangeReplacement;
                    return send.apply(this, arguments);
                }

                function onReadyStateChangeReplacement() {
                    if (typeof this.response !== 'undefined') {
                        var obj;
                        try {
                            obj = JSON.parse(this.response);
                        } catch (e) {
                            //console.log(e);
                        }
                        if (typeof obj !== 'undefined') {
                            if (typeof obj["varAssigns"] !== 'undefined') {
                                if (typeof obj["varAssigns"][0] !== 'undefined') {
                                    if (typeof obj["varAssigns"][0]["value"] !== 'undefined') {
                                        if (typeof obj["varAssigns"][0]["value"]["nType"] !== 'undefined') {
                                            if (obj["varAssigns"].length > 0) {
                                                if (obj["varAssigns"][0]["value"]["nType"] == 2) {
                                                    if (this.readyState == 4) {
                                                        window.setTimeout(function () {
                                                            modifyProgress();//need delay because content is still not ready at this point
                                                        }, 1000);
                                                    }
                                                    if (this._onreadystatechange) {
                                                        return this._onreadystatechange.apply(this, arguments);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                window.XMLHttpRequest.prototype.send = sendReplacement;
            });
        </script>
    {/block}
{/if}