Skip to content

Commit

Permalink
[5.1]Vote : aggregateRating error in Google Rich Results
Browse files Browse the repository at this point in the history
  • Loading branch information
conseilgouz committed Mar 1, 2024
1 parent faa4779 commit ceb86b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/content/vote/tmpl/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
?>
<div class="content_rating" role="img" aria-label="<?php echo Text::sprintf('PLG_VOTE_STAR_RATING', $rating); ?>">
<?php if ($rcount) : ?>
<div class="visually-hidden" itemscope="itemscope" itemtype="https://schema.org/Product">
<p class="visually-hidden" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<?php echo Text::sprintf('PLG_VOTE_USER_RATING', '<span itemprop="ratingValue">' . $rating . '</span>', '<span itemprop="bestRating">5</span>'); ?>
<meta itemprop="ratingCount" content="<?php echo $rcount; ?>">
Expand All @@ -87,6 +88,7 @@
<?php if ($this->params->get('show_total_votes', 0)) : ?>
<?php echo Text::sprintf('PLG_VOTE_TOTAL_VOTES', $rcount); ?>
<?php endif; ?>
</div>
<?php endif; ?>
<ul>
<?php echo $img; ?>
Expand Down

0 comments on commit ceb86b1

Please sign in to comment.