Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recaptcha v3 doesn't validate in form added with elementor form builder of warehouse theme #221

Closed
1 task done
tga21 opened this issue May 17, 2022 · 6 comments
Closed
1 task done
Assignees
Labels
Milestone

Comments

@tga21
Copy link

tga21 commented May 17, 2022

Check if your issue exists

  • I confirm that i've search that my issue does not already exists

Your prestashop version

1.7.8.x

Eicaptcha version

2.3.x

Do you use a specific theme ?

Last version of Warehouse theme, uses elementor builder and is developed by iqitcommerce

Describe the bug

I have installed the module eicaptcha and added to it the keys for the v3 recaptcha I created. It works perfect with newsletter block in the footer but it doesn't work with the contact form that I added to the home page using elementor. Maybe i need to add something to the template but I can't figure out what it may be. I have googled about this and didn't find any clue.

Also there is no log in "/modules/eicaptcha/src/logs/debug.log"

Could you please lend me a helping hand?

Thanks for your time and attention :)

Screenshots

Captura de pantalla 2022-05-17 a las 18 15 00
Captura de pantalla 2022-05-17 a las 19 04 39

Additional context

No response

@nenes25
Copy link
Owner

nenes25 commented May 17, 2022

Hello @tga21 ,

This issue is the same as #219 and #216
In fact the captcha only works in the default contact page.
I'll try to see what i can do, but for now i've not the time to investigate about this 😞
You may try to load the recaptcha library by hand on the concerned page maybe.

Regards,

@tga21
Copy link
Author

tga21 commented May 18, 2022

Hello Nenes25,

Thank you very much for your answer. I'm going to look how to solve it with the clue you have given me. If I make it work I'll share here the process.

Regards,
T

@tga21
Copy link
Author

tga21 commented May 18, 2022

Hi, Nenes25

Marcin from iqit-commerce support team has given me a solution. He told me he edited some code from eicaptcha, so I have checked the files and here are the edits he made. I hope they can help someone else:

  1. In module's root, eicaptcha.php:

1.1 line 161:

if ($this->context->controller instanceof ContactController
&& Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1
to

if (Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1

1.2 line 185:

($this->context->controller instanceof ContactController && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1)

to

(Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1)

1.3 line 211:

if (($this->context->controller instanceof ContactController && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1)) {

to

if ((Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1)) {

1.3 line 227:

if (
        $this->context->controller instanceof ContactController
        && Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1
    ) {

to

Configuration::get('CAPTCHA_ENABLE_CONTACT') == 1

2 /eicaptcha/views/js/v3.js

$(document).ready(function () {
$('.contact-form .form-fields').append('');
});

With this editions, the captcha validates in the form added with the templator builder for warehouse theme.

@nenes25
Copy link
Owner

nenes25 commented May 18, 2022

Hi @tga21 ,

Thanks for the share 😃 !
I don't like the approach as the script are then loaded on every pages of the site which is unnecessary for most of the module user.
I will think about adding a configuration which will allow this with a warning for performances.

Regards,

@nenes25
Copy link
Owner

nenes25 commented Feb 20, 2024

A new configuration add been added to the 2.4.5 version to allow to load recaptcha library on all pages.
It should fix this issue, so i close it.
Feel free to reopen if you still have an issue.

Regards,

@nenes25 nenes25 closed this as completed Feb 20, 2024
@tga21
Copy link
Author

tga21 commented Feb 20, 2024

Thanks @nenes25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants