function goBack(){if (document.referrer.indexOf(window.location.host) !== -1) {history.go(-1); return false;}}; function runAfterElementExists(jquery_selector,callback){var checker = window.setInterval(function() {if ($(jquery_selector).length) {clearInterval(checker);callback();}}, 200);} document.addEventListener('DOMContentLoaded', function() { if (document.referrer.indexOf(window.location.host) !== -1) {$('.goBackLink').removeClass('d-none');} function calculateNewPrice() { var currentPrice = 11.99; var NewQuantity = $(".qty-input").val().replace(/,/, "."); NewPrice = (currentPrice * NewQuantity).toFixed(2); NewPriceText = NewPrice.toString().replace(/\./g, ','); $(".price>span").html(NewPriceText+' €'); $(".articleQuantity").html("Preis gültig für "+ NewQuantity +" Artikel"); var oldUVP=14.95; var NewOldPrice = (oldUVP * NewQuantity).toFixed(2); NewOldPriceText = NewOldPrice.toString().replace(/\./g, ','); $(".priceRrp>span").html(NewOldPriceText+' €'); var percent=(NewOldPrice-NewPrice)/NewOldPrice*100; var percentRound = Math.round(percent); $(".savingPercentTarget").html("
-"+percentRound+"%
"); }; runAfterElementExists(".qty-btn-container", function() { $('.qty-btn-container button.qty-btn').click(function() {calculateNewPrice();});$('.qty-box .qty-input').on('input propertychange paste', function() {calculateNewPrice();});}); function calculatePercent() { if ($('.priceRrp>.Price').length > 0){ $(".savingPercentTarget").removeClass("hidden"); $('.priceRow .price').addClass("salePrice"); var oldUVP=14.95; var currentPrice = 11.99; var percent=(oldUVP-currentPrice)/oldUVP*100; var percentRound = Math.round(percent); $(".savingPercentTarget").html("
-"+percentRound+"%
"); };}; calculatePercent(); let sel = document.querySelectorAll('.variation-select select');sel.forEach(function() {this.addEventListener ("change", function () {setTimeout(function(){ calculatePercent(); }, 400);$('.availabilityWrapper').removeClass("opacity_0"); });if($("select.custom-select option:selected").text().indexOf('Bitte') >= 0) {$('.availabilityWrapper').addClass("opacity_0");};});});
Kundenrezensionen


Rezensionen werden geladen...