- This topic has 12 replies, 2 voices, and was last updated 5 years, 3 months ago by
Support. This post has been viewed 1708 times
-
AuthorPosts
-
March 29, 2021 at 8:36 am #10037248
ppericles
ParticipantHello,
I moved my site’s html files to language specific folders.
Since then, my contact page no longer works at all.I get an error that “This page isn’t working right now”.
Could you please help?
Thanks.
Template Version: 8.3March 29, 2021 at 2:20 pm #10037250ppericles
ParticipantHello again,
Tried a few things and now I get the following error:
{“response”:”error”,”errorMessage”:”reCaptcha Error: Invalid token. Please contact the website administrator.”}
although the google captcha site and secret keys are correct.
March 29, 2021 at 11:36 pm #10037259Support
KeymasterThis reply has been marked as private.March 30, 2021 at 1:07 am #10037265ppericles
ParticipantHello,
The problem arises when I add the language code at the end of the site key.
I tried both &hl= and &lang=, which I have tried in the past and worked, but now they don’t.
Any ideas would be greatly appreciated.Thanks.
March 30, 2021 at 6:54 am #10037275Support
KeymasterHello,
That’s probably you are using the V3 of recaptcha, where an action from user is not needed. The V3 detect that the user is not a bot trough javascript events. The language is useful when using the V2 of recaptcha.
Hope this helps and clarify!
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
March 30, 2021 at 12:47 pm #10037280ppericles
ParticipantThis reply has been marked as private.March 30, 2021 at 11:46 pm #10037287Support
KeymasterHello,
Oh, you are right!
Inspecting more deeply I saw that’s a problem with our JS code.
Please change site_key variable at (view.contact.js) to:
var site_key = $('#google-recaptcha-v3').attr('src').split("render=")[1].replace('&hl=en','');We hope this helps!
kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
March 31, 2021 at 3:04 am #10037298ppericles
ParticipantHello,
I do not really understand what is the effect of the proposed change. Anyway, it does not produce the desired result (display of recaptcha logo in a languege other than English, which is the default).
You are striping from the site key the portion with &hl=en.
But, in order to display the recaptcha v3 logo in a different language other than English, the hl can take many values (in my case is el for Greek).
I assume that you are proposing this change while keeping the existing version of the contact form (found in https://www.abybill.eu/contact-us.html).Thanks.
March 31, 2021 at 7:07 am #10037304Support
KeymasterHello,
You are definitely right! Sorry I did not think you was using the same JS script for both versions.
We can easily get the country code from the url. Please try changing that part of code to:
var countryCode = window.location.pathname.split('/')[1], site_key = $('#google-recaptcha-v3').attr('src').split("render=")[1].replace('&hl='+countryCode,'');Hope this helps!
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
March 31, 2021 at 11:41 am #10037308ppericles
ParticipantHello,
Thank you for your answer.
If you strip from the site key everything from & onwards until the end of the string, then your solution would be made more generic and independent of the site’s url including the language indicator.
Could you please show me how to do that?Thanks.
March 31, 2021 at 11:21 pm #10037321Support
KeymasterHello,
That’s a good idea too! And we will implement this logic in the template files for next version. Thanks.
Here’s the code you need:
var recaptchaSrcURL = $('#google-recaptcha-v3').attr('src'), newURL = new URL(recaptchaSrcURL), site_key = newURL.searchParams.get("render");Hope this helps!
kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
April 1, 2021 at 12:20 am #10037329ppericles
ParticipantHello,
Thank you very much. It works perfectly.
Will you include the change in view.contact.js in future updates of the Porto template?Thanks again.
April 1, 2021 at 5:17 am #10037334Support
KeymasterHello,
Great!
Yes, the next version of the template will have this code at view.contact.js
Thanks for your suggestion!
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.