{% set product = hookable_metadata.context.resource %}
{{ 'sylius.ui.attributes'|trans }}
{% set set_locale_codes = [] %} {% if product.attributes|length == 0 %} {{ 'sylius.ui.there_are_no_attributes_configured'|trans }} {% else %} {% for attribute in product.attributes %} {% if attribute.localeCode not in set_locale_codes %} {% set locale_code = attribute.localeCode %}

{% if locale_code %} {% hook 'attributes#head' with { locale_code, loop } %} {% else %} {% hook 'attributes#head' with { loop } %} {% endif %}

{% if locale_code %}
{% hook 'attributes#body' with { 'attributes': product.attributes, locale_code } %}
{% else %}
{% hook 'attributes#body' with { 'attributes': product.attributes } %}
{% endif %}
{% set set_locale_codes = set_locale_codes|merge([locale_code]) %} {% endif %} {% endfor %} {% endif %}