How do I get the rating summary in new products section on my homepage?

How do I get the rating summary in new products section on my homepage?

July 26, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How do I get the rating summary in new products section on my homepage?

Enhancing Your Magento Homepage: Adding Product Ratings Summary

As an e-commerce store owner or developer, creating engaging product listings on your homepage is crucial for driving sales and customer engagement. In this post, we’ll explore how to add a ratings summary (stars and review count) to the “New products” section of your Magento 2 homepage.

Understanding the Current Setup

You’ve already set up the “New products” block using the following code:

<block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage2" template="catalog/product/new.phtml">
    <action method="setColumnCount"><columns>3</columns></action>
    <action method="setProductsCount"><count>3</count></action>
</block>

This works perfectly for displaying the latest products, but it doesn’t include any review information.

The Challenge: Displaying Ratings

You’ve attempted to add the ratings summary using this code:

<?php if($_product->getRatingSummary()): ?>
    <div class="ratingsum">
        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
    </div>
<?php endif; ?>

However, this isn’t working as expected. The issue lies in the block type you’re using—catalog/product_new. This block is specifically designed for showing new products and doesn’t automatically load review data.

A Closer Look at Block Types

Magento has different block types for displaying products:

  1. catalog/product_new: Displays new products but doesn’t load reviews.
  2. bestsellers/list: Displays bestselling products with ratings summary loaded.

The difference lies in how the product collection is prepared for each block type. The bestsellers/list block uses a different method that loads review data, while the catalog/product_new block only focuses on newness criteria.

Retrieving the Product Collection

You’ve mentioned trying to retrieve the product collection using:

$_productCollection = $this->getLoadedProductCollection();

However, this returns no products in your new.phtml template. This is likely because the catalog/product_new block hasn’t loaded any products yet when this line is called.

The Solution: Modify the Block

To solve this issue, you have a few options:

  1. Change the Block Type: Switch to using the bestsellers/list block type for your “New products” section. This will load reviews along with newness criteria.
<block type="catalog/bestdeal" name="home.catalog.product.new" alias="product_homepage2" template="catalog/product/new.phtml">
    <action method="setColumnCount"><columns>3</columns></action>
    <action method="setProductsCount"><count>3</count></action>
</block>
  1. Load Reviews Manually: In your new.phtml template, you can manually load reviews using the following code:
<?php $reviews = $_product->getRatingSummary(); ?>
<div class="ratingsum">
    <?php if (count($reviews) > 0): ?>
        <div class="rating-box">
            <!-- Display your custom rating box here using $reviews data -->
        </div>
    <?php endif; ?>
</div>

This requires you to create a custom rating box display based on the $reviews array.

  1. Use Magento 2’s Review Extension: Consider installing and configuring the built-in Magento 2 Reviews extension. This provides more advanced review functionality across your store, including on the homepage.

Best Practices for Displaying Ratings

When displaying product ratings:

  • Keep the design clean and unobtrusive.
  • Use a consistent rating icon or style across all products.
  • Consider using both star ratings and text reviews to provide context.
  • Ensure the reviews are visible on mobile devices.

Conclusion: Enhancing Customer Trust Through Transparency

Adding product ratings to your Magento homepage significantly improves customer trust. By providing transparent, recent review information about new products, you’re giving customers the confidence they need to make a purchase.

Remember, honest and relevant reviews can boost conversion rates and differentiate your store from competitors that lack this valuable social proof.

I recommend trying out both the block type switch and manual loading methods to see what works best for your specific use case. If you’d like more detailed assistance or want to explore advanced rating options like aggregation or sorting, feel free to reach out to our team at Laravel Company.

Happy coding!

Magento 2 Catalog Themes Customers

Our network