Версия магазина: ocStore v0.2.2
Изменений вносились в шаблон внешнего вида от Opencartws_2.0
Хостинг у хостера и на денвере тоже самое
При попытке регистрации нового покупателя на странице регистрация внизу около "капчи" появляется сообщение об ошибке:
Notice: Undefined variable: entry_captcha in Z:\home\test1.ru\www\catalog\view\theme\opencartws\template\account\create.tpl on line 126
Notice: Undefined variable: error_captcha in Z:\home\test1.ru\www\catalog\view\theme\opencartws\template\account\create.tpl on line 128
Причина в отсутствии значения переменных $entry_captcha, $error_captcha, $captcha используемых в файле create.tpl
Для исправления ошибки делаем следующее:
Открываем файл \catalog\controller\account\create.php
ищем там:
$this->data['entry_confirm'] = $this->language->get('entry_confirm');
ниже вставляем:
$this->data['entry_captcha'] = $this->language->get('entry_captcha');
ищем:
if (isset($this->error['confirm'])) {
$this->data['error_confirm'] = $this->error['confirm'];
} else {
$this->data['error_confirm'] = '';
}
ниже вставляем:
if (isset($this->error['captcha'])) {
$this->data['error_captcha'] = $this->error['captcha'];
} else {
$this->data['error_captcha'] = '';
}
ищем:
if (isset($this->request->post['confirm'])) {
$this->data['confirm'] = $this->request->post['confirm'];
} else {
$this->data['confirm'] = '';
}
ниже вставляем:
if (isset($this->request->post['captcha'])) {
$this->data['captcha'] = $this->request->post['captcha'];
} else {
$this->data['captcha'] = '';
}
ищем:
);
$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
}
ниже вставляем:
public function captcha() {
$this->load->library('captcha');
$captcha = new Captcha();
$this->session->data['captcha'] = $captcha->getCode();
$captcha->showImage();
}
Ищем:
if ((strlen(utf8_decode($this->request->post['email'])) > 96) || (!preg_match(EMAIL_PATTERN, $this->request->post['email']))) {
$this->error['email'] = $this->language->get('error_email');
}
ниже вставляем:
if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
$this->error['captcha'] = $this->language->get('error_captcha');
}
Далее открываем файл: catalog\language\russian\account\create.php
Ищем:
$_['entry_confirm'] = 'Подтвердите пароль:';
Ниже вставляем:
$_['entry_captcha'] = 'Введите символы с картинки.';
Ищем:
$_['error_agree'] = 'Вы должны согласиться с правилами %s!';
Ниже вставляем:
$_['error_captcha'] = 'Неправильно ввели символы с картинки!';
На этом все теперь проверка капчи работает без ошибок!
Кому лень ковыряться прилагаю "]архивчик заменяющий упомянутые файлы
Fix_entry_captcha.zip