Twig-template allows you to customize method's Explanatory Text depending on the presence of supported variable values such as:
- Estimated delivery dates:
- "from" - {delivery_from}
- "to" - {delivery_to}
- Estimated International duties & taxes - {tax_amount}
Allowed tags: if, for.
Filters: default, format_number, replace, round, trim, lower, upper, capitalize, title.
Example 1:
If there are estimated delivery dates configured for the shipping method you may set Explanatory Text with variables:
Estimated delivery from {delivery_from} to {delivery_to}.
If there are no estimated delivery dates configured for the shipping method you may alter Explanatory Text to:
Delivery within 10 business days.
The Twig-template will be the following:
- {% if delivery_from and delivery_to %}
- Estimated delivery from {{delivery_from}} to {delivery_to}.
- {% else %}
- Delivery within 10 business days.
- {% endif %}
Example 2:
If there are estimated international duties & taxes configured for the shipping method you may set Explanatory Text with the variable:
Duties & taxes included - {tax_amount}.
If there are no estimated international duties & taxes got from the carrier for the shipping method you may alter Explanatory Text to:
No duties & taxes included.
The Twig-template will be the following:
- {% if tax_amount %}
- Duties & taxes included - {tax_amount}.
- {% else %}
- No duties & taxes included.
- {% endif %}
You may also combine those variables in a single Twig-template for Explanatory Text:
- {% if delivery_from and delivery_to %}
- Estimated delivery from {delivery_from} to {delivery_to}.
- {% else %}
- Delivery within 10 business days.
- {% endif %}
- {% if tax_amount %}
- Duties & taxes included - {tax_amount}.
- {% else %}
- No duties & taxes included.
- {% endif %}