View Issue Details

IDProjectCategoryView StatusLast Update
0005686OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2014-03-18 09:43
Reportermichael_keiluweit Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.8.4 / 5.1.4 
Summary0005686: rating count
DescriptionAn article rating by stars (number values are 1 - 5) increases the rating for the article by +1.
But if a customer writes a review and doesn't use the stars, the shop doesn't increase the counter.
Additional Information\Details::saveReview


public function saveReview()
{
    [...]
    //save rating
    if ( $dRating !== null && $dRating >= 1 && $dRating <= 5 ) {
        [...]
        $oProduct->addToRatingAverage( $dRating );
    }

    if ( ( $sReviewText = trim( ( string ) $this->getConfig()->getRequestParameter( 'rvw_txt', true ) ) ) ) {
        [...]
    }
}

As you see in the last if query the method call \oxArticle::addToRatingAverage() is missing and therefore the rating counter does not increase.
TagsNo tags attached.
ThemeAzure
BrowserAll
PHP Versionany
Database Versionany

Activities

martinwegele

2014-03-07 16:46

reporter   ~0009618

The rating counter must not be updated if there was only a review (text) submitted but not a rating (stars). Otherwise the calculation of the average rating will be wrong.
So the behaviour of the shop is correct: It will update the counter only for a rating not for a review.
If you want to display the number of reviews you will have to include a new field or count these with a separate select query from the oxreview table.

svetlana

2014-03-18 09:43

reporter   ~0009658

The number(in the bracket)near the stars show how many people has been voted for the product, not how many reviews was done.