You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I was playing arround with a product that did not have any reviews posted and noticed that the review I created was showing up at the bottom, but the total count and rating was off by one, seems that the very first review info did get placed into the product database when the review was activated thru admin.
Review are set to be reviewed before activation, no loggin required (either admin location).
Has any body else noticed this?
John
Offline
There is a daily cron job that runs that updates the reviews count and average for each product. After you add a review, check 24 hours later to make sure the count/average are correct.
Offline
I apologize. I was mistaken. When a review is updated/deleted/inserted using the management interface, a function named reviewsupdateavg() is automatically fired which updates the review number and average. This should be happening automatically when the review is approved.
Offline
But that is where the problem exist. On reviews that are set to auto activate they get counted in the overall rating for the item, reviews that need to be activated by admin before the are visible don't have the first review counted in the items overall review rating, an item with only one does not state that there is one review and display it's rating stars, once a sceond review is posted then the item updates with an overall review of one although two reviews are displayed in the actual review section at the bottom.
John
Offline
In futher looking into the code for Function: reviewsupdateavg it reveals that the current review being posted is the one not being accounted for as no rating variable is being passed to the function.
Going back to the calling function of review_update and changing this code
if (empty($status)) { $this->reviewsupdateavg($oldcgi['prodid'], $oldcgi['id'], 0); } else { $this->reviewsupdateavg($oldcgi['prodid'], $oldcgi['id'], $cgi['rating']); } // End of if statement.
to
if (empty($status)) { $this->reviewsupdateavg($oldcgi['prodid'], $oldcgi['id'], 0); } else { $this->reviewsupdateavg($oldcgi['prodid'], $oldcgi['id'], $oldcgi['rating']); } // End of if statement.
corrects the current review from not being included in the updated rating of a porduct. The correction was in the call that originally had cgi['rating'], I did not see anyother key in the cgi global being presented at the time the script was executing other than status.
John
Offline