Support Forums - Classified Ads Script Osclass

General osclass questions => Report bug => Topic started by: katalin2k on December 25, 2024, 09:17:39 AM

Title: Rich results failed
Post by: katalin2k on December 25, 2024, 09:17:39 AM
Hello,
It seems that rich results are invalid when adding comments with rating:

https://search.google.com/test/rich-results/result?id=rKDoF-n7_5I02SeNpAUh2g
Title: Re: Rich results failed
Post by: katalin2k on December 29, 2024, 12:44:26 PM
Also all listings without comments/ratings are rated as 0/5 with 1 rating available. Huge bug and must be fixed ASAP!
Title: Re: Rich results failed
Post by: MB Themes on December 30, 2024, 11:56:24 AM
I think root of problem is fact that theme has structured data in header as well.
Go to item.php and remove this code:
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(), 500)); ?>" />
    <?php if(osc_count_item_resources() > 0) { ?><meta itemprop="image" content="<?php echo $resource_url?>" /><?php ?>
  </span>

After this you should get valid rich data.
https://search.google.com/test/rich-results/result?id=1Mh2TTwe7OjiXH3OC8Z_-g
Title: Re: Rich results failed
Post by: katalin2k on January 01, 2025, 02:52:22 PM
It seems that they are now valid but still show rating 0 with 1 rating even if there are not comments/ratings.
If rating is 0 it should remove structured data as rating 0 is not an option and it's very misleading.
Please note that the listing in the screenshot is with 0 comments/0 ratings!

https://prnt.sc/PcorcwG9HYrD
Title: Re: Rich results failed
Post by: MB Themes on January 01, 2025, 04:30:19 PM
Default value should be 3.
By google, product must have rating  ;)
Title: Re: Rich results failed
Post by: katalin2k on January 01, 2025, 06:03:07 PM
If it will be 3 it will be fake. Anyways should be fixed in some way. If you ask me I would disable reviews if there aren’t any and show the reviews only if they exist
Title: Re: Rich results failed
Post by: MB Themes on January 08, 2025, 10:44:05 AM
@katalin2k
You can do it.
Then another day you come back asking why you have error on google related to missing aggregateRating and we should fix that ;)
Title: Re: Rich results failed
Post by: katalin2k on January 10, 2025, 09:47:40 PM
Right now it looks like this if no reviews have been added:
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "0",
    "bestRating": "5",
    "worstRating": "0",
    "ratingCount": "1",
    "reviewCount": "1"
  }

Isn't it more correct like this?
{
  "aggregateRating": {
    "@type": "AggregateRating",
    "bestRating": "5",
    "worstRating": "0",
    "reviewCount": "0"
  }
}

Or maybe  worstRating should be 1 because you should not be able to rate as 0 if you ask me.

Title: Re: Rich results failed
Post by: MB Themes on January 11, 2025, 08:55:13 PM
Such feedback should go to google ;)
For me ratings should not exists if your product does not have ratings, but google does not think so.