vendor/shopware/storefront/Resources/views/storefront/page/product-detail/review/review-widget.html.twig line 1

Open in your IDE?
  1. {% block page_product_detail_review_widget %}
  2.     <div class="sticky-top product-detail-review-widget">
  3.         {% block page_product_detail_review_info_container %}
  4.             {% block page_product_detail_review_info %}
  5.                 <div class="product-detail-review-info js-review-info">
  6.                     {% block page_product_detail_review_title %}
  7.                         <p class="product-detail-review-title h5">
  8.                             {{ "detail.reviewTitle"|trans({'%count%': reviews.total, '%total%':reviews.totalReviews })|sw_sanitize }}
  9.                         </p>
  10.                     {% endblock %}
  11.                     {% block page_product_detail_review_overview %}
  12.                         <div class="product-detail-review-rating"
  13.                             {% if productReviewCount > 0 %}
  14.                                 itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"
  15.                             {% endif %}>
  16.                             {% if productReviewCount > 0 %}
  17.                                 <meta itemprop="bestRating" content="5">
  18.                                 <meta itemprop="ratingCount" content="{{ productReviewCount }}">
  19.                                 <meta itemprop="ratingValue" content="{{ productAvgRating }}">
  20.                             {% endif %}
  21.                             {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  22.                                 points: productAvgRating,
  23.                                 style: 'text-primary'
  24.                             } %}
  25.                             {% if productReviewCount > 0 %}
  26.                                 <p class="h6">
  27.                                     {{ productAvgRating }} {{ "detail.reviewAvgRate"|trans|sw_sanitize }} {{ reviews.matrix.maxPoints }} {{ "detail.reviewAvgRateElements"|trans }}
  28.                                 </p>
  29.                             {% endif %}
  30.                         </div>
  31.                     {% endblock %}
  32.                 </div>
  33.             {% endblock %}
  34.             {% if productReviewCount > 0 %}
  35.                 <hr>
  36.             {% endif %}
  37.             {% set formAjaxSubmitOptions = {
  38.                 replaceSelectors: [".js-review-container"],
  39.                 submitOnChange: true
  40.             } %}
  41.             {% block page_product_detail_review_filter %}
  42.                 {% if productReviewCount > 0 %}
  43.                     <div class="js-review-filter">
  44.                         <form class="review-filter-form"
  45.                               action="{{ path('frontend.product.reviews', { productId: reviews.productId, parentId: reviews.parentId }) }}"
  46.                               method="post"
  47.                               data-form-ajax-submit="true"
  48.                               data-form-ajax-submit-options='{{ formAjaxSubmitOptions|json_encode }}'>
  49.                             {# @deprecated tag:v6.5.0 - Block page_product_detail_review_filter_csrf will be removed. #}
  50.                             {% block page_product_detail_review_filter_csrf %}
  51.                                 {{ sw_csrf('frontend.product.reviews') }}
  52.                             {% endblock %}
  53.                             {% if app.request.get('limit') %}
  54.                                 <input type="hidden" name="limit" value="{{ app.request.get('limit') }}">
  55.                             {% endif %}
  56.                             {% if app.request.get('language') %}
  57.                                 <input type="hidden" name="language" value="{{ app.request.get('language') }}">
  58.                             {% endif %}
  59.                             {% if app.request.get('sort') %}
  60.                                 <input type="hidden" name="sort" value="{{ app.request.get('sort') }}">
  61.                             {% endif %}
  62.                             {% for matrix in reviews.matrix.matrix %}
  63.                                 {% block page_product_detail_review_filter_box %}
  64.                                     <div class="row product-detail-review-filter">
  65.                                         {% block page_product_detail_review_filter_checkbox %}
  66.                                             <div class="col-md-8 col-lg-5 product-detail-review-checkbox">
  67.                                                 <div class="{{ formCheckboxWrapperClass }}">
  68.                                                     {% block page_product_detail_review_filter_checkbox_input %}
  69.                                                         <input type="checkbox"
  70.                                                                class="{{ formCheckInputClass }}"
  71.                                                                id="reviewRating{{ matrix.points }}"
  72.                                                                name="points[]"
  73.                                                             {% if app.request.get('points') %}
  74.                                                                 {% for points in app.request.get('points') %}
  75.                                                                     {% if points == matrix.points %}
  76.                                                                         checked="checked"
  77.                                                                     {% endif %}
  78.                                                                 {% endfor %}
  79.                                                             {% endif %}
  80.                                                                value="{{ matrix.points }}"
  81.                                                             {% if matrix.count < 1 %}disabled{% endif %}>
  82.                                                     {% endblock %}
  83.                                                     {% block page_product_detail_review_filter_checkbox_label %}
  84.                                                         <label class="custom-control-label text-nowrap"
  85.                                                                for="reviewRating{{ matrix.points }}">
  86.                                                             <small>{{ "detail.review#{matrix.points}PointRatingText"|trans|sw_sanitize }}
  87.                                                                 ({{ matrix.count }})</small>
  88.                                                         </label>
  89.                                                     {% endblock %}
  90.                                                 </div>
  91.                                             </div>
  92.                                         {% endblock %}
  93.                                         {% block page_product_detail_review_filter_progressbar %}
  94.                                             <div class="col d-none d-lg-block product-detail-review-progressbar-col">
  95.                                                 <div class="progress product-detail-review-progressbar-container">
  96.                                                     <div class="progress-bar product-detail-review-progressbar-bar"
  97.                                                          role="progressbar"
  98.                                                          style="width: {{ matrix.percent }}%;"
  99.                                                          aria-valuenow="{{ matrix.percent }}"
  100.                                                          aria-valuemin="0"
  101.                                                          aria-valuemax="100"></div>
  102.                                                 </div>
  103.                                             </div>
  104.                                         {% endblock %}
  105.                                         {% block page_product_detail_review_filter_share %}
  106.                                             <div class="col-12 col-md-3 product-detail-review-share">
  107.                                                 <p><small>{{ matrix.percent|round }}%</small></p>
  108.                                             </div>
  109.                                         {% endblock %}
  110.                                     </div>
  111.                                 {% endblock %}
  112.                             {% endfor %}
  113.                         </form>
  114.                     </div>
  115.                     {% block page_product_detail_review_filter_divider %}
  116.                         <hr/>
  117.                     {% endblock %}
  118.                 {% endif %}
  119.             {% endblock %}
  120.         {% endblock %}
  121.         {% block page_product_detail_review_form_teaser %}
  122.             <div class="product-detail-review-teaser js-review-teaser">
  123.                 {% block page_product_detail_review_form_teaser_header %}
  124.                     <p class="h4">
  125.                         {% if not reviews.customerReview %}
  126.                             {{ "detail.reviewTeaserTitle"|trans|sw_sanitize }}
  127.                         {% else %}
  128.                             {{ "detail.reviewExistsTeaserTitle"|trans|sw_sanitize }}
  129.                         {% endif %}
  130.                     </p>
  131.                 {% endblock %}
  132.                 {% block page_product_detail_review_form_teaser_text %}
  133.                     <p>
  134.                         {% if not page.customerReview %}
  135.                             {{ "detail.reviewTeaserText"|trans|sw_sanitize }}
  136.                         {% else %}
  137.                             {{ "detail.reviewExistsTeaserText"|trans|sw_sanitize }}
  138.                         {% endif %}
  139.                     </p>
  140.                 {% endblock %}
  141.                 {% block page_product_detail_review_form_teaser_button %}
  142.                     <button class="btn btn-primary product-detail-review-teaser-btn"
  143.                             type="button"
  144.                             {{ dataBsToggleAttr }}="collapse"
  145.                             {{ dataBsTargetAttr }}=".multi-collapse"
  146.                             aria-expanded="false"
  147.                             aria-controls="review-form review-list">
  148.                         <span class="product-detail-review-teaser-show">
  149.                             {% if not reviews.customerReview %}
  150.                                 {{ "detail.reviewTeaserButton"|trans|sw_sanitize }}
  151.                             {% else %}
  152.                                 {{ "detail.reviewExistsTeaserButton"|trans|sw_sanitize }}
  153.                             {% endif %}
  154.                         </span>
  155.                         <span class="product-detail-review-teaser-hide">
  156.                             {{ "detail.reviewTeaserButtonHide"|trans|sw_sanitize }}
  157.                         </span>
  158.                     </button>
  159.                 {% endblock %}
  160.             </div>
  161.         {% endblock %}
  162.     </div>
  163. {% endblock %}