Skip to content

Commit

Permalink
Merge pull request #316 from rodriciru/patch-1
Browse files Browse the repository at this point in the history
Fix aggregateRating schema on product page
  • Loading branch information
NeOMakinG authored Jun 21, 2022
2 parents 0221cc6 + 3b27979 commit 5c5319f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/_partials/microdata/product-jsonld.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"@type": "AggregateRating",
"ratingValue": "{$ratings.avg|round:1|escape:'html':'UTF-8'}",
"reviewCount": "{$nbComments|escape:'html':'UTF-8'}"
}
{else if !empty($product.productComments.averageRating) && !empty($product.productComments.nbComments)}
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{$product.productComments.averageRating|round:1|escape:'html':'UTF-8'}",
"reviewCount": "{$product.productComments.nbComments|escape:'html':'UTF-8'}"
},{/if}
{if isset($product.weight) && ($product.weight != 0)}
"weight": {
Expand Down

0 comments on commit 5c5319f

Please sign in to comment.