Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

AntonyM

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AntonyM's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Благодарочка Designer за халявный рабочий код для Opencart 2.0.3.1. Аналогично добавил капчу в формы регистрации. В файле # 1. catalog/controller/account/register.php перед строкой $data['column_left'] = $this->load->controller('common/column_left'); добавил if ($this->config->get('config_google_captcha_status')) { $this->document->addScript('https://www.google.com/recaptcha/api.js'); $data['site_key'] = $this->config->get('config_google_captcha_public'); } else { $data['site_key'] = ''; } перед строкой // Customer Group вставил if ($this->config->get('config_google_captcha_status') && empty($this->error['warning'])) { if (isset($this->request->post['g-recaptcha-response'])) { $recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('config_google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']); $recaptcha = json_decode($recaptcha, true); if (!$recaptcha['success']) { $this->error['warning'] = $this->language->get('error_captcha'); } } else { $this->error['warning'] = $this->language->get('error_captcha'); } } В файле # 2. catalog/view/theme/ВАША ТЕМА/template/account/register.tpl перед строкой <?php if ($text_agree) { ?> добавил: <?php if ($site_key) { ?> <div class="form-group"> <div class="col-sm-12"> <div class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div> </div> </div> <?php } ?> P.S. Спамерам - мой пламенный!
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.