Created
July 22, 2019 17:29
-
-
Save ECkurt/0728eac4ab37fe6d7159d689740cd8ec to your computer and use it in GitHub Desktop.
Estimated Ship Date Calculator for Product Pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>Online Only. Not available in stores.</li> | |
<li>100% Satisfaction Guarantee</li> | |
<li>Shipping starts at just $3.50</li> | |
<li>This design ships | |
{% assign todayDate = 'now' | date: "%w" %} | |
{% if collection.metafields.global.status == 'today' %} | |
{% if todayDate == "0" or todayDate == "6" %} | |
{% comment %} If today is Monday or Sunday, 4 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 345600 | date: "%A, %B %d" }}. | |
{% elsif todayDate == "5" %} | |
{% comment %} If today is Saturday, 5 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 432000 | date: "%A, %B %d" }}. | |
{% else %} | |
{% comment %} If today is Tue/Wed/Thu/Fri, 6 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 518400 | date: "%A, %B %d" }}. | |
{% endif %} | |
{% else %} | |
{% if todayDate == "2" or todayDate == "3" %} | |
{% comment %} If today is Wednesday or Thursday, 2 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 172800 | date: "%A, %B %d" }}. | |
{% elsif todayDate == "0" or todayDate == "1" %} | |
{% comment %} If today is Monday or Tuesday, 3 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 259200 | date: "%A, %B %d" }}. | |
{% else %} | |
{% comment %} If today is Friday or Saturday, 4 days out {% endcomment %} | |
{{'now' | date: "%s" | plus : 345600 | date: "%A, %B %d" }}. | |
{% endif %} | |
{% endif %} | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment