I am using simple if condition in email template.
{{depend order.delivery_time=="1"}}Delivery Time: 10am To 2pm
{{/depend}} {{depend order.delivery_time=="2"}}Delivery Time: 2pm To 7pm
{{/depend}} {{depend order.delivery_time=="3"}}Delivery Time: 7pm To 10pm
{{/depend}}
But every time it is printing 1st value i.e. Delivery Time: 10am To 2pm
Can anyone tell me, how to check == in email template?
Best Answer
You cannot use logical expressions in
depend
(unfortunately neither inif
as one comment suggested)From this answer, which covers more details of template directives: https://magento.stackexchange.com/a/121510/243
So the only way I see to achieve what you are trying is to add three variables. For example:
in PHP code (probably best in an
load_after
observer):then in the email template: