Merge pull request #3625 from vishal-webkul/issue-3606
Issue #3606 fixed
This commit is contained in:
commit
2d2275f306
|
|
@ -5,20 +5,24 @@
|
|||
@if ($total = $reviewHelper->getTotalReviews($product))
|
||||
<div class="product-ratings mb-10">
|
||||
<span class="stars">
|
||||
@for ($i = 1; $i <= round($reviewHelper->getAverageRating($product)); $i++)
|
||||
<span class="icon star-icon"></span>
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
@if($i <= round($reviewHelper->getAverageRating($product)))
|
||||
<span class="icon star-icon"></span>
|
||||
@else
|
||||
<span class="icon star-icon-blank"></span>
|
||||
@endif
|
||||
@endfor
|
||||
</span>
|
||||
|
||||
<div class="total-reviews">
|
||||
{{
|
||||
{{
|
||||
__('shop::app.products.total-rating', [
|
||||
'total_rating' => $reviewHelper->getTotalRating($product),
|
||||
'total_rating' => $reviewHelper->getAverageRating($product),
|
||||
'total_reviews' => $total,
|
||||
])
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.review.after', ['product' => $product]) !!}
|
||||
{!! view_render_event('bagisto.shop.products.review.after', ['product' => $product]) !!}
|
||||
|
|
|
|||
|
|
@ -55,16 +55,20 @@
|
|||
</span>
|
||||
|
||||
<span class="stars">
|
||||
@for ($i = 1; $i <= $reviewHelper->getAverageRating($product); $i++)
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
|
||||
@if($i <= round($reviewHelper->getAverageRating($product)))
|
||||
<span class="icon star-icon"></span>
|
||||
@else
|
||||
<span class="icon star-icon-blank"></span>
|
||||
@endif
|
||||
|
||||
@endfor
|
||||
</span>
|
||||
|
||||
<div class="total-reviews mt-5">
|
||||
{{ __('shop::app.reviews.ratingreviews', [
|
||||
'rating' => $reviewHelper->getTotalRating($product),
|
||||
'rating' => $reviewHelper->getAverageRating($product),
|
||||
'review' => $reviewHelper->getTotalReviews($product)])
|
||||
}}
|
||||
</div>
|
||||
|
|
@ -101,9 +105,13 @@
|
|||
</div>
|
||||
|
||||
<span class="stars">
|
||||
@for ($i = 1; $i <= $review->rating; $i++)
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
|
||||
@if($i <= $review->rating)
|
||||
<span class="icon star-icon"></span>
|
||||
@else
|
||||
<span class="icon star-icon-blank"></span>
|
||||
@endif
|
||||
|
||||
@endfor
|
||||
</span>
|
||||
|
|
@ -154,4 +162,4 @@
|
|||
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -16,9 +16,13 @@
|
|||
</span>
|
||||
|
||||
<span class="stars">
|
||||
@for ($i = 1; $i <= round($reviewHelper->getAverageRating($product)); $i++)
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
|
||||
@if($i <= round($reviewHelper->getAverageRating($product)))
|
||||
<span class="icon star-icon"></span>
|
||||
@else
|
||||
<span class="icon star-icon-blank"></span>
|
||||
@endif
|
||||
|
||||
@endfor
|
||||
</span>
|
||||
|
|
@ -46,9 +50,13 @@
|
|||
</div>
|
||||
|
||||
<span class="stars">
|
||||
@for ($i = 1; $i <= $review->rating; $i++)
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
|
||||
@if($i <= $review->rating)
|
||||
<span class="icon star-icon"></span>
|
||||
@else
|
||||
<span class="icon star-icon-blank"></span>
|
||||
@endif
|
||||
|
||||
@endfor
|
||||
</span>
|
||||
|
|
@ -87,4 +95,4 @@
|
|||
@endif
|
||||
@endif
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.view.reviews.after', ['product' => $product]) !!}
|
||||
{!! view_render_event('bagisto.shop.products.view.reviews.after', ['product' => $product]) !!}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Star-icon-blank</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Star-icon-blank" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Star" fill="#d4d4d4" fill-rule="nonzero" points="7.99999999 13.2668737 3.05572808 16 4 10.2111456 0 6.11145618 5.52786404 5.26687371 7.99999999 0 10.472136 5.26687371 16 6.11145618 12 10.2111456 12.9442719 16"></polygon>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 706 B |
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=9f7467acd7ea119b7d87",
|
||||
"/css/ui.css": "/css/ui.css?id=b5bedc0ff04a145ca18a"
|
||||
"/js/ui.js": "/js/ui.js?id=706b63016a08ec91d32b",
|
||||
"/css/ui.css": "/css/ui.css?id=54e0814214c81d98a101"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Star-icon-blank</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Star-icon-blank" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Star" fill="#d4d4d4" fill-rule="nonzero" points="7.99999999 13.2668737 3.05572808 16 4 10.2111456 0 6.11145618 5.52786404 5.26687371 7.99999999 0 10.472136 5.26687371 16 6.11145618 12 10.2111456 12.9442719 16"></polygon>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 706 B |
|
|
@ -194,6 +194,12 @@
|
|||
height: 24px;
|
||||
}
|
||||
|
||||
.star-icon-blank {
|
||||
background-image: url("../images/Star-Icon-Blank.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.arrow-down-white-icon {
|
||||
background-image: url("../images/down-arrow-white.svg");
|
||||
width: 17px;
|
||||
|
|
@ -346,4 +352,4 @@
|
|||
background-image: url("../images/Camera.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
$total = $reviewHelper->getTotalReviews($product);
|
||||
|
||||
$avgRatings = $reviewHelper->getAverageRating($product);
|
||||
$avgStarRating = ceil($avgRatings);
|
||||
$avgStarRating = round($avgRatings);
|
||||
|
||||
$productImages = [];
|
||||
$images = $productImageHelper->getGalleryImages($product);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
$total = $reviewHelper->getTotalReviews($product);
|
||||
|
||||
$avgRatings = $reviewHelper->getAverageRating($product);
|
||||
$avgStarRating = ceil($avgRatings);
|
||||
$avgStarRating = round($avgRatings);
|
||||
}
|
||||
|
||||
$percentageRatings = $reviewHelper->getPercentageRating($product);
|
||||
|
|
|
|||
Loading…
Reference in New Issue