3

I want to echo the average review star rating of a product in text.

Currently it is displayed in width % to display the review stars.

But I want to display it like:

Reviewscore is 4.7 / 5

How can I achieve that?

3

This line does echo the ratingscore into text:

<?php $ratingPercent = $this->getRatingSummary(); echo ($ratingPercent * 5)/100; ?> 
  • Should be marked as "best answer" ;) – sv3n Mar 22 '18 at 21:28
0

$ratingPercent = number_format($this->getRatingSummary() / 20,1);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.