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

* [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

---------
This commit is contained in:
conseilgouz 2024-04-27 17:38:32 +02:00 committed by GitHub
parent 26234f6336
commit 19a8f56414
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,8 @@ for ($i = $stars; $i < 5; $i++) {
?>
<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; ?>">
@ -87,6 +89,7 @@ for ($i = $stars; $i < 5; $i++) {
<?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; ?>