Post by lostwake » Fri Jan 01, 2021 5:05 am

Im not sure if this is the right place to post this but I ran into this problem for a client. Needed to integrate Recaptcha V3 and didnt want to buy an extension. So to get around this:

In theme editor edit: extension/captcha/google

Replace existing code with this:

Code: Select all

<script src="//www.google.com/recaptcha/api.js?render={{ site_key }}" type="text/javascript"></script>
<script>
  function onClick(e) {
        e.preventDefault();
        grecaptcha.ready(function(){
        grecaptcha.execute('{{ site_key }}', { action: 'submit'}).then(function(token) {
        var recaptchaResponse = document.getElementById('recaptchaResponse');
        recaptchaResponse.value = token;
        })
        });
  	}
</script>
<input type="hidden" name="g-recaptcha-response" value="" id="recaptchaResponse">
<div class="text-danger">{{ error_captcha }}</div>
Then replace your Keys with the V3 keys.

Newbie

Posts

Joined
Wed Jul 12, 2017 2:26 am

Post by straightlight » Sat Jan 02, 2021 12:40 am

Visible site keys on the view source.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by lostwake » Wed Jan 13, 2021 10:43 am

Its a public key its supposed to be viable.

Newbie

Posts

Joined
Wed Jul 12, 2017 2:26 am
Who is online

Users browsing this forum: No registered users and 7 guests