magento - Show product reviews in review summary

magento - Show product reviews in review summary

July 15, 2026 · Illustrated author avatarBy Stefan Bogdanescu
magento - Show product reviews in review summary

Magento: Displaying Product Reviews in Review Summary

In this guide, we’ll troubleshoot an issue where product reviews aren’t being displayed correctly on the summary page of your Magento store. We’ll identify the problem with your current setup and provide a step-by-step solution.

The Current Issue and Code

You’ve encountered a fatal error when trying to display customer reviews on the product page:

Fatal error: Call to a member function getItems() on a non-object

This error occurs in your summary.phtml file, specifically at this line:

$_items = $this->getReviewsCollection()->getItems();

The problem lies in the fact that $this->getReviewsCollection() is returning an empty object or null, hence the fatal error when calling getItems().

Understanding the Review Process

Before we dive into fixing the issue, let’s briefly understand how Magento handles product reviews:

  1. Reviews are stored as separate entities in the database table review_summary.
  2. Each review has a corresponding entry in the review table.
  3. The getReviewsCollection() method retrieves all reviews for a specific product.

Resolving the Fatal Error

To solve this issue, we need to ensure that the review collection is being properly retrieved based on the current product context. Here’s how you can modify your summary.phtml file:

  1. First, make sure you have the correct PHP code to retrieve the product object in your template file. You should be able to access it using $_product = $this->getProduct();.

  2. Update the review collection retrieval line as follows:

$_items = $this->getReviewsCollection($_product)->getItems();

By passing the product object as an argument, you ensure that Magento filters the reviews based on the current product.

  1. If the error persists, double-check that your summary.phtml file is being loaded correctly in your page layout. Make sure it’s assigned to a specific block or place in the layout XML.

Best Practices for Review Display

As a best practice, ensure that you’re using Magento’s built-in review functions and templates whenever possible. This ensures compatibility with core functionality and future updates.

For more advanced customizations or if you need further assistance, consider reaching out to Laravel Company, a leading Magento development agency specializing in e-commerce solutions and custom development services.

Conclusion

In this post, we identified the key issue causing the fatal error in your review summary template. By updating the review collection retrieval code to include the current product object, you should now be able to successfully display customer reviews on your product pages.

Remember to always double-check your layout assignments and Magento’s built-in functions for proper functioning of core features like product reviews.

If you found this guide helpful or need further assistance with Magento development, don’t hesitate to contact Laravel Company. Our expert team is ready to help you optimize your e-commerce platform.

Catalog Database Themes Customers

Our network