Neu Popup "Artikel hinzugefügt" ausschalten

Status
Es sind keine weiteren Antworten möglich.

Der_Bob

Gut bekanntes Mitglied
10. August 2007
222
9
Servus,

Ich bin mir eigentlich sicher, dass es die Einstellmöglichkeit geben muss, aber ich find' sie nicht. Wie schalt ich das Pop-up "Die ausgewählten Artikel wurden in den Warenkorb gelegt" aus ohne Änderung am Code?

Viele Grüße,
Marcus
 

Der_Bob

Gut bekanntes Mitglied
10. August 2007
222
9
Danke für die schnelle Hilfe!
Mit Einbinden der JS aus dem Link hat's direkt geklappt. Nach Entfernung jeglicher Rückmeldung beim In-den-Warenkorb-Legen scheint aber intuitiv doch irgendwas zu fehlen. Vielleicht einfach nur Gewohnheit, aber irgendein Ersatz-feedback muss da wohl her.
Das Thema hier ist aber dann geschlossen, vielen Dank!
 

FPrüfer

Moderator
Mitarbeiter
19. Februar 2016
1.881
529
Halle
Vielleicht einfach nur Gewohnheit, aber irgendein Ersatz-feedback muss da wohl her.
Wie wäre es dann mit einer Snackbar!? Inspiriert von http://www.w3schools.com/howto/howto_js_snackbar.asp und mit der Funktion aus https://forum.jtl-software.de/threads/io-php-warenkorb-modal-window-abschalten.91530/#post-521008 könnte das dann so aussehen:

custom.css
CSS:
#snackbar {
  visibility: hidden;
  min-width: 250px;
  margin-left: -125px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 2px;
  padding: 16px;
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 30px;
}

#snackbar.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

custom.js
JavaScript:
(function($) {
    $.evo.myBasket = function() {
        var basket = $.evo.basket();

        basket.pushedToBasket = function(response) {
            var $snackbar = $('#snackbar');
            if ($snackbar.length == 0) {
                $snackbar = $('<div id="snackbar"></div>');
                $('#main-wrapper').append($snackbar);
            }
            $snackbar
                .html(response.cNotification)
                .addClass('show');

            setTimeou t(function(){
                $snackbar.removeClass('show');
            }, 3000);
        };

        return basket;
    };

    // Dies gilt für die Version 4.04
    // ##############################
    $('*[data-toggle="basket-add"]').off('submit');
    $('*[data-toggle="basket-add"]').on('submit', function(event) {
        event.preventDefault();
        $.evo.myBasket().addToBasket($(this));
    });

    // Für Version ab 4.05
    // ###################
    $('#main-wrapper').off('submit', '[data-toggle="basket-add"]');
    $('#main-wrapper').on('submit', '[data-toggle="basket-add"]', function(event) {
        event.preventDefault();
        $.evo.myBasket().addToBasket($(this));
    })
})(jQuery);

P.S.: Bitte beim Übertragen das "setTimeou t" zusammmen als "setTimeout" schreiben! Für die Forensoftware ist das offensichtlich geblacklistet.
 
Zuletzt bearbeitet:
Status
Es sind keine weiteren Antworten möglich.

Ähnliche Themen