4

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>
                <action method="setImgWidth">
                    <argument name="width" xsi:type="string">230</argument>
                </action>
                <action method="setImgHeight">
                    <argument name="width" xsi:type="string">50</argument>
                </action>
            </block>
        </referenceContainer>
        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/>
        </referenceBlock>

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
0

Amasty has a free extension for this purpose: Google Invisible reCaptcha v1.1.0 for Magento 2. It is quite painless to install with composer.

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.