{% sw_extends '@Storefront/storefront/utilities/offcanvas.html.twig' %} {% block utilities_offcanvas_content %} {% block component_review_container %} {% set reviewsPerListPage = config('core.listing.reviewsPerPage') %} {% if reviewsPerListPage <= 0 %} {% set reviewsPerListPage = 10 %} {% endif %} {% set currentListPage = reviews.page %} {% set productReviewCount = reviews.total %} {% set totalReviewCount = reviews.matrix.totalReviewCount %} {% if totalReviewCount > 0 %} {% set productAvgRating = reviews.matrix.averageRating|round(2, 'common') %} {% endif %} {% set totalReviewsInCurrentLanguage = reviews.totalReviewsInCurrentLanguage ?: productReviewCount %} {% set numberOfReviewsNotInCurrentLanguage = productReviewCount - totalReviewsInCurrentLanguage %}
{% block component_review_tab_pane %}
{% block component_review_aside %}
{% block component_review_widget_container %} {% sw_include '@Storefront/storefront/component/review/review-widget.html.twig' %} {% endblock %}
{% endblock %} {% block component_review_main %}
{% block component_review_alert %} {% if ratingSuccess == 1 %} {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: 'success', content: 'detail.reviewFormSuccessAlert'|trans|sw_sanitize } %} {% elseif ratingSuccess == 2 %} {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: 'success', content: 'detail.reviewFormSuccessUpdateAlert'|trans|sw_sanitize } %} {% elseif ratingSuccess == -1 %} {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: 'danger', content: 'detail.reviewFormErrorAlert'|trans|sw_sanitize } %} {% endif %} {% endblock %} {% block component_review_form_container %}
{% if context.customer and not context.customer.guest %}
{% sw_include '@Storefront/storefront/component/review/review-form.html.twig' %}
{% else %} {% endif %}
{% endblock %} {% block component_review_list_container %}
{% block component_review_list %} {% set formAjaxSubmitOptions = { replaceSelectors: ['.js-review-container'], submitOnChange: true } %} {% block component_review_list_actions %} {% block component_review_list_action_filters %}
{% block component_review_list_action_language %}
{% block component_review_list_action_language_form %}
{% if app.request.get('sort') %} {% endif %} {% if app.request.get('points') %} {% for points in app.request.get('points') %} {% endfor %} {% endif %} {% block component_review_list_action_language_switch %}
{% endblock %}
{% endblock %}
{% endblock %} {% block component_review_list_action_sortby %} {% if productReviewCount > 0 %}
{% block component_review_list_action_sortby_form %}
{% if app.request.get('language') %} {% endif %} {% if app.request.get('points') %} {% for points in app.request.get('points') %} {% endfor %} {% endif %} {% block component_review_list_action_sortby_label %} {% endblock %} {% block component_review_list_action_sortby_select %} {% endblock %}
{% endblock %}
{% endif %} {% endblock %}
{% endblock %} {% block component_review_list_counter %}

{% if (productReviewCount > 1 and productReviewCount > reviewsPerListPage) %} {{ currentListPage }} - {{ reviewsPerListPage }} {{ 'detail.reviewCountBefore'|trans|sw_sanitize }} {{ productReviewCount }} {{ 'detail.reviewCountAfter'|trans({'%count%': productReviewCount })|sw_sanitize }} {% elseif productReviewCount > 0 %} {{ productReviewCount }} {{ 'detail.reviewCountAfter'|trans({'%count%': productReviewCount })|sw_sanitize }} {% endif %}

{% endblock %} {% endblock %} {% block component_review_list_content %} {% for review in reviews %}
{% sw_include '@Storefront/storefront/component/review/review-item.html.twig' %}
{% endfor %} {% endblock %} {% block component_review_list_paging %} {% set totalPages = (productReviewCount/reviewsPerListPage)|round(0,'ceil') %} {% if totalPages > 1 %} {% block component_review_list_paging_form %}
{% if app.request.get('language') %} {% endif %} {% if app.request.get('sort') %} {% endif %} {% if app.request.get('points') %} {% for points in app.request.get('points') %} {% endfor %} {% endif %} {% sw_include '@Storefront/storefront/component/pagination.html.twig' with {entities: reviews} %}
{% endblock %} {% endif %} {% endblock %} {% endblock %} {% if productReviewCount <= 0 %} {% block component_review_list_empty %} {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with { type: 'info', content: 'detail.reviewListEmpty'|trans|sw_sanitize } %} {% endblock %} {% endif %}
{% endblock %}
{% endblock %}
{% endblock %}
{% endblock %} {% endblock %}