Replies: 3 comments 6 replies
-
Magento works with google recaptcha out of the box and Breeze support it too. Can you stick to default functionality instead of reimplementing it on your own? |
Beta Was this translation helpful? Give feedback.
-
This code will add a login container with captcha at the bottom of all pages: <referenceContainer name="before.body.end">
<container name="customer.login.popup" label="Customer Login Container" htmlTag="div" htmlClass="login-container login-popup">
<block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="Magento_Customer::form/login.phtml">
<container name="form.additional.info" as="form_additional_info">
<block class="Magento\ReCaptchaUi\Block\ReCaptcha"
name="recaptcha"
after="-"
template="Magento_ReCaptchaFrontendUi::recaptcha.phtml"
ifconfig="recaptcha_frontend/type_for/customer_login">
<arguments>
<argument name="recaptcha_for" xsi:type="string">customer_login</argument>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="recaptcha" xsi:type="array">
<item name="component" xsi:type="string">Magento_ReCaptchaFrontendUi/js/reCaptcha</item>
</item>
</item>
</argument>
</arguments>
</block>
</container>
<arguments>
<argument name="login_button_view_model" xsi:type="object">Magento\Customer\ViewModel\LoginButton</argument>
</arguments>
</block>
<block class="Magento\Customer\Block\Form\Login\Info" name="customer.new" template="Magento_Customer::newcustomer.phtml"/>
</container>
</referenceContainer> And here is the js code that will show it in the modal: $('.login-popup').modal({
modalClass: 'modal-xl',
buttons: [],
});
$('.login-popup').modal('openModal'); Then you need to:
|
Beta Was this translation helpful? Give feedback.
-
Hi @vovayatsyuk Thanks for your suggestion. But here I am not using default magento's Login form in the popup. So for that case How can I implement recaptcha Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have create custom JS to render the google re-captcha on the forms. Here I created 2 files of it. one is for breeze_default.xml and another is for non breeze pages.
Now in my case the Customer login page has disabled breeze for some reasons and on the same page Signup popup is showing from header link.
in phtml file I am using below :
My issue is on only login page or without breeze enabled pages.
I have attached all files below. Can you please check it once anything wrong in the overriding component in breeze ?
Please guide me on the same.
Thanks
Rutul
googleRecaptcha.txt
google_recaptcha.txt
breeze_default.txt
Beta Was this translation helpful? Give feedback.
All reactions