Post by HAO » Tue Jun 11, 2019 8:38 pm

I have a function module using the reCAPTCHA, But I updated the reCAPTCHA v3 module a few days ago.

How can I complete the modification?

This is the current code:
upload/catalog/controller/extension/module/*.php

Code: Select all

		// captcha
		if ($this->config->get('hb_oosn_enable_captcha') == 1){
			if(isset($this->request->post['gcaptcha']) && !empty($this->request->post['gcaptcha'])){
				$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('google_captcha_secret')) . '&response=' . $this->request->post['gcaptcha'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
				$recaptcha = json_decode($recaptcha, true);
				if (!$recaptcha['success']) {
					$json['notify_error'] = html_entity_decode($this->config->get('hb_oosn_t_error_captcha'.$language_id));
				}
			}else{
				$json['notify_error'] = html_entity_decode($this->config->get('hb_oosn_t_warn_captcha'.$language_id));
			}
		}
upload/catalog/view/theme/default/template/*.tpl

Code: Select all

	<?php if ($show_captcha) { ?>
		<div class="notify-row-group">
			<div class="notify-label notify-col-25"></div>					
			<div class="notify-col-75" id="recaptcha-inline">
			<div class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>
			</div>
			<script src="//www.google.com/recaptcha/api.js" type="text/javascript"></script>
		</div>
	<?php } ?>
Thank you!

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by Johnathan » Tue Jun 18, 2019 12:29 am

Not sure if you figured this out, but if not, I now have a Google reCAPTCHA v3 extension that you can use to add v3 support. It works on all OpenCart versions that support "Captcha" type extensions, including 2.1 through 3.0.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by HAO » Tue Jun 18, 2019 6:41 am

I have to be frank, this is the paid modification I asked the module author to customize.

Because I have completed the purchase of Google reCAPTCHA v3 module, So I can't buy your module.

But if I have a chance later, I will buy it with you, Thank you for your answer.

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by Johnathan » Tue Jun 18, 2019 10:02 pm

No worries, glad you got it worked out. I thought I'd post it just in case, since it had been something I'd been working on. But hopefully yours continues to work for you just fine! Cheers

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by HAO » Wed Jun 19, 2019 3:28 am

You know who I am, As long as I have a new job opportunity, your module is always on my list of recommendations.

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 6 guests