@if (EcommerceHelper::isReviewEnabled())
@php
$version = get_cms_version();
Theme::asset()->add('lightgallery-css', 'vendor/core/plugins/ecommerce/libraries/lightgallery/css/lightgallery.min.css', version: $version);
Theme::asset()->add('front-ecommerce-css', 'vendor/core/plugins/ecommerce/css/front-ecommerce.css', version: $version);
Theme::asset()->add('front-review-css', 'vendor/core/plugins/ecommerce/css/front-review.css', version: $version);
Theme::asset()->container('footer')->add('lightgallery-js', 'vendor/core/plugins/ecommerce/libraries/lightgallery/js/lightgallery.min.js', ['jquery'], version: $version);
Theme::asset()->container('footer')->add('lg-thumbnail-js', 'vendor/core/plugins/ecommerce/libraries/lightgallery/plugins/lg-thumbnail.min.js', ['lightgallery-js'], version: $version);
Theme::asset()->container('footer')->add('review-js', 'vendor/core/plugins/ecommerce/js/front-review.js', ['lightgallery-js', 'lg-thumbnail-js'], version: $version);
$showAvgRating ??= $product->reviews->isNotEmpty();
@endphp
@if ($showAvgRating)
{{ __('Customer reviews') }}
{{ number_format($product->reviews_avg ?: 0, 2) }}
@include(EcommerceHelper::viewPath('includes.rating-star'), ['avg' => $product->reviews_avg, 'size' => 80])
@if ($product->reviews_count === 1)
({{ __('1 Review') }})
@else
({{ __(':count Reviews', ['count' => number_format($product->reviews_count)]) }})
@endif
@foreach (EcommerceHelper::getReviewsGroupedByProductId($product->id, $product->reviews_count) as $item)
! $item['count']])>
@if($item['star'] == 1)
{{ __(':number Star', ['number' => $item['star']]) }}
@else
{{ __(':number Stars', ['number' => $item['star']]) }}
@endif
{{ $item['percent'] }}%
@endforeach
@endif
@include($reviewFormView ?? EcommerceHelper::viewPath('includes.review-form'))
@if (($reviewImagesCount = count($product->review_images)) > 0)
{{ __('Images from customer (:count)', ['count' => number_format($reviewImagesCount)]) }}
@endif
@if ($product->reviews->isNotEmpty())
{{ __(':total review(s) for ":product"', ['total' => number_format($product->reviews_count), 'product' => $product->name]) }}
@else
{{ __('Looks like there are no reviews yet.') }}
@endif
@endif