Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Marc Love (uSkinned.net) 445 posts 1787 karma points
    Feb 27, 2013 @ 13:21
    Marc Love (uSkinned.net)
    0

    Calculating AverageProductReview

    Not sure if this is a bug in uCommerce or by design. I am currently working on product review integration and I am hitting an issue with reviews that have not been approved. It appears that uCommerce is calculating the average based on all product reviews and not just the ones that have been approved. Has anyone else come across this issue?

    Cheers,

    Marc

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Feb 27, 2013 @ 13:34
    Nickolaj Lundgreen
    100

    I have not encountered that issue, mainly because im also filteringen the reviews based on culturecode (where im also filtering on the ReviewStatusId).

    public static IEnumerable<ProductReview> GetApprovedProductReviews(this Product product)
    {
        return product.ProductReviews.Where(x => x.ProductReviewStatus.Id == 2000 && x.CultureCode == CultureInfo.CurrentCulture.Name);
    }

     

    If my memory serves me well, that rating is a attribute on the product. It's not related to the review information (so if you change a review, its not reflected on the product rating).

    I would recommend doing a sum and count on my"GetApprovedProductReviews" extension and do the "math" yourself.

  • Marc Love (uSkinned.net) 445 posts 1787 karma points
    Feb 27, 2013 @ 13:46
    Marc Love (uSkinned.net)
    0

    Sounds like a plan Nickolaj, cheers for the advice.

Please Sign in or register to post replies

Write your reply to:

Draft