Skip to content

Commit

Permalink
[4.4] Vote : aggregateRating error in Google Rich Results (#42934)
Browse files Browse the repository at this point in the history
* [4.4] Vote : aggregateRating error in Google Rich Results

* Update rating.php

* Update rating.php

Replace tabs by spaces

* Update plugins/content/vote/tmpl/rating.php

Co-authored-by: jsanders <j53.sanders@gmail.com>

* Update rating.php

remove itemscope redefinition

---------
  • Loading branch information
conseilgouz committed Apr 27, 2024
1 parent 26234f6 commit 19a8f56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/content/vote/tmpl/rating.php
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 itemtype="https://schema.org/Product">
<span itemprop="name"><?php echo $row->title; ?></span>
<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

0 comments on commit 19a8f56

Please sign in to comment.