Dear Commentics Team,
First I want to express my compliments for this wonderful rating system, the most detailed, complex and easy to use that I have seen.
I have a little question:
Is it possible to remove only the rich snippets stars from the basic PHP block and move it to the top of the same page, as a single object?
Please see the image for reference.
It's not really possible to "move it" but what you could do is disable the average rating in Layout -> Comments -> Enabled and then add some code to the part of the page where you want it to display.
I added the following code on my product page. The stars appeared, but with the same value in every page (5 von 5 and 1 vote). I think that there is not properly connection with the database.
$result = mysqli_query($cmtx_link, "SELECT AVG(`rating`)
FROM (
SELECT `rating` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' AND `rating` != '0' AND `page_id` = '$id'
UNION ALL
SELECT `rating` FROM `" . $cmtx_mysql_table_prefix . "ratings` WHERE `page_id` = '$id'
)
AS `average`
");
If you go to this page, scroll down to the very bottom and in the 'Select Store' drop-down field select the Modern Theme. To me it looks identical to the image you attached.
You are right, the image is from Magento Modern Theme. But I use it only to clearly illustrate my intentions. This is not print screen from my website.
I've added error reporting codes, but there is no errors displayed.
Also I've added the following code at the bottom: var_dump($average);
Please, see the attachments.
Image 001 shows what happens on the page with 2 posted comments.
Image 002 shows what happens on the page with 0 posted comments.
The result is the same, only average rating has changed.
$result = mysqli_query($cmtx_link, "SELECT AVG(`rating`)
FROM (
SELECT `rating` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' AND `rating` != '0' AND `page_id` = '$id'
UNION ALL
SELECT `rating` FROM `" . $cmtx_mysql_table_prefix . "ratings` WHERE `page_id` = '$id'
)
AS `average`
");