The question:
I need to move/rearrange Reviews from tabs of product page to bottom of page. Here is how I updated my theme file’s default.xml
<referenceBlock name="reviews.tab" remove="true" /> <!-- Removed tab -->
<referenceContainer name="content">
<container name="new_space" htmlTag="div" htmlClass="container" after="-"> <!-- New Container to display at bottom of page -->
This code works well and placed reviews at bottom of page but Home page of site goes blank and error log display below errors:
PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /chroot/home/londonwa/londonwala.in/html/vendor/magento/module-review/Block/Product/View.php:131
My issue same issue like: How to Exclude Magento Review tab from tabs and show at bottom but thats in magento 1.x version.
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
Magento2, have layout tag <move>
by which you move a block reference area to another area.
Please add this code at catalog_product_view.xml app/design/frontend/[VendorName]/[ThemeName]/Magento_Catalog/layout
<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- add this code -->
<move element="reviews.tab" destination="content" after="-"/>
<!-- end -->
</body>
</page>
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0