Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% if cart.item_count > 0 %}
- <div class="section-header text-center">
- <h1>{{ 'cart.general.title' | t }}</h1>
- <div id="scarcity" style="text-align:center;background:#fff5d2;border:1px solid #e3df74;font-size:15px;color:#2c2c2c;padding:10px 20px;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; margin:20px 0px">Nur wenige Artikel verfügbar. Dein Einkaufswagen ist für die nächsten 4:59 minutes reserviert.</div>
- <script type="text/javascript">
- var scarcity = document.getElementById('scarcity');
- var countDownDate = new Date();
- countDownDate.setMinutes(countDownDate.getMinutes() + 3);
- var x = setInterval(function() {
- var now = new Date().getTime();
- var distance = countDownDate - now;
- var days = Math.floor(distance / (1000 * 60 * 60 * 24));
- var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
- scarcity.innerHTML = "<b>Nur noch 2 verfügbar</b>. Dein Warenkorb wird für die nächsten <b>" + minutes + ":" + seconds + " Minuten</b> reserviert.";
- if (distance <= 0)
- clearInterval(x);
- }, 1);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement