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.                             {% block page_product_detail_review_filter_csrf %}
  50.                                 {{ sw_csrf('frontend.product.reviews') }}
  51.                             {% endblock %}
  52.                             {% if app.request.get('limit') %}
  53.                                 <input type="hidden" name="limit" value="{{ app.request.get('limit') }}">
  54.                             {% endif %}
  55.                             {% if app.request.get('language') %}
  56.                                 <input type="hidden" name="language" value="{{ app.request.get('language') }}">
  57.                             {% endif %}
  58.                             {% if app.request.get('sort') %}
  59.                                 <input type="hidden" name="sort" value="{{ app.request.get('sort') }}">
  60.                             {% endif %}
  61.                             {% for matrix in reviews.matrix.matrix %}
  62.                                 {% block page_product_detail_review_filter_box %}
  63.                                     <div class="row product-detail-review-filter">
  64.                                         {% block page_product_detail_review_filter_checkbox %}
  65.                                             <div class="col-md-8 col-lg-5 product-detail-review-checkbox">
  66.                                                 <div class="{{ formCheckboxWrapperClass }}">
  67.                                                     {% block page_product_detail_review_filter_checkbox_input %}
  68.                                                         <input type="checkbox"
  69.                                                                class="{{ formCheckInputClass }}"
  70.                                                                id="reviewRating{{ matrix.points }}"
  71.                                                                name="points[]"
  72.                                                             {% if app.request.get('points') %}
  73.                                                                 {% for points in app.request.get('points') %}
  74.                                                                     {% if points == matrix.points %}
  75.                                                                         checked="checked"
  76.                                                                     {% endif %}
  77.                                                                 {% endfor %}
  78.                                                             {% endif %}
  79.                                                                value="{{ matrix.points }}"
  80.                                                             {% if matrix.count < 1 %}disabled{% endif %}>
  81.                                                     {% endblock %}
  82.                                                     {% block page_product_detail_review_filter_checkbox_label %}
  83.                                                         <label class="custom-control-label text-nowrap"
  84.                                                                for="reviewRating{{ matrix.points }}">
  85.                                                             <small>{{ "detail.review#{matrix.points}PointRatingText"|trans|sw_sanitize }}
  86.                                                                 ({{ matrix.count }})</small>
  87.                                                         </label>
  88.                                                     {% endblock %}
  89.                                                 </div>
  90.                                             </div>
  91.                                         {% endblock %}
  92.                                         {% block page_product_detail_review_filter_progressbar %}
  93.                                             <div class="col d-none d-lg-block product-detail-review-progressbar-col">
  94.                                                 <div class="progress product-detail-review-progressbar-container">
  95.                                                     <div class="progress-bar product-detail-review-progressbar-bar"
  96.                                                          role="progressbar"
  97.                                                          style="width: {{ matrix.percent }}%;"
  98.                                                          aria-valuenow="{{ matrix.percent }}"
  99.                                                          aria-valuemin="0"
  100.                                                          aria-valuemax="100"></div>
  101.                                                 </div>
  102.                                             </div>
  103.                                         {% endblock %}
  104.                                         {% block page_product_detail_review_filter_share %}
  105.                                             <div class="col-12 col-md-3 product-detail-review-share">
  106.                                                 <p><small>{{ matrix.percent|round }}%</small></p>
  107.                                             </div>
  108.                                         {% endblock %}
  109.                                     </div>
  110.                                 {% endblock %}
  111.                             {% endfor %}
  112.                         </form>
  113.                     </div>
  114.                     {% block page_product_detail_review_filter_divider %}
  115.                         <hr/>
  116.                     {% endblock %}
  117.                 {% endif %}
  118.             {% endblock %}
  119.         {% endblock %}
  120.         {% block page_product_detail_review_form_teaser %}
  121.             <div class="product-detail-review-teaser js-review-teaser">
  122.                 {% block page_product_detail_review_form_teaser_header %}
  123.                     <p class="h4">
  124.                         {% if not reviews.customerReview %}
  125.                             {{ "detail.reviewTeaserTitle"|trans|sw_sanitize }}
  126.                         {% else %}
  127.                             {{ "detail.reviewExistsTeaserTitle"|trans|sw_sanitize }}
  128.                         {% endif %}
  129.                     </p>
  130.                 {% endblock %}
  131.                 {% block page_product_detail_review_form_teaser_text %}
  132.                     <p>
  133.                         {% if not page.customerReview %}
  134.                             {{ "detail.reviewTeaserText"|trans|sw_sanitize }}
  135.                         {% else %}
  136.                             {{ "detail.reviewExistsTeaserText"|trans|sw_sanitize }}
  137.                         {% endif %}
  138.                     </p>
  139.                 {% endblock %}
  140.                 {% block page_product_detail_review_form_teaser_button %}
  141.                     <button class="btn btn-primary product-detail-review-teaser-btn"
  142.                             type="button"
  143.                             {{ dataBsToggleAttr }}="collapse"
  144.                             {{ dataBsTargetAttr }}=".multi-collapse"
  145.                             aria-expanded="false"
  146.                             aria-controls="review-form review-list">
  147.                         <span class="product-detail-review-teaser-show">
  148.                             {% if not reviews.customerReview %}
  149.                                 {{ "detail.reviewTeaserButton"|trans|sw_sanitize }}
  150.                             {% else %}
  151.                                 {{ "detail.reviewExistsTeaserButton"|trans|sw_sanitize }}
  152.                             {% endif %}
  153.                         </span>
  154.                         <span class="product-detail-review-teaser-hide">
  155.                             {{ "detail.reviewTeaserButtonHide"|trans|sw_sanitize }}
  156.                         </span>
  157.                     </button>
  158.                 {% endblock %}
  159.             </div>
  160.         {% endblock %}
  161.     </div>
  162. {% endblock %}