Всем привет. Стараюсь вывести атрибуты в выбранных категориях, но не могу правильно прописать условие вывода.
Если пишу так, то все отлично выводиться:
{% for attribute_group in product.attribute_groups %}
{% for attribute in attribute_group.attribute %}
{% if attribute.attribute_id in [275, 232, 71, 7, 167, 101, 215, 2, 63, 352, 240, 325, 181, 237, 228, 163, 64, 212] %}
<table class="table table-bordered" style="margin-bottom: 0;">
<tbody>
<tr>
<td style="font-weight: 600;padding: 5px;font-size: 11px;">{{ attribute.name }}</td>
<td style="background: #ff6700;color: #fff;padding: 3px;font-size: 0.8rem;text-align: center;overflow-wrap: break-word;">{{ attribute.text }}</td>
</tr>
</tbody>
</table>
{% endif %}
{% endfor %}
{% endfor %}
Если добавляю условие вывода в нужных категориях - атрибуты не выводятся:
{% for attribute_group in product.attribute_groups %}
{% for attribute in attribute_group.attribute %}
{% if category_id == 66 %}
{% if attribute.attribute_id in [275, 232, 71, 7, 167, 101, 215, 2, 63, 352, 240, 325, 181, 237, 228, 163, 64, 212] %}
<table class="table table-bordered" style="margin-bottom: 0;">
<tbody>
<tr>
<td style="font-weight: 600;padding: 5px;font-size: 11px;">{{ attribute.name }}</td>
<td style="background: #ff6700;color: #fff;padding: 3px;font-size: 0.8rem;text-align: center;overflow-wrap: break-word;">{{ attribute.text }}</td>
</tr>
</tbody>
</table>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
Подскажите, что я делаю не так. Не верное условие для категорий или что-то еще?