}
document.addEventListener('DOMContentLoaded', function() { var oldUVP=$('.singleRightSide .crossprice>del').text().replace(/,/,".").replace(/€/," "); var currentPrice = $('.singleRightSide .price>span:first-child').text().replace(/,/,".").replace(/€/," "); var oldUVP=oldUVP.replace(/[^0-9\.]+/g,""); var currentPrice = currentPrice.replace(/[^0-9\.]+/g,""); function calculatePercent() { var percent = (oldUVP-currentPrice)/oldUVP*100; var percentRound = Math.round(percent); $(".saving_p").html("-"+percentRound+"%"); currentSaving=oldUVP-currentPrice,currentSaving=currentSaving.toFixed(2).replace(/\./,","), $("#saving_eur").html(currentSaving+" €") }; setTimeout(function(){ calculatePercent(); }, 700); });
Alle Preise inkl. MwSt., zzgl. Versandkosten
<