Error in Search Console Missing field 'itemReviewed' Paid Module
new

By Barry Smith, 5 months ago

Hi have implemeted review in tab on product pages (full paid version of module) and am getting the above error when inspecting Review Snippets in Google Search console - How do I fix this as it's preventing proper integration for Google results??

Thanks

Barry

By Petr Hucik, 5 months ago

itemReviews is not provided by review module. Your theme is responsible for emitting metadata about product, and review module is responsible for including metadata about reviews.

Reviews metadata will be associated with product metadata as long as the review section is "within" html tag that contains metadata about product

By Barry Smith, 5 months ago

Hi Petr

Thanks for the reply, but Prestashop 1.7 uses microdata in head in templates/_partiala/microdata/product-jsonlod.tpl . As you can see from code pasted below. Is there a way to associate reviews with product name/item reviewed using this file?

{assign var=hasAggregateRating value=false}

{if !empty($product.productComments.averageRating) && !empty($product.productComments.nbComments)}

  {assign var=hasAggregateRating value=true}

  {assign var=ratingValue value=$product.productComments.averageRating}

  {assign var=ratingReviewCount value=$product.productComments.nbComments}

{/if}

{if !empty($ratings.avg) && !empty($nbComments)}

  {assign var=hasAggregateRating value=true}

  {assign var=ratingValue value=$ratings.avg}

  {assign var=ratingReviewCount value=$nbComments}

{/if}

{if isset($axpsProductComments)}

  {assign var=hasAggregateRating value=true}

  {assign var=ratingValue value=$axpsProductComments.avg}

  {assign var=ratingReviewCount value=$axpsProductComments.nbr}

{/if}

{assign var=hasWeight value=false}

{if isset($product.weight) && ($product.weight != 0)}

  {assign var=hasWeight value=true}

{/if}

{assign var=hasOffers value=$product.show_price}

<script type="application/ld+json">

 {

  "@context": "https://schema.org/",

  "@type": "Product",

  "name": "{$product.name}",

  "description": "{$page.meta.description|regex_replace:"/[\r ]/" : " "}",

  "category": "{$product.category_name}",

  {if !empty($product.cover)}"image" :"{$product.cover.bySize.home_default.url}",{/if}

  "sku": "{if $product.reference}{$product.reference}{else}{$product.id}{/if}",

  "mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}"

  {if $product.ean13},"gtin13": "{$product.ean13}"

  {else if $product.upc},"gtin13": "{$product.upc}"

  {/if}

  {if $product_manufacturer->name OR $shop.name},

  "brand": {

   "@type": "Thing",

   "name": "{if $product_manufacturer->name}{$product_manufacturer->name|escape:'html':'UTF-8'}{else}{$shop.name}{/if}"

  }

  {/if}

  {if $hasAggregateRating},

  "aggregateRating": {

   "@type": "AggregateRating",

   "ratingValue": "{$ratingValue|round:1|escape:'html':'UTF-8'}",

   "reviewCount": "{$ratingReviewCount|escape:'html':'UTF-8'}"

  }

  {/if}

  {if $hasWeight},

  "weight": {

    "@context": "https://schema.org",

    "@type": "QuantitativeValue",

    "value": "{$product.weight}",

    "unitCode": "{$product.weight_unit}"

  }

  {/if}

  {if $hasOffers},

  "offers": {

   "@type": "Offer",

   "priceCurrency": "{$currency.iso_code}",

   "name": "{$product.name|strip_tags:false}",

   "price": "{$product.price_amount}",

   "url": "{$product.url}",

   "priceValidUntil": "{($smarty.now + (int) (60*60*24*15))|date_format:"%Y-%m-%d"}",

   {if $product.images|count > 0}

    "image": {strip}[

     {foreach from=$product.images item=p_img name="p_img_list"}

      "{$p_img.large.url}"{if not $smarty.foreach.p_img_list.last},{/if}

     {/foreach}

    ]{/strip},

   {/if}

   "sku": "{if $product.reference}{$product.reference}{else}{$product.id}{/if}",

   "mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}",

   {if $product.ean13}"gtin13": "{$product.ean13}",{else if $product.upc}"gtin13": "0{$product.upc}",{/if}

   {if $product.condition == 'new'}"itemCondition": "https://schema.org/NewCondition",{/if}

   {if $product.show_condition > 0}

    {if $product.condition == 'used'}"itemCondition": "https://schema.org/UsedCondition",{/if}

    {if $product.condition == 'refurbished'}"itemCondition": "https://schema.org/RefurbishedCondition",{/if}

   {/if}

   "availability": "{$product.seo_availability}",

   "seller": {

    "@type": "Organization",

    "name": "{$shop.name}"

   }

  }

  {/if}

 }

</script>

By Petr Hucik, 5 months ago

If you theme does not comes with html-based microdata, you will have to switch off microdata in the module settings: Emit microdata / rich snippets.

Your json-ld template can display data from productComments module only. You will have to modify this template and retrieve the information about the product reviews somehow.

Note that metadata about individual reviews will not be exported, as this json-ld template does not support it.

By Barry Smith, 5 months ago

Hi Petr - nearly got it sorted now - however am coming up with an issue Invalid object type for field "author"

see attached screenshot.

How do I fix this?