This is considered “advanced” and is best if you already have the standard discount deadline script running. If you run into problems, leave a comment at the bottom of this page.
[box title=”Requirements” style=”glass”]
2. e-promo-kit in WordPress where you offer the discount deadline
Make sure you have these plugins installed in your WordPress:
Add these two hidden fields to your initial info request form, the page they request info on-not on your e-promo-kit. (you may already have the first one):
[sourcecode language=”plain”]
<input id="ndate" name="ndate" type="hidden" value="" />
<input id="ndate1" name="ndate1" type="hidden" value="" />
[/sourcecode]
Next, add these two lines of code into the “Add extra Javascript” (you may already have the first one)
[sourcecode language=”plain”]
jQuery(document).ready( asNdate() );
jQuery(document).ready( asNdate1() );
[/sourcecode]
See screenshot:

Next, create a new block in CJT and name it something like “Ndate +1” and paste this code in the block:
[sourcecode language=”plain”]
<script type="text/javascript">
function asNdate1() {
var ndate= new Date();
ndate.setDate(ndate.getDate()+2);
var nd1= ndate.getMonth()+ 1;
var nd2= ndate.getDate();
var nd3= ndate.getFullYear();
document.getElementById(‘ndate1’).value= nd1 + ‘/’ + nd2 + ‘/’ + nd3;
}
</script>
[/sourcecode]
Apply it to the page containing the initial form. See screenshot:

You should already have the normal discount deadline script setup but if you don’t, here it is:
[sourcecode language=”plain”]
<script type="text/javascript">
function asNdate() {
var ndate= new Date();
ndate.setDate(ndate.getDate()+1);
var nd1= ndate.getMonth()+ 1;
var nd2= ndate.getDate();
var nd3= ndate.getFullYear();
document.getElementById(‘ndate’).value= nd1 + ‘/’ + nd2 + ‘/’ + nd3;
}
</script>
[/sourcecode]
Here is the shortcode to insert on your e-promo-kit to make the count down work:
[as_countdown field=”ndate1″ timezone=”-6″ style=”dark”]
Style can be “dark”, “light” or “red”
ndate (you may already have this)
ndate1
In the autoresponder hyperlink that you send the subscriber, you’ll need both variables merged in by 1shop and set. So in addition to your normal link, you’ll need to add:
&ndate1=%$custom:ndate1$%
Notice how I have both ndate and ndate1. This is because on the e-promo-kit page, we want to say that the deal ends on January 1st. But we want the countdown timer to countdown until January 2nd (when the deal ends). So the date is displayed with “ndate” but for the countdown timer to end at the end of the “ndate” we need to add 1 as it counts down until the date. So we have it countdown to January 2nd. Make sense?
Mr Farr… you just gave me a headache. 🙂
So this doesn’t work with the new forms? That’s a bummer.
I will try setting this up when the replay is out.
Thanks for posting the instructions and screen shots. They are very helpful even when going along with the replays.
Franc Karpo
Yes at this time, it only works with the old forms.
Actually Franc, I was able to get this to work with new forms!