Re: Support Thread for Google reCAPTCHA plugin
Has anyone managed to get the recaptcha working on the create account page with FEC installed?
I've just taken over a zencart site and I'm "feeling" my way around!
I had a problem with recaptcha on the contact page but I've fixed that :)
But on the create account page (weirdly called /log-in on the frontend) I can get the Recaptcha box to show up but either ticking the box or not just refreshes the page with no errors? (nothing in the log files or server logs)
After digging I see that the FEC mod has it's own template & module files for creating accounts etc...
So I have /includes/modules/fec_create_account.php as well as the normal zencart create_account.php file
Template wise I have includes/templates/<my-template>/templates/tpl_login_default.php which seems to control the layout of the login / register page and has FEC code in it?
Zencart Version: 1.5.4
Re: Support Thread for Google reCAPTCHA plugin
Probably some stupid quirk with FEC's use of CSS/JS Loader junk.
Quote:
Originally Posted by
raindrop99
Has anyone managed to get the recaptcha working on the create account page with FEC installed?
I realize the following comment is not helpful in immediately doing what the rest of your post talks about ... but it's worth mentioning:
The first thing I delete when I find it is FEC, and all the things it adds or depends on, especially "CSS/JS Loader" stuff. All of these cause nightmares for interoperability with other plugins, and for upgrades, and for troubleshooting things that "should" work but don't work when these things are present.
When you get around to upgrading the site to a newer version, look into OPC One Page Checkout as a better replacement.
Re: Support Thread for Google reCAPTCHA plugin
NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (https://www.zen-cart.com/showthread....v1-5-7-series) could be part of the problem.
That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
lat9
NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (
https://www.zen-cart.com/showthread....v1-5-7-series) could be part of the problem.
That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.
Yes, important point!
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
lat9
NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (
https://www.zen-cart.com/showthread....v1-5-7-series) could be part of the problem.
That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.
I was looking for that post when I did by tests... maybe that helped in my testing, but also found it was easy to add another page to the notifier group to add Get-a-Quote to reCAPTCHA.. Could be the answer for the FEC question..
Just to post this again, Both ZC1.5.7b and ReCAPTCHA performed as expected. When testing URL in the comment, reCAPTCHA passed it to ZC1.5.7b and ZC stopped it dead. Which is what I would expect for reCAPTCHA is only testing for a click and not what's in the message...
Re: Support Thread for Google reCAPTCHA plugin
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)
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
raindrop99
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
Taking a quick look at FEC, to does have the NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK built in, it also seems to be doing it's own looking for a captcha.php class, so more then likely some other things going on here.
To get the message change 'create_account' to 'login'...
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
lat9
NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (
https://www.zen-cart.com/showthread....v1-5-7-series) could be part of the problem.
That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.
Now that 1.5.7b is out, mind you only a few weeks ago, that did solve the issue with the observers. Thank you for pointing out that 1.5.7 had this bug in it. For the last several months I've been banging my head trying to get this to work as I have been flooded with spam emails from the contact us page. I'm not one to jump right on to each update as I have a modified ZC that I winmerge all the files to check for changes before uploading blindly, which is why I didn't upgrade to 157b as soon as it came out. But now that 157b address the observers, the commenting out that I posted earlier is no longer needed. Thank you all for putting up with my rants as I was not the politest in my posts.
Re: Support Thread for Google reCAPTCHA plugin
Whether you jump on the new right away or not, it's a good idea to use the thread tools and subscribe to the thread at https://www.zen-cart.com/showthread....n&goto=newpost
Do the same for all the new versions and the forum will keep you up to date with changes.
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
davewest
Taking a quick look at FEC, to does have the NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK built in, it also seems to be doing it's own looking for a captcha.php class, so more then likely some other things going on here.
To get the message change 'create_account' to 'login'...
Thanks Dave,
I've changed the create_account to login and I still don't get an error message when recaptcha fails? Any ideas please?
This is what I changed
Code:
'NOTIFY_LOG_IN_CAPTCHA_CHECK' => 'login'
Zen Cart 1.5.4, FEC installed