6

I have added the following code to 'Magento_Review/layout/catalog_product_view.xml':

<move element="reviews.tab" destination="content" after="product.info.details" />

The above code moved the review tab just below product's 'Details / More Information' container.

But, the Div 'product-review-container' is empty.

Following are descriptive images of before and after moving review tab:

Before moving review tab : enter image description here



After moving review tab: enter image description here

Please help me in rectifying this.

2
  • This works fine for me. So the moved element is empty?
    – harri
    Jan 12, 2018 at 12:38
  • @harri : I have updated my answer with clear picture to make my question more cleare. Jan 12, 2018 at 12:45

3 Answers 3

5

You will also need to add the below block in your layout I have added it under <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">:

<block class="Magento\Review\Block\Product\Review" name="reviews.tab" as="reviews" template="Magento_Review::review.phtml" group="detailed_info">
                    <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml"/>
                    <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"/>
                    <block class="Magento\Review\Block\Form" name="product.review.form" as="review_form">
                        <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/>
                    </block>
                </block>
1
  • Thanks, @shireen-n Oct 21, 2019 at 11:01
3

The problem is from process-reviews.js file from vendor/magento/module-review/view/frontend/web/js. Function processReviews is not called, that's why the container remains empty. Copy the file in your theme and remove code from line 40 to 49 and just call processReviews function and it will work.


Instead of:

    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);
        });
    }

use:

    processReviews(config.productReviewUrl);
1

it's works fine for me. Kindly review attached screenshot for reference. enter image description here

2
  • But It is not working on my end Jan 23, 2018 at 10:05
  • Can you see any js error in console? Jan 23, 2018 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.