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