Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.4] Vote : aggregateRating error in Google Rich Results #42934

Merged
merged 9 commits into from
Apr 27, 2024
3 changes: 3 additions & 0 deletions plugins/content/vote/tmpl/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
?>
<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">
<span itemprop="name"><?php echo $row->title;?></span>
conseilgouz marked this conversation as resolved.
Show resolved Hide resolved
<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 +89,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