Hello,
I can't get the plugin to work with the badge.
I followed the simple instructions on this page:
https://www.joomla.it/blog/8982-attivare-invisible-recaptcha-su-joomla-3-9.html
but without success.
I forget something? or the plugin does not work?
Thanks.
Joomla 3.9.9
ok, i discovered that it works only for joomla contact form.
If i check "Use Recaptcha for registration" in virtuemart, Recaptcha v3 doesn't works.
Anyone knows if is it possible to make it work wherever are displayed form module? for example registration/edit virtuemart profile page and checkout page?
thanks.
Hello,
for fix the issue, i imported the plugin in virtuemart registration view page.
Thank you.
Please share your knowledge with the project and post how you solved it.
Hello Milbo,
i added the following code:
<?php
JPluginHelper::importPlugin('captcha', 'recaptcha_invisible');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onInit','jform_captcha');
$plugin = JPluginHelper::getPlugin('captcha', 'recaptcha_invisible');
$params = new JRegistry($plugin->params);
?>
<div id="jform_captcha" class=" required g-recaptcha" data-sitekey="<?php echo $params->get('public_key', 'default_value') ?>" data-badge="<?php echo $params->get('badge', 'default_value') ?>" data-size="invisible" data-tabindex="0" data-callback="" data-expired-callback="" data-error-callback="" data-recaptcha-widget-id="0"></div>
I'm not sure this is the right way, anyway it works ... waiting for native implementation :-)
maybe someone can try and give me feedback.
bye
Hi! in my case I changed renderCaptcha helper function in /components/com_virtuemart/helpers/shopfunctionsf.php and changed $id and $reCaptchaName
static public function renderCaptcha($config = 'reg_captcha',$id = 'dynamic_recaptcha_invisible_1'){
if(VmConfig::get ($config) and JFactory::getUser()->guest==1 ){
$reCaptchaName = 'recaptcha_invisible'; // the name of the captcha plugin - retrieved from the custom component's parameters
JPluginHelper::importPlugin('captcha', $reCaptchaName); // will load the plugin selected, not all of them - we need to know what plugin's events we need to trigger
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onInit', $id);
$output = $dispatcher->trigger('onDisplay', array($reCaptchaName, $id, 'class="g-recaptcha required"'));
return isset($output[0])? $output[0]:'';
}
return '';
}
Then in the user edit template changed the hardcoded recaptcha display code by this
echo $this->captcha;
// captcha addition
/*if(VmConfig::get ('reg_captcha')){
JHTML::_('behavior.framework');
JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onInit','dynamic_recaptcha_1');
?>
<div id="dynamic_recaptcha_1"></div>
<?php
}*/
QuoteHi! in my case I changed renderCaptcha helper function in /components/com_virtuemart/helpers/shopfunctionsf.php and changed $id and $reCaptchaName
I am not sure of the correct reason for this development.
If my developer modifies the core code of VirtueMart without proper justification, I will not accept it.
In my opinion, there is no reason to modify the core code of VitueMart and it is better to keep the original proposed modification for loading the captcha plugin in the template.
The next time you upgrade, the edit will not be overwritten.
What do you think about it?
Could razor7 or guardiano78 please explain how to test this and prove it is working?
I have tried both methods, and can see the correct JS includes in the head of the source, and what I think is the correct dix within the user registration template file. When I register new users, I'm not seeing any requests appear in my Google reCaptcha console.
Here is the snippet appearing in the registration form:
<div id="dynamic_recaptcha_invisible_1" class="required g-recaptcha" data-sitekey="[sitekey]" data-badge="bottomright" data-size="invisible" data-tabindex="0" data-callback="" data-expired-callback="" data-error-callback=""></div>
I'm trying razor7's method with the change to the helper function at the moment, but tried guardiano78's suggestion beforehand with similar results.
Invisible recaptcha work on Joomla registration too(without core hacks).
So if Vm follow the core way to render recaptcha, it should work with any captcha plugins
For eg a code to adapt here https://joomla.stackexchange.com/questions/15856/how-can-i-use-google-recaptcha-in-my-custom-page
and
https://stackoverflow.com/questions/28065375/how-to-add-recaptcha-to-contact-form
Not that on init the id need not to be set in Joomla 3 and the Joomla trigger onCheckAnswer do not need post values. But to prevent google namespace problem with other form, it's better too use own ID for eg. vm_captcha_field
This thread is marked solved - but I dont see a way to actually get the invisible recaptcha working on the registration form?!
What am I missing?
http://forum.virtuemart.net/index.php?topic=145984.0
Hi and happy new year, i have the same problem and i make a template override /html/com_virtuemart/user/edit.php
i change code and i add a code from a friend added at this post eariler guardiano78
//stAn - with hidden config of reg_captcha_logged=1 we can trigger captcha for logged in if needed as well, or add user input filter plugin for antispam
JPluginHelper::importPlugin('captcha', 'recaptcha_invisible');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onInit','jform_captcha');
$plugin = JPluginHelper::getPlugin('captcha', 'recaptcha_invisible');
$params = new JRegistry($plugin->params);
?>
<div id="jform_captcha" class=" required g-recaptcha" data-sitekey="<?php echo $params->get('public_key', 'default_value') ?>" data-badge="<?php echo $params->get('badge', 'default_value') ?>" data-size="invisible" data-tabindex="0" data-callback="" data-expired-callback="" data-error-callback="" data-recaptcha-widget-id="0"></div>