{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
{% block page_product_detail_reviews %}
{{ parent() }}
{% if trustedshops.tsId and trustedshops.tsProductReviewsActive and trustedshops.tsProductRatingStarsDetailsActive %}
{# Trusted Shops Product Stars - Start #}
{% set productNumber = page.product.productNumber %}
{% if page.product.extensions.parentProduct %}
{% set productNumber = page.product.extensions.parentProduct.sku %}
{% endif %}
<div class="product-detail-trustedshops-reviews" id="ts_product_widget_position" style="clear: both; margin-bottom: 1rem;"></div>
{% if trustedshops.tsProductRatingStarsExpertMode %}
{% set ratingStarsCode = trustedshops.tsExpertProductRatingStarsCode %}
{% set ratingStarsCode = ratingStarsCode|replace({'%tsid%': trustedshops.tsId}) %}
{% set ratingStarsCode = ratingStarsCode|replace({'%sku%': productNumber}) %}
{{ ratingStarsCode|raw }}
{% else %}
<script type="text/javascript" src="//widgets.trustedshops.com/reviews/tsSticker/tsProductStickerSummary.js"></script>
<script type="text/javascript">
(function() {
var summaryBadge = new productStickerSummary();
summaryBadge.showSummary(
{
'tsId': "{{ trustedshops.tsId|escape('js') }}",
'sku': '{{ productNumber|escape('js') }}',
'element': '#ts_product_widget_position',
'starColor' : '{{ trustedshops.tsProductRatingStarsStarColor|escape('js') }}',
'starSize' : '{{ trustedshops.tsProductRatingStarsStarSize|escape('js') }}px',
'fontSize' : '{{ trustedshops.tsProductRatingStarsFontSize|escape('js') }}px',
'showRating' : 'true' ,
{% if trustedshops.tsProductRatingStarsHideEmptyRatings %}
'enablePlaceholder': 'false',
{% else %}
'enablePlaceholder': 'true',
{% endif %}
'scrollToReviews' : 'false'
}
);
})();
</script>
{% endif %}
{# Trusted Shops Product Stars - End #}
{% endif %}
{% endblock %}