{% sw_extends '@Storefront/storefront/page/product-detail/tabs.html.twig' %}
{# On tab information #}
{% set displayValue = "0" %}
{% set attachments = page.product.KsAttachments.attachments %}
{% set attachmentsDisplay = [] %}
{% for attachment in attachments %}
{% if attachment.display !== null %}
{% set displayAttachment = attachment.display|split(',') %}
{% for key, value in displayAttachment %}
{% if displayValue == value %}
{% set attachmentsDisplay = attachmentsDisplay|merge([attachment]) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% block page_product_detail_tabs_navigation_review %}
{{ parent() }}
{% block page_product_detail_tabs_navigation_attachments %}
{% if config('KsAttachments.config.enableField') and attachmentsDisplay|length %}
<li class="nav-item">
<a class="nav-link {% if (ratingSuccess == 1) or (ratingSuccess == -1) %}active{% endif %} product-detail-tab-navigation-link"
id="attachments-tab"
data-toggle="tab"
data-offcanvas-tabs="true"
href="#attachments-tab-pane"
role="tab"
aria-controls="attachments-tab-pane"
aria-selected="true">
<span>{{"ks-attachments-snp.attachments.detail.attachmentsLabel"|trans|sw_sanitize }}</span>
</a>
</li>
{% endif %}
{% endblock %}
{% endblock %}
{% block page_product_detail_tabs_content_review %}
{{ parent() }}
{% block page_product_detail_tabs_content_attachments %}
{% if config('KsAttachments.config.enableField') %}
<div class="tab-pane fade show {% if (ratingSuccess == 1) or (ratingSuccess == -1) %}active{% endif %}"
id="attachments-tab-pane"
role="tabpanel"
aria-labelledby="attachments-tab">
{% block page_product_detail_ordernumber_label_attachments %}
{% if attachmentsDisplay|length %}
{% sw_include '@Storefront/storefront/component/ks-attachments-list.html.twig' with {
attachmentsDisplay: attachmentsDisplay,
displayOn: displayValue,
} %}
{% endif %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% endblock %}