*

morfik

  • ****
  • 169 posts
GOOGLE RICH SNIPPETS incomplete code
« on: February 26, 2023, 11:14:50 AM »
Google reports the following warnings:

Either "offers", "review", or "aggregateRating" should be specified. But the microdata for the site is generated by Osclass:


Code: [Select]
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "some name",
  "image": "https://website/0.",
  "description": "some description...",
  "brand": "Osclass",
    "offers": {
    "@type": "Offer",
    "itemOffered": "Name",
    "url": "https://website/some-location",
        "price": "0",
    "priceValidUntil": "2024-02-26",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "5",
    "bestRating": "5",
    "worstRating": "0",
    "ratingCount": "1",
    "reviewCount": "1"
  }
 }

Looking through the Delta theme files, I noticed that there's the following code there (in themes/delta/item.php):

Code: [Select]
    <!-- GOOGLE RICH SNIPPETS --> 
  <span itemscope itemtype="http://schema.org/Product">
    <meta itemprop="name" content="<?php echo osc_esc_html(osc_item_title()); ?>" />
    <meta itemprop="description" content="<?php echo osc_esc_html(osc_highlight(osc_item_description(), 50
0
)); ?>
" />
    <?php if(osc_count_item_resources() > 0) { ?><meta itemprop="image" content="<?php echo $resource_url;
 
?>
" /><?php ?>
  </span>

There's no "offers", "review", or "aggregateRating" specified. . I think this code should be removed or some entries added to it, to fix the google warning.

Also it looks like there are two microdata blocks -- one generated by Osclass, and the other generated by the theme. Should it be in this way?
 
« Last Edit: February 26, 2023, 11:21:30 AM by morfik »

Marked as best answer by frosticek on March 04, 2023, 09:30:39 AM
*

MB Themes

Re: GOOGLE RICH SNIPPETS incomplete code
« Reply #1 on: February 26, 2023, 12:40:10 PM »
You csn remove this code if you decide that osclass generates structured data.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: GOOGLE RICH SNIPPETS incomplete code
« Reply #2 on: February 26, 2023, 12:49:25 PM »
OK, I removed it, and it looks like google doesn't complain about it anymore.

*

MB Themes

Re: GOOGLE RICH SNIPPETS incomplete code
« Reply #3 on: March 04, 2023, 09:30:53 AM »
Nice, good job  :)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots