Product description: if today you will receive within current date =now' | date: '%A'

Product description: if today you will receive within current date =now' | date: '%A'

G67yf3dvj86cvh7
Shopify Partner
1 0 0

I want my products description to say. 

<html>
<body>
{% assign current_day = 'now' | date: '%A' %}

{% case current_day %}
{% when 'Friday' %}
Free delivery! Monday or Tuesday from Gqeberha. Excluding Tax!
{% when 'Saturday' %}
Free delivery! Monday or Tuesday from Gqeberha. Excluding Tax!
{% when 'Sunday' %}
Free delivery! Monday or Tuesday from Gqeberha. Excluding Tax!
{% when 'Thursday' %}
Free delivery! Friday or Monday from Gqeberha. Excluding Tax!
{% when 'Monday' %}
Free delivery! Tuesday or Wednesday from Gqeberha. Excluding Tax!
{% when 'Tuesday' %}
Free delivery! Wednesday or Thursday from Gqeberha. Excluding Tax!
{% when 'Wednesday' %}
Free delivery! Thursday or Friday from Gqeberha. Excluding Tax!
{% endcase %}
</body>
</html>

But keep on getting the same text of the code in the live view it's embarrassing.

Does anyone know how to get it to work. 

Please help! 

Reply 1 (1)

tim
Shopify Expert
3627 314 1341

Time in Liquid is not precise.
Shopify uses server-side caching to ensure your pages load fast. So it may serve the same cached page for days after it was first rendered.

 

Thing like the one you want should be done with Javascript, but then it's not straight forward too, because JS code would need to account the time difference between you and your visitors...

 

Frankly, wouldn't simple "Free 2 business days delivery" be good enough?

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com