Do You Want to Learn Marketing or Coding? Do You Want to Learn Marketing or Coding?

Magento Show Latest Review on Product Page

Share on facebook
Share on twitter
Share on linkedin

Want to show the latest product review on your product page? It is simple add the following

                $productId = $this->getProduct()->getId(); 
                $reviews = Mage::getModel('review/review')
                    ->addEntityFilter('product', $productId)
                $ratings = array();
                if (count($reviews) > 0) {
                    $x = 1;
                    <div class="product-review-template">
                        <h2>Latest Review</h2>
                        <div class="single-review-template">
                                foreach ($reviews->getItems() as $review) {
                                    echo '<p>'.$review->getDetail().'</p>';
                                    echo '<p><span class="author">'.$review->getNickname().'</span>';
                                    foreach( $review->getRatingVotes() as $vote ) {
                                        echo '<span class="stars">'.$vote->getRatingCode().' - '.$vote->getPercent().'</span></p>';
                                    if($x == 1){ break; }
<?php } ?>

I Really Need

Reviewing nerdy stuff is expensive.

Consider clicking on this ad & buying that item you REALLY wanted from Amazon.

It helps a ton!

Leave Your Thoughts