BUG: Registration Captcha / One Page Checkout

17.11.2013 21:09
#1
jrrabi
Joomshopping forum user no avatar
Name: Jens Rabenseifner
21.09.2010
Posts: 273
Quote
BUG: Registration Captcha / One Page Checkout

I installed One Page Checkout, Cart.
Now: people should register with captcha.
But it isn't visibel anymore.

I disabled it yet, because nobody can register at the moment.
Please help
THX


Joomla: 2.5.14
JoomShopping: 3.15
PHP: 5.4
MySQL: 5
Website Url: www.cajudoo.de
 
17.11.2013 21:50
#2
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 16480
Quote
Aw: BUG: Registration Captcha / One Page Checkout

Registration Captcha plugin?

 
17.11.2013 22:09
#3
jrrabi
Joomshopping forum user no avatar
Name: Jens Rabenseifner
21.09.2010
Posts: 273
Quote
Aw: BUG: Registration Captcha / One Page Checkout

Yes

 
20.11.2013 08:43
#4
mishazegrya
Joomshopping forum user no avatar
Name: Misha
01.06.2012
Posts: 72
Quote
Aw: BUG: Registration Captcha / One Page Checkout

This problem its present only on login page (component/jshopping/user/login.html).
On registration page (component/jshopping/user/register.html) captcha work
Aw: BUG: Registration Captcha / One Page Checkout

 
21.11.2013 10:46
#5
jrrabi
Joomshopping forum user no avatar
Name: Jens Rabenseifner
21.09.2010
Posts: 273
Quote
Aw: BUG: Registration Captcha / One Page Checkout

mh, I'm only using the login page...

 
21.11.2013 12:29
#6
mishazegrya
Joomshopping forum user no avatar
Name: Misha
01.06.2012
Posts: 72
Quote
Aw: BUG: Registration Captcha / One Page Checkout

Solution for you:

1. Add in file /components/com_jshopping/templates/addon_checkoutajax/checkoutajax.php after line 55 code:
<?php if ($task == 'register') : ?>
<script type = "text/javascript">
window.addEvent('domready', function() {Recaptcha.create("YOUR_PUBLIC_KEY", "dynamic_recaptcha_1", {theme: "YOUR_THEME(Ex:white)",<?php echo getLanguageForCaptcha(); ?>tabindex: 0});});
</script>
<?php endif; ?>


then on top of this file after
$jshopConfig = JSFactory::getConfig();

add

function getLanguageForCaptcha() {
// Initialise variables
$language = JFactory::getLanguage();

$tag = explode('-', $language->getTag());
$tag = $tag[0];
$available = array('en', 'pt', 'fr', 'de', 'nl', 'ru', 'es', 'tr');

if (in_array($tag, $available))
{
return "lang : '" . $tag . "',";
}

// If the default language is not available, let's search for a custom translation
if ($language->hasKey('PLG_RECAPTCHA_CUSTOM_LANG'))
{
$custom[] ='custom_translations : {';
$custom[] ="\t".'instructions_visual : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_VISUAL') . '",';
$custom[] ="\t".'instructions_audio : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_AUDIO') . '",';
$custom[] ="\t".'play_again : "' . JText::_('PLG_RECAPTCHA_PLAY_AGAIN') . '",';
$custom[] ="\t".'cant_hear_this : "' . JText::_('PLG_RECAPTCHA_CANT_HEAR_THIS') . '",';
$custom[] ="\t".'visual_challenge : "' . JText::_('PLG_RECAPTCHA_VISUAL_CHALLENGE') . '",';
$custom[] ="\t".'audio_challenge : "' . JText::_('PLG_RECAPTCHA_AUDIO_CHALLENGE') . '",';
$custom[] ="\t".'refresh_btn : "' . JText::_('PLG_RECAPTCHA_REFRESH_BTN') . '",';
$custom[] ="\t".'help_btn : "' . JText::_('PLG_RECAPTCHA_HELP_BTN') . '",';
$custom[] ="\t".'incorrect_try_again : "' . JText::_('PLG_RECAPTCHA_INCORRECT_TRY_AGAIN') . '",';
$custom[] ='},';
$custom[] ="lang : '" . $tag . "',";

return implode("\n", $custom);
}

// If nothing helps fall back to english
return '';
}


2. On file /plugins/jshoppingcheckout/checkoutajax/checkoutajax.php after line 28 add code
JHtml::_('script', 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js');


 
Copyrights MAXXmarketing GmbH. All Rights Reserved