0

We have a couple products in Magento 1.14.0.1 enterprise that their aggregate rating is 50% the amount stored in the database.

Once a product rating is wrong, it won't go ri. I've added additional ratings to force it to recalculate it to no avail.

If I go into review_entity_summary and double the rating_summary it displays correctly. The next person that reviews will make it recalculate and it's off on the page again.

You can see a product that displays it here if you're curious. The number should be 98 as what is in the database, which would cause the width of the stars to be 98%, instead it shows 49%. https://www.atbbq.com/plowboys-bbq-yardbird-competition-bbq-rub.html

It can strike any category, any product. Our staging server shows the same behavior and the same products with the issue except for one. Comparing that product on both servers shows no difference. Nothing odd in the pull of the value and turning off Javascript shows nothing is changing it after it hits the page.

<?php if ($this->getReviewsCount()): ?>
    <div class="ratings">
    <?php if ($this->getRatingSummary()):?>
        <div class="rating-box">
            <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%"></div>
        </div>
   <?php endif;?>
   <p class="rating-links">
      <a href="<?php echo $this->getReviewsUrl() ?>">
         <?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?>
      </a>
      <span class="separator">|</span>
          <a href="<?php echo $this->getReviewsUrl() ?>#review-form">
              <?php echo $this->__('Add Your Review') ?>
          </a>
   </p>
</div>
<?php elseif ($this->getDisplayIfEmpty()): ?>
<p class="no-rating">
      <a href="<?php echo $this->getReviewsUrl() ?>#review-form">
            <?php echo $this->__('Be the first to review this product') ?>
      </a>
</p>
<?php endif; ?>

1 Answer 1

0

I hate when I post a question after messing with something for days and come up with a solution right afterwards. And worse I have to leave the question because someone else may have the same issue.

The short answer is, Magento didn't finish what it started.

I looked at the reviews in the backend and the only ones in there were for the main product, not on the sub products.

After my post I wondered if it was true? So I jumped into review_entity_summary and fed it every single product ID for a product group. The misbehaving products have a ghost entry on a sub product, but these are set to 0. So the system at some point averages the two values.

These are leftovers from a review being deleted, or from when the product only had one size and was moved into a group. These entries were zeroed out by the system instead of being deleted. Since the main review is gone, the remnant can't be seen from the back end.

So the solution is to pull all the product id's, and see what is in review_entity_summary besides your main product. Then either give them values equal to the main or delete them. I'd delete since the next review could make it come back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.