Answer the question
In order to leave comments, you need to log in
How to display first 3 attributes in opencart 3?
Good day.
I display short attributes from the group in the product card with this code
{% if attribute_groups %}
% for attribute_group in attribute_groups %}
{% if attribute_group.attribute_group_id == 10 %}
{% for attribute in attribute_group.attribute %}
<span>{{ attribute.name }}</span> {{ attribute.text }}<br />
{% endfor %}
% endif %}
{% endfor %}
{% endif %}
Answer the question
In order to leave comments, you need to log in
Resolved the issue. I think it will come in handy, who wants to display short attributes
{% if attribute_groups %}
{% for attribute_group in attribute_groups %}
{% if attribute_group.attribute_group_id == 10 %}
{% for attribute in attribute_group.attribute|slice(0,3) %}
<span>{{ attribute.name }}</span> {{ attribute.text }}<br />
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question