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?

2 Answers 2


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, 2018 at 21:28

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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