Delete product reviews on "ProductReview" table still leaves a review count.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 年 前
Hi all,
I accidentally deleted a few review from the database table "ProductReview" , when i go to the product page it still  shows the review count for some reason but when you click to see the review it doesn't populate.
I know i should have deleted them in the admin panel and that's a mistake that happened. Can someone please tell me where this review count comes from and how to remove it?

Thanks in advance
Tom
6 年 前
According to the ProductService.UpdateProductReviewTotals, you'll want to update Product.ApprovedRatingSum, Product.NotApprovedRatingSum, Product.ApprovedTotalReviews, and Product.NotApprovedTotalReviews.
https://github.com/nopSolutions/nopCommerce/blob/b756071fb627ca7d207c7f8ce2c1a75038cb7f69/src/Libraries/Nop.Services/Catalog/ProductService.cs#L1093
6 年 前
It's manually counted every time reviews get added / deleted.

It's done so so that we don't need to recount the number of reviews every time we need it, which can be potential resource hog.

Which means that you need to manually update the related fields as well. :)


6 年 前
Thank you so much johntseng and wooncherk for your reply. Yes i did update the fields from the product table and it seems fine now.

Wooncherk - thank you for your newsletter on free ssl, saved me tiny bit of money :)

Regards
6 年 前
Welcome! :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.