Fortunately there aren't that many files that you will need to open.
You need to add this to your Register Controller which can be found at:
/catalog/controller/account/register.php
Code: Select all
public function captcha() {
$this->load->library('captcha');
$captcha = new Captcha();
$this->session->data['captcha'] = $captcha->getCode();
$captcha->showImage();
}
Then in the same file, locate the function named validate() and add this directly before the if(!$this->error) {
Code: Select all
if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
$this->error['captcha'] = $this->language->get('error_captcha');
}
Code: Select all
if (isset($this->error['captcha'])) {
$this->data['error_captcha'] = $this->error['captcha'];
} else {
$this->data['error_captcha'] = '';
}
Code: Select all
if (isset($this->request->post['captcha'])) {
$this->data['captcha'] = $this->request->post['captcha'];
} else {
$this->data['captcha'] = '';
}
Code: Select all
$_['entry_captcha'] = 'Enter the code in the box below:';
$_['error_captcha'] = 'Verification code does not match the image!';
<div class="buttons">, now add this directly before it on its own line:
Code: Select all
<br />
<b><?php echo $entry_captcha; ?></b><br />
<input type="text" name="captcha" value="<?php echo $captcha; ?>" />
<br />
<img src="index.php?route=information/contact/captcha" alt="" />
<?php if ($error_captcha) { ?>
<span class="error"><?php echo $error_captcha; ?></span>
<?php } ?>
<br />