Liquid, JavaScript, themes, sales channels
Hi guys,
I have a script for showing when product will be dispatched:
{{ '//cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js' | script_tag }}
<script>
var fromDate = Date.today().addDays(1);
if (fromDate.is().saturday() || fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}
var toDate = Date.today().addDays(3);
if (toDate.is().saturday() || toDate.is().sunday())
toDate = toDate.next().monday();
document.getElementById('fromDate').innerHTML = fromDate.toString('dddd MMMM dS');
document.getElementById('toDate').innerHTML = toDate.toString('dddd MMMM dS');
</script>
It needs to be only shown, if product.description does not contain :
"BUY NOW TO PRE-ORDER!" words. As we have some products in stock and pre-order.
Can anyone help how to change this script properly?
Thanks
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024