Chat with us, powered by LiveChat skip to Main Content

Magento2.x Customer Reviews Missing In Product Page

Magento2.x Customer Reviews Missing?

Problem: Magento2.x Customer Reviews Missing in product details page.

This is a common question in Magento 2.3.1 that, “I am not seeing customer reviews in product details page. I can see the ‘REVIEWS’ tab, but it only displaying the review form. I have reviews approved from admin for the product. Even though, Customer Reviews are not showing“.

Please check before you start:

Your Customer Reviews are not using Magento 2.x default TAB in product page. It is separated from TAB’s.

Here is the solution for you

Assuming you are using custom theme (Child theme of Magento LUMA). If you are not using that, please go to your theme files and follow the steps as mentioned below.

  1. First download the file process-reviews.js from “app/code/Magento/Review/view/frontend/web/js/” in your system. and see Line 40 to 49.
        var reviewTab = $(config.reviewsTabSelector),
            requiredReviewTabRole = 'tab';

        if (reviewTab.attr('role') === requiredReviewTabRole && reviewTab.hasClass('active')) {
            processReviews(config.productReviewUrl);
        } else {
            reviewTab.one('beforeOpen', function () {
                processReviews(config.productReviewUrl);
            });
        }

Please comment-out line 40 to 49, and add the following line at line 50

		processReviews(config.productReviewUrl);

So now, it should looks like as follows:

        /*var reviewTab = $(config.reviewsTabSelector),
            requiredReviewTabRole = 'tab';

        if (reviewTab.attr('role') === requiredReviewTabRole && reviewTab.hasClass('active')) {
            processReviews(config.productReviewUrl);
        } else {
            reviewTab.one('beforeOpen', function () {
                processReviews(config.productReviewUrl);
            });
        }*/
		processReviews(config.productReviewUrl);

Please save the file.

Now we will override the core theme files. We will not touch the Magento core files as per Magento development guide lines.

  1. Now, in your server, create directory named Magento_Review under Your Theme Directory.
  2. Create Directory web under the created directory Magento_Review.
  3. Create Directory js inside web.
  4. Now upload process-reviews.js file, which we just edited, inside js directory.

So the structure should be:

Your_Theme_Directory
|---Magento_Review
    |--- web
         |--- js
              |--- process-reviews.js

 

Now you are 90% Done !!

For the next step, please connect with CLI (SSH), and go to Magento 2.3.1 root directory. then run the following command:

 php bin/magento setup:upgrade

Cheers, Your customer reviews are showing up in frontend under the Reviews Tab.

Conclusion:

When the customer reviews are in Magento 2.x default tab’s, the onClick Review tab fires the jQuery. So it display reviews onClick event. But when you separated the TAB, the onClick event is missing. Thus we need a small changes in jQuery.

Looking for any custom solution

Are you still confused?
Or, not solved your issue?
Or, need any custom solution?

– Kindly hire and get the paid service to fix the Magento 1x & 2x issues. Migration of M1 to M2 service also available. Get in touch with us.

 

If you like our solution, kindly post comments in this page.

This Post Has 2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top