Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 32
  1. #21
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Quote Originally Posted by torvista View Post
    Hi Steve,

    I renamed the old file and added the new one insteated, i also got the reviews code that i added to the tpl_product_info_display.php to it is original code commenting the new hacks and uncomenting some of the code i added and it is working correctly on the number of reviews, it shows exactly the reviews for that product, it is not doubling up the reviews.
    However,
    HTML Code:
     "aggregateRating": {    "@type": "AggregateRating",    "ratingValue": "0",    "reviewCount": "3"
    the ratingValue shows 0 insted of the total of the stars for the reviews

  2. #22
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    the ratingValue shows 0 insted of the total of the stars for the reviews

    the ratingValue shows 0 insted of the total of the stars divided by the number of the reviews

  3. #23
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,754
    Plugin Contributions
    30

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Try again, same file location.

    I assume the reviews are shown in the head, just the aggregate was wrong.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  4. #24
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Quote Originally Posted by torvista View Post
    Try again, same file location.

    I assume the reviews are shown in the head, just the aggregate was wrong.
    Yes you are correct.

    Still showing the same thing

    "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "0",
    "reviewCount": "3"

    the old file shows it this way
    Code:
    
        if (!$reviews->EOF) {
            foreach ($reviews as $review) {
               $reviewsArray[] = [
                    'id' => $review['reviews_id'],
                    'customersName' => $review['customers_name'],
                    'reviewsRating' => $review['reviews_rating'],
                    'dateAdded' => (!empty($review['date_added']) ? $review['date_added'] : PLUGIN_SDATA_REVIEW_DEFAULT_DATE), // $review['date_added'] may be NULL
                    'reviewsText' => $review['reviews_text']
                ];
                $ratingSum += $review['reviews_rating']; // mc12345678 2022-07-04: If going to omit this review now or in the future, then need to consider this value.
            }
            $reviewCount = count($reviewsArray);
            $ratingValue = round($ratingSum / ($reviewCount), 1);
        }
    and the new file shows it this way
    Code:
    if ($is_product_page || $current_page === 'product_reviews') {
        $ratingSum = 0;
        $ratingValue = 0;
        $reviewCount = 0;
        // $reviewsArr may already have been loaded on product_review page or on product_info page
        if (count($reviewsArr) === 0) {
            $reviewQuery = 'SELECT r.reviews_id, r.customers_name, r.reviews_rating, r.date_added, r.status, rd.reviews_text
                    FROM ' . TABLE_REVIEWS . ' r
                    LEFT JOIN ' . TABLE_REVIEWS_DESCRIPTION . ' rd ON rd.reviews_id = r.reviews_id
                    WHERE products_id = ' . (int)$_GET['products_id'] . '
                    AND status = 1
                    AND languages_id= ' . $_SESSION['languages_id'] . '
                    ORDER BY reviews_rating DESC';
            $reviews = $db->Execute($reviewQuery);
    
    
            if (!$reviews->EOF) {
                //reviews found
                foreach ($reviews as $review) {
                    $reviewsArr[] = [
                        'id' => $review['reviews_id'],
                        'customersName' => $review['customers_name'],
                        'reviewsRating' => $review['reviews_rating'],
                        'dateAdded' => (!empty($review['date_added']) ? $review['date_added'] : PLUGIN_SDATA_REVIEW_DEFAULT_DATE), // $review['date_added'] may be NULL
                        'reviewsText' => $review['reviews_text']
                    ];
                    $ratingSum += $review['reviews_rating']; // mc12345678 2022-07-04: If going to omit this review now or in the future, then need to consider this value.
                }
                //reviews NOT found
            } elseif (PLUGIN_SDATA_REVIEW_USE_DEFAULT === 'true') {
                $reviewsArr[0] = [
                    'id' => 0, // not used
                    'customersName' => 'anonymous',
                    'reviewsRating' => (int)PLUGIN_SDATA_REVIEW_DEFAULT_VALUE,
                    'dateAdded' => $product_date_added,
                    'reviewsText' => ''
                ];
                $ratingSum = (int)PLUGIN_SDATA_REVIEW_DEFAULT_VALUE;
            }
        }
        $reviewCount = count($reviewsArr);
        $ratingValue = round($ratingSum / $reviewCount, 1);
    }

  5. #25
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,754
    Plugin Contributions
    30

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Try again, added some debug info that displays in the Console.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  6. #26
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Quote Originally Posted by torvista View Post
    Try again, added some debug info that displays in the Console.

    "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "0",
    "reviewCount": "2"
    <script>console.debug("$reviewCount=2, $ratingValue=0");</script><script title="Structured Data: schemaOrganisation" type="application/ld+json">



  7. #27
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,754
    Plugin Contributions
    30

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    You should be getting something like this in the console:
    Name:  2025-02-11 11_03_26-Steve BCN BCN - IQSE-W1 - Quickshifter easy - iQSE Module iQSE-W1 (+ QSS Sen.png
Views: 27
Size:  16.0 KB

    I've added even more logging..try again!
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  8. #28
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Code:
    <script>console.debug("691: $reviewCount=3, $ratingValue=0");</script>
    Code:
    
    
    "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "0",
    "reviewCount": "3"
    },
    I am not sure why it is doing that to me, i think i will stay with the hacked code since it is doing what i want. Thanks Steve.

  9. #29
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,754
    Plugin Contributions
    30

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    You posted the Rich Results tool results (that do not show any info), instead of the browser developer tools Console messages, where the debugging output was shown.
    Shame to give up, there is always a solution.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  10. #30
    Join Date
    Feb 2007
    Posts
    282
    Plugin Contributions
    0

    Default Re: Does Products Reviews and Data Structure interfere with each other?

    Quote Originally Posted by torvista View Post
    You posted the Rich Results tool results (that do not show any info)
    Yes it does, the whole problem is the RatingValue, it is showing 0 and that is wrong, it should be 15 (the total of ratings for the 3 reviews)


    Quote Originally Posted by torvista View Post
    instead of the browser developer tools Console messages, where the debugging output was shown.
    I do not follow you.

    Quote Originally Posted by torvista View Post
    Shame to give up, there is always a solution.
    I never give up it just i have too many things on my plate and i have to balance the load.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v158 Product Description: Does not Show up in All Products and other Pages
    By celextel108 in forum Upgrading to 1.5.x
    Replies: 3
    Last Post: 26 Oct 2022, 05:01 PM
  2. v139g Are PP Express and COWA compatible with each other?
    By rstar23 in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 24 May 2012, 05:22 AM
  3. Initializing structure, template and data from localhost to server
    By edkocol in forum Installing on a Windows Server
    Replies: 0
    Last Post: 13 Aug 2011, 10:40 PM
  4. Replies: 13
    Last Post: 6 Aug 2011, 05:07 PM
  5. EZ-pages and demo products need each other
    By cochlear in forum Installing on a Windows Server
    Replies: 2
    Last Post: 7 May 2007, 07:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR