VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: dylanphelan on November 01, 2018, 11:01:27 AM

Title: Reviews - Rich snippets
Post by: dylanphelan on November 01, 2018, 11:01:27 AM
Hi

I am using VM 3.2.14 - not yet updated as my template developer is not yet updated their template.

I have noticed an issue with Google reviews rich snippets. Google is picking up the basic rating / votes for rich snippets and is ignoring the reviews (which have a rating). I think the reviews provided far better information.

I bought Google structured data from tassos.gr but this has not solved the issue.

when i look at my source code it still shows

    },
    "aggregateRating": {
        "ratingValue": 5,
        "reviewCount": 1,
        "worstRating": 0,
        "bestRating": 5
    }

I have far more ratings / reviews than that.

I asked tassos about this, but he said I must ask you as his plugin picks up data from the VM API.

would really appreciate some advice.
Title: Re: Reviews - Rich snippets
Post by: GJC Web Design on November 01, 2018, 11:46:41 AM
your example.. is it a single product or product with children?
Title: Re: Reviews - Rich snippets
Post by: dylanphelan on November 01, 2018, 15:32:53 PM
this is happening in both - with or without children

I thought that maybe the reviews tables were corrupted cause i worked directly in them. Emptied them added the  reviews from the backend, but it still just shows a review count of 1
Title: Re: Reviews - Rich snippets
Post by: GJC Web Design on November 01, 2018, 15:36:53 PM
afaik with children doesn't work because each child is a separate product id and reviews are stored against pids?

do more than one review show on the page?
Title: Re: Reviews - Rich snippets
Post by: dylanphelan on November 01, 2018, 15:39:53 PM
yes I get that, I am testing this on the parent products as well as a product that has no children.

yes many more than one review will show up, but the rich snippet keeps saying that there is only one review. this then displays on google
Title: Re: Reviews - Rich snippets
Post by: dylanphelan on November 01, 2018, 15:54:31 PM
this looks like an issue to me. If i look at table:

xxx_virtuemart_ratings - it only shows one rating with id=1

but if i look at

xxx_virtuemart_rating_reviews - it shows all the reviews with different id's

that makes me think that the first table is not supposed to be there! going to try a few things
Title: Re: Reviews - Rich snippets
Post by: GJC Web Design on November 01, 2018, 19:45:02 PM
code just counts the number of ratings in the result from

'SELECT * FROM `#__virtuemart_ratings` WHERE `virtuemart_product_id` = "'.(int)$product_id.'" ';

and calls it the review count  - "reviewCount": "<?php echo $productratingcount; ?>"

if u say it should count reviews ( I don't know - I never use the core rating/reviews part - I have my own extension) then i guess something like

$totalreviews = $ratingModel->getProductReviewForUser($product->virtuemart_product_id);
   $productratingcount = count($totalreviews);
Title: Re: Reviews - Rich snippets
Post by: dylanphelan on November 02, 2018, 08:51:30 AM
This was some feedback from the Google Structured Data developer:

As for the Virtuemart Rating issue, tell Virtuemart support also that GSD is pulling the Rating using the getRatingByProduct() method, in case they ask you how the plugin works.
Title: Re: Reviews - Rich snippets
Post by: GJC Web Design on November 02, 2018, 09:48:56 AM
I've just suggested changes above..

Did u try my example?
As I say .. I don't use this stuff