Skip to content

Product Twig functions

ibexa_get_product

The ibexa_get_product() filter gets the selected product based on either a product object or a Content item object that contains a product.

Examples

1
2
{{ (product|ibexa_get_product).code }}
{{ (content|ibexa_get_product).code }}

ibexa_format_product_attribute

The ibexa_format_product_attribute filter formats the attribute value to a readable, translated form.

Examples

1
2
3
{% for attribute in product.attributes %}
    {{ attribute|ibexa_format_product_attribute }}
{% endfor %}

ibexa_product

ibexa_product enables you to check whether the provided object is a product.

Examples

1
{$ if content is ibexa_product %}