Question

I want product review to be shown on the product details page, but reviews should not be shown on the product listing page irrespective of they are available or not.

Kindly help me to do this.

Was it helpful?

Solution

The following file is used for products listing page:

vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

or it may be in your current theme at the following path:

app/design/frontend/{ThemePackage}/{theme}/Magento_Catalog/templates/product/list.phtml

If the file is not in your applied theme, then you need to override it in your applied theme first.

Then open the file and just comment/delete the following line:

<?= $block->getReviewsSummaryHtml($_product, $templateType) ?>

and run the following command:

php bin/magento s:s:d -f (if not developer or default mode)

php bin/magento cache:clean

OTHER TIPS

You need to override list.phtml file in your theme.

FILE : vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

Remove following code from your file :

<?= $block->getReviewsSummaryHtml($_product, $templateType) ?>

After that run command :

php bin/magento c:f
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top