Hi Guys
I am no coding expert, but I am trying to add some code that will allow me to add ‘Estimated Delivery’ under my ATC button (using the Impulse theme). The code works fine and appears under my ATC, but I want the delivery time to always stay between 1-3 days (depending on what shipping they choose when they checkout). I borrowed the code from someone who seems to have added code that always shows delivery estimates between 20/11 and 29/11 (this date reference is at the end of the HTML code). It’s driving me nuts working out what I need to change!
I am sure this is a very simple fix for someone with coding expertise so thank you so much if you can help. The code I am using (and having trouble with) is the JS and HTML codes below:
(function() {
// estimate the delivery date
if(document.getElementById(‘fromDate’)) {
var dateStart = 6;
var dateEnd = 12;
var fromDate = Date.today().addDays(dateStart);
if (fromDate.is().saturday() || fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}
var toDate = Date.today().addDays(dateEnd);
if (toDate.is().saturday() || toDate.is().sunday()) {
toDate = toDate.next().monday();
}
document.getElementById(‘fromDate’).innerHTML = fromDate.toString(‘dd/MM’);
document.getElementById(‘toDate’).innerHTML = toDate.toString(‘dd/MM’);
}
})();
and…
Easy returns under 30 days
Gift Wrapped online
Delivery estimated within 20/11 and 29/11
Cheers
Sarah