Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
I am able to reproduce the issues. Thanks for pointing this out. I am reporting this issue. To fix, you can follow these steps: To fix decimal places issue1- Open \Website\Views\Product\_ProductReviewsPanel.cshtml 2- Search Code:<span>@GetResourceString("retail.productreviewspanel.average_rating") @Model.Rating.Value @GetResourceString("retail.productreviewspanel.out_of_10")</span>
3- Replace it with Code:<span>@GetResourceString("retail.productreviewspanel.average_rating") @Model.Rating.Value.ToString("0.##") @GetResourceString("retail.productreviewspanel.out_of_10")</span>
To fix the sorting issue1- Open Website\Controllers\ProductController.cs 2- Search for Code:var model = new ProductReviewsPanelModel()
{
Show = show,
ProductId = productId,
Rating = product.Rating ?? 0,
TotalReviews = totalReviews,
IsPaged = isPaged,
Reviews = new StaticPagedList<ProductReviewModel>(reviews.Select(review => new ProductReviewModel()
{
Id = review.Id,
IsApproved = review.IsApproved,
Rating = review.Rating,
ReviewBody = review.ReviewBody,
ReviewDate = review.ReviewDate,
ReviewTitle = review.ReviewTitle,
ReviewRating = GetReviewRating(review),
ReviewerProfile = new ReviewerProfileModel()
{
Id = review.ReviewerProfile.Id,
DisplayName = review.ReviewerProfile.DisplayName,
Email = review.ReviewerProfile.Email,
EmailVerificationCode = review.ReviewerProfile.EmailVerificationCode,
EmailVerified = review.ReviewerProfile.EmailVerified,
Location = review.ReviewerProfile.Location
}
}).ToList(), page, pageSize, totalReviews)
};
3- Replace Code:var model = new ProductReviewsPanelModel()
{
Show = show,
ProductId = productId,
Rating = product.Rating ?? 0,
TotalReviews = totalReviews,
IsPaged = isPaged,
Reviews = new StaticPagedList<ProductReviewModel>(reviews.Select(review => new ProductReviewModel()
{
Id = review.Id,
IsApproved = review.IsApproved,
Rating = review.Rating,
ReviewBody = review.ReviewBody,
ReviewDate = review.ReviewDate,
ReviewTitle = review.ReviewTitle,
ReviewRating = GetReviewRating(review),
ReviewerProfile = new ReviewerProfileModel()
{
Id = review.ReviewerProfile.Id,
DisplayName = review.ReviewerProfile.DisplayName,
Email = review.ReviewerProfile.Email,
EmailVerificationCode = review.ReviewerProfile.EmailVerificationCode,
EmailVerified = review.ReviewerProfile.EmailVerified,
Location = review.ReviewerProfile.Location
}
}).ToList().OrderByDescending(review => review.ReviewDate), page, pageSize, totalReviews)
};
4- You will need to compile the code to apply these changes.
|
1 user thanked shaharyar for this useful post.
|
|