custom/plugins/TrustedShops/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  2. {% block page_product_detail_reviews %}
  3.     {{ parent() }}
  4.     {% if trustedshops.tsId and trustedshops.tsProductReviewsActive and trustedshops.tsProductRatingStarsDetailsActive %}
  5.         {# Trusted Shops Product Stars - Start #}
  6.         {% set productNumber = page.product.productNumber %}
  7.         {% if page.product.extensions.parentProduct %}
  8.             {% set productNumber = page.product.extensions.parentProduct.sku %}
  9.         {% endif %}
  10.         <div class="product-detail-trustedshops-reviews" id="ts_product_widget_position" style="clear: both; margin-bottom: 1rem;"></div>
  11.         {% if trustedshops.tsProductRatingStarsExpertMode %}
  12.             {% set ratingStarsCode = trustedshops.tsExpertProductRatingStarsCode %}
  13.             {% set ratingStarsCode = ratingStarsCode|replace({'%tsid%': trustedshops.tsId}) %}
  14.             {% set ratingStarsCode = ratingStarsCode|replace({'%sku%': productNumber}) %}
  15.             {{ ratingStarsCode|raw }}
  16.         {% else %}
  17.             <script type="text/javascript" src="//widgets.trustedshops.com/reviews/tsSticker/tsProductStickerSummary.js"></script>
  18.             <script type="text/javascript">
  19.                 (function() {
  20.                     var summaryBadge = new productStickerSummary();
  21.                     summaryBadge.showSummary(
  22.                         {
  23.                             'tsId': "{{ trustedshops.tsId|escape('js') }}",
  24.                             'sku': '{{ productNumber|escape('js') }}',
  25.                             'element': '#ts_product_widget_position',
  26.                             'starColor' : '{{ trustedshops.tsProductRatingStarsStarColor|escape('js') }}',
  27.                             'starSize' : '{{ trustedshops.tsProductRatingStarsStarSize|escape('js') }}px',
  28.                             'fontSize' : '{{ trustedshops.tsProductRatingStarsFontSize|escape('js') }}px',
  29.                             'showRating' : 'true' ,
  30.                             {% if trustedshops.tsProductRatingStarsHideEmptyRatings %}
  31.                             'enablePlaceholder': 'false',
  32.                             {% else %}
  33.                             'enablePlaceholder': 'true',
  34.                             {% endif %}
  35.                             'scrollToReviews' : 'false'
  36.                         }
  37.                     );
  38.                 })();
  39.             </script>
  40.         {% endif %}
  41.         {# Trusted Shops Product Stars - End #}
  42.     {% endif %}
  43. {% endblock %}