Discount Coupon With A Timer During Checkout?

medjbour

Member
<table style="height: 44px; border-color: #ff7b00; background-color: #ffbf47; margin-left: auto; margin-right: auto;" width="auto">
<tbody>
<tr>
<td>Your order is reserved for <a id="test"></a> minutes!</td>
</tr>
</tbody>
</table>

<script>
setInterval(function () {
var d = new Date();
var seconds = d.getMinutes() * 60 + d.getSeconds(); //convet 00:00 to seconds for easier caculation
var fiveMin = 60 * 9; //five minutes is 300 seconds!
var timeleft = fiveMin - seconds % fiveMin; // let's say 01:30, then current seconds is 90, 90%300 = 90, then 300-90 = 210. That's the time left!
var result = parseInt(timeleft / 60) + ':' + timeleft % 60; //formart seconds into 00:00
document.getElementById('test').innerHTML = result;

}, 500) //calling it every 0.5 second to do a count down
</script>
 

medjbour

Member
this file : /wp-content/themes/michelangelo/tpl/page/alids/cart2/index.php

put after the line (30) (<div class="col-md-43">)


this :
----------------------------------------------------------------------------------------------
<table style="height: 44px; border-color: #ff7b00; background-color: #ffbf47; margin-left: auto; margin-right: auto;" width="auto">
<tbody>
<tr>
<td>&nbsp;&nbsp;Your order is reserved for <a id="test"></a> minutes!&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>

<script>
setInterval(function () {
var d = new Date();
var seconds = d.getMinutes() * 60 + d.getSeconds(); //convet 00:00 to seconds for easier caculation
var fiveMin = 60 * 10; //five minutes is 300 seconds!
var timeleft = fiveMin - seconds % fiveMin; // let's say 01:30, then current seconds is 90, 90%300 = 90, then 300-90 = 210. That's the time left!
var result = parseInt(timeleft / 60) + ':' + timeleft % 60; //formart seconds into 00:00
document.getElementById('test').innerHTML = result;

}, 500) //calling it every 0.5 second to do a count down
</script>

---------------------------------------------------------------------------------------------
 

neeraj89

Active Member
this file : /wp-content/themes/michelangelo/tpl/page/alids/cart2/index.php

put after the line (30) (<div class="col-md-43">)


this :
----------------------------------------------------------------------------------------------
<table style="height: 44px; border-color: #ff7b00; background-color: #ffbf47; margin-left: auto; margin-right: auto;" width="auto">
<tbody>
<tr>
<td>&nbsp;&nbsp;Your order is reserved for <a id="test"></a> minutes!&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>

<script>
setInterval(function () {
var d = new Date();
var seconds = d.getMinutes() * 60 + d.getSeconds(); //convet 00:00 to seconds for easier caculation
var fiveMin = 60 * 10; //five minutes is 300 seconds!
var timeleft = fiveMin - seconds % fiveMin; // let's say 01:30, then current seconds is 90, 90%300 = 90, then 300-90 = 210. That's the time left!
var result = parseInt(timeleft / 60) + ':' + timeleft % 60; //formart seconds into 00:00
document.getElementById('test').innerHTML = result;

}, 500) //calling it every 0.5 second to do a count down
</script>

---------------------------------------------------------------------------------------------
Bro Do we need to update this each and every time once theme updates?
Thanks for your effort to put all codes and making me understand.. :)
 
Top