Filter Description
abs Getting the absolute value of number
avatar_url Returns URL of user's photo (User type) or customer (Customer type)
If the photo is not specified or the object has different type, an empty string will be returned.
batch Conversion of list to the two-dimensional list with equal elements quantity
capitalize Getting string, first letter of which is converted to uppercase
date Conversion of date to string in the specified format
Examples
order.createdAt|date("Y-m-d") # Order creation date in format dd.mm.yyyy
"now"|date("Y-m-d H:i") # Current date in format dd.mm.yyyy hh:mm
date_modify Date changing (for example, increasing on one day)
default Returns transmitted value in case, if the variable is not defined or empty
escape Displaying of symbols in the specified format
first Getting the first element in array
format Replaces the symbols %s in string with transmitted values
join Generates the string from the array by combining array elements and adding a separator between them
json_encode Creates JSON from the variable
keys Returns array keys
last Getting the last element in array
length Getting the length of array or string
lower Conversion of all string symbols to lowercase
merge Merging of array and another array
nl2br Replaces the line breaks with html-tag <br>
number_format Formatting of number
raw Getting the value as is (without displaying)
replace Replaces some substings with other
reverse Inverts the values ordering in array or symbols in the string
round Rounds a number to a given precision
slice The array slice in specified frame
sort The array sorting
split Splits the string by substrings using transmitted separator
striptags Removing of html-tags
title Getting the string, each word of which begins with the capital letter
trim Removing of space symbols (or another) from the beginning and the end of string
upper Changes all string symbols to uppercase
url_encode Encodes a given string as URL segment
ru_currency Converts number to currency format
Examples
{{ 12345.12|ru_currency }} # 12 345,12 rub.
{{ 5235.00|ru_currency('number') }} # 5 235
{{ 5235.00|ru_currency('number', false) }} # 5 235,00 - Displays the sum without removing zeros in kopeks
{{ 12345.12|ru_currency('words') }} # Twelve thousand three hundred forty-five rubles 12 kopeks
{{ order.totalSumm|ru_currency }} # Displays the order sum in currency format like 12 345,12 rub.
{% set sum = order.totalSumm|ru_currency('parted') %} # Returns array of two elements. Element with the key 'integer' contains the whole part of the sum, element 'fractional' contains the fractional part
custom_field Displays value of the specified order custom field or customer custom field
Examples
{{ order|custom_field('transaction_id') }} # Displays the value of order custom field with code "transaction_id"
{{ customer|custom_field('birthday') }} # Displays the value of customer custom field with code "birthday"
international_phone Converts strings to telephone format with symbol + and international code in the beginning with removing of unnecessary symbols
Example
{{ "8 (926) 123-45-67"|international_phone }} # displays +79261234567
{{ "(926) 123-45-67"|international_phone }} # displays +79261234567
{{ "7926123-45-67"|international_phone }} # displays +79261234567
{{ "044 123 45 67"|international_phone('UA') }} # displays +380441234567
{{ order.phone|international_phone }}
price Converts number to currency format, substituting the currency symbol.
Filter parameters:
classes - the class, which will be added to the block with currency symbol
code - the currency code; if not specified, the default currency is used
stripZero - if false, there will be displayed zeros in kopeks
price_range Converts the range of numbers to currency format, substituting the currency symbol
numeric_declension Displays the word in the desired declension in accordance with the number (actual only for russian version)
Examples
{{ 1|numeric_declension("bag/s") }} # 1 bag
{{ 2|numeric_declension("bag/s") }} # 2 bags
{{ 15|numeric_declension("bag/s") }} # 15 bags
{{ 15|numeric_declension("bag/s", false) }} # bags
number_to_words Displays the number by words
Example
{{ 12345.12|number_to_words }} # Twelve thousand three hundred forty-five
buying_with Returns the recommended trading offers (Offer) of series "Usually purchased with this item". Allows to get up to 30 trading offers (6 by default).
Examples
# Gets and displays the names of 10 recommended offers for items in order
{% for item in order|buying_with(10) %}
  {{ item.name }}
{% endfor %}

# Gets and displays the names of 6 recommended offers for the first item in order
{% for item in order.orderProducts|first|buying_with %}
  {{ item.name }}
{% endfor %}
It is possible to transmit the name of recomendation service as the second parameter
If the parameter is not specified, default service can be used, which displays recommendations based on data of the system.
Example
# Gets 3 recommended offers from RetailRocket service and displays their names
{% for item in order|buying_with(3, 'retailrocket') %}
  {{ item.name }}
{% endfor %}
analogs Returns trading offers (Offer) of series "Analogues". Allows to get up to 30 trading offers (6 by default).
Examples
# Gets and displays the names of 3 offers-analogues for items in order
{% for item in order|analogs(3) %}
  {{ item.name }}
{% endfor %} # Gets and displays the names of 6 offers-analogues for the first item in order {% for item in order.orderProducts|first|analogs %} {{ item.name }} {% endfor %}
It is possible to transmit the name of recomendation service as the second parameter
If the parameter is not specified, default service can be used, which displays recommendations based on data of the system.
Example
# Gets 3 offers-analogues from RetailRocket service and displays their names
{% for item in order|analogs(3, 'retailrocket') %}
  {{ item.name }}
{% endfor %}
accompanying DEPRECATED Use buying_with(3, 'retailrocket') instead
recommendations Returns recommended trade offers (Offer) from the series specified by the first parameter. Allows to get up to 30 trade offers (6 by default).
Examples
# We get and display the name of 6 recommended trade offers from the "upsell" series for products in the order
{% for item in order|recommendations('upsell') %}
  {{ item.name }}
{% endfor %}

# We get and display the name of 6 recommended trade offers from the "analogs" series for the first product in the order
{% for item in order.orderProducts|first|recommendations('analogs') %}
  {{ item.name }}
{% endfor %}
The number of trade offers can be passed by the second parameter.
Examples
# We get 10 recommended trade offers from the "upsell" series and display their names
{% for item in order|recommendations('upsell', 10) %}
  {{ item.name }}
{% endfor %}
quantity Formats quantity according to system settings (integer/fractional)
offer_properties Returns array of trading offer properties
array(
  code => array(
    name  =>
    code  =>
    value =>
  )
)

{% for prop in offer|offer_properties %}
  {{ prop.code }} - {{ prop.name }} - {{ prop.value }}
{% endfor %}
contains If the items array is transmitted by parameter, then function checks that the order contains at least one of them.
If the sections array is transmitted by parameter, then function checks that the order contains items of the specified sections.
Example
{% set orderContainsProducts = order|contains(products) %}
looked If item(s) is transmitted as the parameter, the function checks that the customer has viewed any of the specified items.
If item section(s) is transmitted as the parameter, the function checks that the customer has viewed any items in the specified sections.
Example
{% set isLookedProducts = customer|looked(products) %}
looked_products_count Function returns the quantity of items viewed by customer
Example
{% set lookedCount = customer|looked_products_count %}
country Returns country name by ISO code (ISO 3166-1 alpha-2)
Examples
{{ 'RU'|country }} # Russia
{{ order.deliveryAddress.country|country }} # Country name from the order address
local_time Returns local time by phone number, customer address or delivery address
Example
{{ '+375 152 74-07-80'|local_time|date('H:i:s') }} # 15:53:23
{{ order.getDeliveryAddress|local_time|date('H:i:s') }}
{{ order.customer.getAddress|local_time|date('H:i:s') }}
{{ order.getPhone|local_time|date('H:i:s') }}
{{ order.getAnyPhone|local_time|date('H:i:s') }}
{{ order.customer.getAnyPhone|local_time|date('H:i:s') }}
file_url Returns URL of attachment (type Attachment) or file (type File)
Example
{% for attachment in order.attachments %}
  <a href="{{ attachment|file_url }}">{{ attachment.file.originalName }}</a>
{% endfor %}
qr_code_url Returns the URL of the QR code of the specified size (in pixels) for a string
Example
<img src="{{ '123'|qr_code_url }}">
<img src="{{ '123'|qr_code_url(200) }}">