I am trying to add Captcha inside product review form. For that i add

<referenceContainer name="form.additional.info">
            <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
                <action method="setFormId">
                    <argument name="formId" xsi:type="string">user_login</argument>
                <action method="setImgWidth">
                    <argument name="width" xsi:type="string">230</argument>
                <action method="setImgHeight">
                    <argument name="width" xsi:type="string">50</argument>
        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/>

in theme/Magento_Review/layout/catalog_product_view.xml file. and after that i am calling it in /theme/Magento_review/template/form.phtml file like

<?php echo $block->getLayout()->getBlock('form.additional.info')->toHtml(); ?> But after that no captcha is showing in the review form. Please help me to do it. Thanks

  • 1
    May be you can find answer here: magento.stackexchange.com/questions/133238/… – Nitin Pawar Nov 26 '16 at 6:21
  • are there any way to implement it without creating custom module? – Yudi Nov 26 '16 at 6:22
  • No magento not providing inbuilt captcha for product review form. You can see config at stores/config/customers/customer config in admin panel – Nitin Pawar Nov 26 '16 at 6:32
  • You need to see how it works – Nitin Pawar Nov 26 '16 at 6:32
  • @Yudi can you tell the solution ? I am struggling not getting clear idea how it works. – supriya mishra Jan 10 '17 at 18:25

To use google reCaptch : Go to Admin -> Store -> Configuration -> Security Tab -> Google reCaptcha -> Frontend -> Enabled = Yes

Use in Review = select Yes

Add getChildHtml('form.additional.info') ?> in your theme's Magento_Review /templates/form.phtml file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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