Skip to main content
added 91 characters in body
Source Link
heady9x
  • 101
  • 9

Yep. I resolved my solution . This is my code .

  1. Create catalog_product_view.xml on your theme.
    Add Block

<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.review.short"template="Magento_Catalog::product/view/review_short.phtml"/>


Create new file **review_short.phtml** on templates/view/review/ . Add code :
<?php
 /**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var $block Magento\Catalog\Block\Product\View\Attributes */

$listBlock= $block->getLayout()- 
>createBlock(Magento\Catalog\Block\Product\ListProduct::class);
$templateType = 
\Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;

$_product = $block->getProduct();
if (!$_product instanceof \Magento\Catalog\Model\Product) {
return;
}
?>
<?= $listBlock->getReviewsSummaryHtml($_product, $templateType) ?>


Done.
enter image description here

Yep. I resolved my solution . This is my code .

  1. Create catalog_product_view.xml on your theme.
    Add Block

<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.review.short"template="Magento_Catalog::product/view/review_short.phtml"/>


Create new file **review_short.phtml** on templates/view/review/ . Add code :
<?php
 /**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var $block Magento\Catalog\Block\Product\View\Attributes */

$listBlock= $block->getLayout()- 
>createBlock(Magento\Catalog\Block\Product\ListProduct::class);
$templateType = 
\Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;

$_product = $block->getProduct();
if (!$_product instanceof \Magento\Catalog\Model\Product) {
return;
}
?>
<?= $listBlock->getReviewsSummaryHtml($_product, $templateType) ?>


Done.

Yep. I resolved my solution . This is my code .

  1. Create catalog_product_view.xml on your theme.
    Add Block

<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.review.short"template="Magento_Catalog::product/view/review_short.phtml"/>


Create new file **review_short.phtml** on templates/view/review/ . Add code :
<?php
 /**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var $block Magento\Catalog\Block\Product\View\Attributes */

$listBlock= $block->getLayout()- 
>createBlock(Magento\Catalog\Block\Product\ListProduct::class);
$templateType = 
\Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;

$_product = $block->getProduct();
if (!$_product instanceof \Magento\Catalog\Model\Product) {
return;
}
?>
<?= $listBlock->getReviewsSummaryHtml($_product, $templateType) ?>


Done.
enter image description here

Source Link
heady9x
  • 101
  • 9

Yep. I resolved my solution . This is my code .

  1. Create catalog_product_view.xml on your theme.
    Add Block

<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.info.review.short"template="Magento_Catalog::product/view/review_short.phtml"/>


Create new file **review_short.phtml** on templates/view/review/ . Add code :
<?php
 /**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var $block Magento\Catalog\Block\Product\View\Attributes */

$listBlock= $block->getLayout()- 
>createBlock(Magento\Catalog\Block\Product\ListProduct::class);
$templateType = 
\Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;

$_product = $block->getProduct();
if (!$_product instanceof \Magento\Catalog\Model\Product) {
return;
}
?>
<?= $listBlock->getReviewsSummaryHtml($_product, $templateType) ?>


Done.