Answer the question
In order to leave comments, you need to log in
How to display text by condition in a date range?
Hello!
It is required to set up sending emails on events, with different texts depending on the type of delivery and the time of the order in the online store.
The service on which I set up letters support twig template engine.
There was a task that I could neither google nor understand on my own, since I am not familiar with programming languages.
It is required to change the text in the letter depending on the time of the order.
During working hours from 8 to 17 - one text
In other cases - another
{% if order.createdAt|period|number(date('%H:%i', 'Europe/Moscow')) --- ??? %}
<p>Заказ в рабочее время</p>
{% else %}
<p>Заказ в нерабочее время</p>
{% endif %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question