According to the Statista report, reviews and ratings play an important role in making purchasing decisions for 53% of US online shoppers. This makes the functionality an integral part of online stores. So let’s see how you can enable or disable the display of product reviews in Magento 2 and how you can extend default features.
To enable product reviews for your Magento 2 store:
Now your customers can leave their review on the products they bought.
Also, you can enable ratings to allow users to evaluate different aspects of the product and service on a five-point scale. For this:
If customer reviews are not showing on the product pages of your Magento 2 store, make sure you've approved them. So, if Magento product reviews are not showing, do the following:
These were the vanilla Magento 2 settings for product reviews, so let’s see how you can extend them with the help of Amasty extension.
The module allows you to show customers’ reviews on any CMS page:
To disable Magento 2 product reviews, go to Stores > Settings > Configuration > Catalog, open the Product Reviews section, and set the Enabled field to No. Don’t forget to save changes, clear the cache, and check the result on the frontend. After you do these steps, users won’t be allowed to write reviews.
To show reviews on the Magento 2 product page, go to Stores > Settings > Configuration. Open the Catalog tab and choose the Catalog option. Navigate to the Product Reviews section and set Yes in the Enabled and Allow Guests to Write Reviews fields. Save the changes and refresh the cache. After this, you can get product reviews in your Magento 2.
If Magento 2 product reviews are not showing on the front end, you need to make sure you've approved them. By default, all the reviews you get require moderation by the admin. For this, go to Marketing > User Content > Pending Reviews. Choose the needed review from the list and change the Status to Approved. Save review.
In Magento 2, you can easily retrieve the product review collection using the \Magento\Review\Model\ResourceModel\Review\CollectionFactory
class. First, you need to inject this class into your constructor, and then you can call the create()
method to get an instance of the review collection. Once you have the collection, you can apply filters and sorting as needed. For example, you can filter by product ID using the addEntityFilter()
method. Finally, you can call the getData()
method to retrieve the review data.
Login and Registration Form