Skip to content

Commit 92f5674

Browse files
committed
ACP2E-111: Inconsistent product rating on category page
1 parent 6888f43 commit 92f5674

File tree

1 file changed

+8
-4
lines changed
  • app/code/Magento/Review/view/frontend/templates/helper

1 file changed

+8
-4
lines changed

app/code/Magento/Review/view/frontend/templates/helper/summary.phtml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ $urlForm = $block->getReviewsUrl() . '#review-form';
1919
<?php if ($rating):?>
2020
<div class="rating-summary">
2121
<span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
22-
<div class="rating-result" title="<?= $block->escapeHtmlAttr($rating); ?>%">
22+
<div class="rating-result"
23+
id="rating-result_<?= /* @noEscape */ $block->getProduct()->getId() ?>"
24+
title="<?= $block->escapeHtmlAttr($rating) ?>%"
25+
>
2326
<span>
2427
<span>
2528
<span itemprop="ratingValue"><?= $block->escapeHtml($rating); ?>
@@ -28,9 +31,10 @@ $urlForm = $block->getReviewsUrl() . '#review-form';
2831
</span>
2932
</div>
3033
</div>
31-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
32-
"width:" . $block->escapeHtmlAttr($rating) . "%",
33-
'div.rating-summary div.rating-result>span:first-child'
34+
<?= /* @noEscape */
35+
$secureRenderer->renderStyleAsTag(
36+
'width:' . $block->escapeHtmlAttr($rating) . '%',
37+
'#rating-result_' . $block->getProduct()->getId() . ' span'
3438
) ?>
3539
<?php endif;?>
3640
<div class="reviews-actions">

0 commit comments

Comments
 (0)