I am trying to override summary.phtml file so I can change the functionality of the review button which is below product title, ex:'3 reviews' & 'add new review'.

File: summary.phtml

File Path:


I already override form.phtml to customize my review form, so here is my xml.

File: default.xml

File Path:


<referenceContainer name="content">
   <referenceBlock name="product.review.form">
      <action method="setTemplate">
        <argument name="template" xsi:type="string">SimpleMagento_ReviewCustomer::form.phtml</argument>
   <referenceBlock name="product.info.review" >
          <argument name="template" xsi:type="string">SimpleMagento_ReviewCustomer::helper/summary.phtml</argument>

override summary.phtml File Path:


after many try its still load core summary.phtml file, not mine. What I am doing wrong? Thanks

  • In which xml file you found product.info.review block ? you have mention this name reference block
    – user55548
    Commented Dec 11, 2019 at 11:17
  • @user55548 I am following answer: magento.stackexchange.com/questions/186431/… Commented Dec 11, 2019 at 11:18
  • In this answer, you can see in comment section problem is not solve. You can not use any name in reference block. This should be available. Try to use any existing block name.
    – user55548
    Commented Dec 11, 2019 at 11:23
  • @user55548 can I use product.review.form which I already use? Commented Dec 11, 2019 at 11:27
  • yes, check with that.
    – user55548
    Commented Dec 11, 2019 at 11:29

1 Answer 1


You can do this by plugin using this below way :


<?xml version="1.0"?>
 * Copyright 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <type  name="Magento\Review\Block\Product\ReviewRenderer">
       <plugin name="custom_review_template" sortOrder="20" disabled="false" type="Vendor\Module\Plugin\CustomReviewRender"/>


 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
namespace Vendor\Module\Plugin;

class CustomReviewRender {

     * @var \Magento\Framework\App\Request\Http
    protected $request;

     * @param \Magento\Framework\App\Request\Http $request
    public function __construct(
        \Magento\Framework\App\Request\Http $request
    ) {
        $this->request = $request;

    public function beforeSetTemplate(
        \Magento\Review\Block\Product\ReviewRenderer $subject,
    ) {
        if ($this->request->getFullActionName() == 'catalog_product_view') {
            return 'Vendor_Module::custom_summary.phtml'; // For product view page => In core Magento_Review::helper/summary.phtml display
        if ($this->request->getFullActionName() == 'catalog_category_view') {
            //return 'Vendor_Module::custom_short_summary.phtml';
            return $result; // For product listing page => In core Magento_Review::helper/summary_short.phtml display
        return $result;


Now, create phtml file based on your requirement.

Your Answer

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

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