I am trying to change sign in or create an account message which is called by block named product.review.form in catalog_product_view.xml.


enter image description here

The template used is form.phtml which is set in Magento\Review\Block\Form.php

enter image description here

I want to override this part of code in


<?php else : ?>
    <div class="message info notlogged" id="review-form">
            <?= $block->escapeHtml(__('Only registered users can write reviews. Please <a href="%2">Sign in</a> or <a href="%1">create an account</a>', $block->getLoginLink(), $block->getRegisterUrl()), ['a']) ?>
<?php endif ?>

Question : How can i override the sentence in that particular <div>?

Note : I tried to use plug-in but _construct() is protected and using preference is not suitable for my requirement.

1 Answer 1


It can be override by adding the content / message in the en_US.csv file in the your custom theme.

For reference check the row 120 in sitename/vendor/magento/module-review/i18n/en_US.csv.

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.