Thanks to the last few posts (cheers Dave) I've had a lighbulb moment and fixed recaptcha with FEC
Because FEC doesn't use the default zencart register page - it uses the login page as a split register / login page the observer wasn't looking for the recaptcha on that page
In includes/classes/observers/class.google_recaptcha.php
Add $pages_to_check[] = 'NOTIFY_LOG_IN_CAPTCHA_CHECK'; to the array of pages to check so it becomes:
Code:
function __construct() {
//comment out any pages you do NOT want to check
$pages_to_check[] = 'NOTIFY_CONTACT_US_CAPTCHA_CHECK';
$pages_to_check[] = 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK';
$pages_to_check[] = 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK';
$pages_to_check[] = 'NOTIFY_LOG_IN_CAPTCHA_CHECK';
$this->attach($this,$pages_to_check);
}
Then in the same file update the following
Code:
if (!$resp->isSuccess()) {
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text', 'NOTIFY_LOG_IN_CAPTCHA_CHECK' => 'create_account');
$messageStack->add($event_array[$eventID], $resp->getErrors());
$error = true;
}
This now seems to be working fine - although there is no error is you don't tick the recaptcha? (must have missed something)
Bookmarks