*

Vlad7

  • ****
  • 187 posts
  • Help in installing and configuring Osclass
Re: Product errors in Google search console
« Reply #15 on: July 03, 2022, 09:12:51 AM »
Why do you think it doesn't work? I registered what Google requires and as it recommends. The task is to make it clear to Google that this is a product, how much money it costs, what currency and publication period. He does not require anything else. And you in your code indicated the rating of which does not exist!
« Last Edit: July 03, 2022, 10:32:47 AM by Vlad7 »

*

mwindey

  • *****
  • 315 posts
Re: Product errors in Google search console
« Reply #16 on: July 03, 2022, 10:51:57 AM »
@vlad7

When i used the snippets you provided i was getting errors in console not warnings. Probably because i also use rating plugin and the meta generator plugin.
The file structured data creates aggregating snippets as standard but it uses the comments... Since only some people use the comments it will show no rating in google and for me personally, if there is 5 star in my search on google results i would visit that site first...
 
There is also no need to use extra snippets in themes because the file was there already so why invent the wheel twice.
Originally in structured data there is:

  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",
    "bestRating": "5",
    "worstRating": "0",
    "ratingCount": "<?php echo (osc_count_item_comments() > 0 ? osc_count_item_comments() : 1); ?>",
    "reviewCount": "<?php echo (osc_count_item_comments() > 0 ? osc_count_item_comments() : 1); ?>"
  }
  <?php osc_run_hook('structured_data_footer'); ?>
}
</script>

*

bemtele

  • ***
  • 78 posts
Re: Product errors in Google search console
« Reply #17 on: July 09, 2022, 02:16:19 AM »
@vlad7

When i used the snippets you provided i was getting errors in console not warnings. Probably because i also use rating plugin and the meta generator plugin.
The file structured data creates aggregating snippets as standard but it uses the comments... Since only some people use the comments it will show no rating in google and for me personally, if there is 5 star in my search on google results i would visit that site first...
 
There is also no need to use extra snippets in themes because the file was there already so why invent the wheel twice.
Originally in structured data there is:

  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",
    "bestRating": "5",
    "worstRating": "0",
    "ratingCount": "<?php echo (osc_count_item_comments() > 0 ? osc_count_item_comments() : 1); ?>",
    "reviewCount": "<?php echo (osc_count_item_comments() > 0 ? osc_count_item_comments() : 1); ?>"
  }
  <?php osc_run_hook('structured_data_footer'); ?>
}
</script>

I tried the structured data solution but I got an error in the search console: