Jump to content
motion2082

Add reCAPTCHA to Prestashop Version 1.6.0.14 for FREE

Recommended Posts

Thanks for the awesome module, I have been looking for a free module which provides this facility. Thanks again for giving it for free.

Can you please guide how to implement this recaptcha in the user registration page.

Share this post


Link to post
Share on other sites

@ motion2082

 

Very nice module but there is a issue.

I have tested this on my test server and the installation with the module and adding the keys went all just fine i added the code and key in contact-form.tpl and the captcha is showing correct on FO.

The problem is that you can send a message without using the captcha so it just bypass the whole captcha module ( because the send button is not hidden ).

 

It should work like this i think,

 

The send button should be hidden and will become visible when captcha has verfied succesfully ( correct me if i m wrong )

 

Hope you can fix this issue.

 

Regards,

 

ysco..

Edited by ysco

Share this post


Link to post
Share on other sites

@ motion2082

 

Very nice module but there is a issue.

I have tested this on my test server and the installation with the module and adding the keys went all just fine i added the code and key in contact-form.tpl and the captcha is showing correct on FO.

The problem is that you can send a message without using the captcha so it just bypass the whole captcha module ( because the send button is not hidden ).

 

It should work like this i think,

 

The send button should be hidden and will become visible when captcha has verfied succesfully ( correct me if i m wrong )

 

Hope you can fix this issue.

 

Regards,

 

ysco..

 

Hi ysco,

 

That's no good, try replacing module with the latest version 0.4.3

eicaptcha-master.zip

Edited by motion2082

Share this post


Link to post
Share on other sites

Can you please make this module available for prestashop 1.5

 

Give this a try first, download the module for V1.5 below

 

The eicaptcha-latest version of this module compatible with Prestashop <1.5 is the version 0.3.1 (2015-01-22)

 

If this fails, follow the instructions below:

 

In order to make this module work for PS 1.5 you will need to implement ajax calls in the configuration of a module Prestashop version 1.5.

The methods that work very well BUT with the latest version of PrestaShop did not work at all.

After analysis of the code, it appears that the management of ajax requests for prestashop modules such as we know it is not implemented for versions prior to version 1.6.0.3

To correct this, it is necessary to override the function postProcess class AdminController .

To do this properly it is necessary to create an override in the file: override / classes / controller / AdminController.php

with the following contents: (I just picked one of the last view)

<? Php  
class AdminController extends AdminControllerCore {
 
    / **
     *todo Uses redirectAdmin only if! $ This-> ajax
     * / 
    public  function postProcess ( )  { 
        if  ( $ this -> ajax )  {
 
            // Ajax-tab.php from 
            $ action  = Tools :: getValue ( 'action' ) ; 
            // no need to use displayConf () here 
            if  ( ! empty ( $action )  &&  method_exists ( $this ,  'ajaxProcess'  . Tools :: toCamelCase ( $action ) ) ) 
                return  $this -> { 'ajaxProcess'  . Tools :: toCamelCase ( $action ) } ( ) ;
 
            // Addition of code to handle the ajax actions    
                  Addition of code to manage the actions ajax modules   
                 
                      
                       
            
            
 
            elseif  ( method_exists ( $ this ,  'ajaxProcess' ) )  { 
                echo  'Calling the process modules finction ajax' ; 
                return  $ this -> ajaxProcess ( ) ; 
            } 
        }  else  {
 
            // Process list filtering 
            if  ( $ this -> filter ) 
                $ this -> processFilter ( ) ;
 
            // If the method named partner after the share exists, call "before" hooks, Then call action method, Then call "after" 
                  Hook before Call process $ return = $ this -> { 'process' . Tools :: toCamelCase ( $ this -> Action ) } ( ) ; // After Hook 
                                
                
                   
                                      
 
                return  $ return ; 
            } 
        } 
    }
 
}

Once the override in place you can make queries easily ajax in the administration of your module.

 

Here is a code that can serve as a canvas:

<?php  
if  ( ! defined ( '_PS_VERSION_' ) )  	exit ;  
class adminajax extends Module {  	
        public  function __construct ( )  	{  		
               $this -> name  =  'adminajax' ; 
		$this -> tab  =  'others' ; 
		$this -> author  =  'hhennes' ; 
		$this -> version  =  '0.4.3' ; 
		$this -> need_instance  =  0 ;
 
		Parent :: __construct ( ) ;
 
		$ This -> displayName  =  $ this -> l ( Admin ajax ' ) ; 
		$ this -> description  =  $ this -> l ( 'Sample for admin package ajax' ) ; 
	}
 
	public  function install ( ) 
	{ 
		return a parent :: install ( ) ; 
	}
 
	public  function uninstall ( ) 
	{ 
		return Parent :: uninstall ( ) ; 
	}
 
	/ **
	 * Module Configuration
	 * / 
	public  function getContent ( ) 
	{
 
		$ Output  =  'admin ajax Test on different versions of PrestaShop' ;
 
		$ Output  . =  '<script>
         $ (Document) .ready (function () {
	 $ .ajax ({
            url: "' . $ this -> Context -> link -> getAdminLink ( 'AdminModules' ) . '& configures =' . $ this -> name . '"    
            data: {
                ajax: true,
                Action: "Test"
            },
            success: function (msg) {
                alert (msg);
            },
            error: function (msg) {
                console.log ("error");
                console.log (msg);
            }
         });
        });
        </ Script> ' ;
 
		return  $ output ; 
	} 
 / **
 * Actions Ajax modules 
 * /  
 public  function ajaxProcessTest ( ) 
 {  
 echo  'Action ajax done properly :-) ;  
 }  
}

eicaptcha-latest.zip

Edited by motion2082

Share this post


Link to post
Share on other sites

 

Give this a try first, download the module for V1.5 below

 

The eicaptcha-latest version of this module compatible with Prestashop <1.5 is the version 0.3.1 (2015-01-22)

 

If this fails, follow the instructions below:

 

In order to make this module work for PS 1.5 you will need to implement ajax calls in the configuration of a module Prestashop version 1.5.

The methods that work very well BUT with the latest version of PrestaShop did not work at all.

After analysis of the code, it appears that the management of ajax requests for prestashop modules such as we know it is not implemented for versions prior to version 1.6.0.3

To correct this, it is necessary to override the function postProcess class AdminController .

To do this properly it is necessary to create an override in the file: override / classes / controller / AdminController.php

with the following contents: (I just picked one of the last view)

<? Php  
class AdminController extends AdminControllerCore {
 
    / **
     *todo Uses redirectAdmin only if! $ This-> ajax
     * / 
    public  function postProcess ( )  { 
        if  ( $ this -> ajax )  {
 
            // Ajax-tab.php from 
            $ action  = Tools :: getValue ( 'action' ) ; 
            // no need to use displayConf () here 
            if  ( ! empty ( $action )  &&  method_exists ( $this ,  'ajaxProcess'  . Tools :: toCamelCase ( $action ) ) ) 
                return  $this -> { 'ajaxProcess'  . Tools :: toCamelCase ( $action ) } ( ) ;
 
            // Addition of code to handle the ajax actions    
                  Addition of code to manage the actions ajax modules   
                 
                      
                       
            
            
 
            elseif  ( method_exists ( $ this ,  'ajaxProcess' ) )  { 
                echo  'Calling the process modules finction ajax' ; 
                return  $ this -> ajaxProcess ( ) ; 
            } 
        }  else  {
 
            // Process list filtering 
            if  ( $ this -> filter ) 
                $ this -> processFilter ( ) ;
 
            // If the method named partner after the share exists, call "before" hooks, Then call action method, Then call "after" 
                  Hook before Call process $ return = $ this -> { 'process' . Tools :: toCamelCase ( $ this -> Action ) } ( ) ; // After Hook 
                                
                
                   
                                      
 
                return  $ return ; 
            } 
        } 
    }
 
}

Once the override in place you can make queries easily ajax in the administration of your module.

 

Here is a code that can serve as a canvas:

<?php  
if  ( ! defined ( '_PS_VERSION_' ) )  	exit ;  
class adminajax extends Module {  	
        public  function __construct ( )  	{  		
               $this -> name  =  'adminajax' ; 
		$this -> tab  =  'others' ; 
		$this -> author  =  'hhennes' ; 
		$this -> version  =  '0.4.3' ; 
		$this -> need_instance  =  0 ;
 
		Parent :: __construct ( ) ;
 
		$ This -> displayName  =  $ this -> l ( Admin ajax ' ) ; 
		$ this -> description  =  $ this -> l ( 'Sample for admin package ajax' ) ; 
	}
 
	public  function install ( ) 
	{ 
		return a parent :: install ( ) ; 
	}
 
	public  function uninstall ( ) 
	{ 
		return Parent :: uninstall ( ) ; 
	}
 
	/ **
	 * Module Configuration
	 * / 
	public  function getContent ( ) 
	{
 
		$ Output  =  'admin ajax Test on different versions of PrestaShop' ;
 
		$ Output  . =  '<script>
         $ (Document) .ready (function () {
	 $ .ajax ({
            url: "' . $ this -> Context -> link -> getAdminLink ( 'AdminModules' ) . '& configures =' . $ this -> name . '"    
            data: {
                ajax: true,
                Action: "Test"
            },
            success: function (msg) {
                alert (msg);
            },
            error: function (msg) {
                console.log ("error");
                console.log (msg);
            }
         });
        });
        </ Script> ' ;
 
		return  $ output ; 
	} 
 / **
 * Actions Ajax modules 
 * /  
 public  function ajaxProcessTest ( ) 
 {  
 echo  'Action ajax done properly :-) ;  
 }  
}

 

Hi there

 

 I have Installed module for prestashop 1.5

 

The eicaptcha-latest version of this module compatible with Prestashop <1.5 is the version 0.3.1 (2015-01-22)

 

and followed your instruction written by you in first post.  The New I am not robot recaptcha which ask to match image showed up (Please note I have not done any coding till now as written in above just followed first post instruction)

 

BUT Problem is as stated by ysco two post above you can send a message without using the captcha so it just bypass the whole captcha module

 

How to fix this in prestashop 1.5 :rolleyes:

Share this post


Link to post
Share on other sites

That's not good to hear, you could try contact the developer directly - http://www.h-hennes.fr/blog/

 

I'm currently working on my own reCAPTCHA module but it's going to be a paid module as there is quite a lot of coding going into it.

 

Let me know if your interested as I will post the link here when it's complete

Edited by motion2082

Share this post


Link to post
Share on other sites

I am not robot  worked on prestashop 1.5

 

Solution :- You have choose in back office in module config page Captcha Api Version 2.  :)

Share this post


Link to post
Share on other sites

I need only CAPTCHA challenge: I do not need other lines after that how can I edit them (remove) Since this a visual captcha with photos


 


CAPTCHA challenge: Please type the distorted words you see in the box, in order and separated by a space. Doing so helps prevent automated programs from abusing this service.


If you are not sure what the words are, either enter your best guess or click the reload button next to the distorted words.


Visually impaired users can click the audio button to hear a set of words that can be entered instead of the visual challenge.


Share this post


Link to post
Share on other sites

 

I need only CAPTCHA challenge: I do not need other lines after that how can I edit them (remove) Since this a visual captcha with photos

 

CAPTCHA challenge: Please type the distorted words you see in the box, in order and separated by a space. Doing so helps prevent automated programs from abusing this service.

If you are not sure what the words are, either enter your best guess or click the reload button next to the distorted words.

Visually impaired users can click the audio button to hear a set of words that can be entered instead of the visual challenge.

 

 

line where in contact-form.tpl may inserted by this module or some other recaptha module as I have been trying differnet recapcha module from form anyway i have removed lines

Share this post


Link to post
Share on other sites

@ motion2082

 

Very nice module but there is a issue.

I have tested this on my test server and the installation with the module and adding the keys went all just fine i added the code and key in contact-form.tpl and the captcha is showing correct on FO.

The problem is that you can send a message without using the captcha so it just bypass the whole captcha module ( because the send button is not hidden ).

 

It should work like this i think,

 

The send button should be hidden and will become visible when captcha has verfied succesfully ( correct me if i m wrong )

 

Hope you can fix this issue.

 

Regards,

 

ysco..

Hello,

 

Could you please give me a sample url ?

In the last version, it's not necessary to modify the contact-form.tpl as it's done automaticaly.

 

The submit button is still visible because, a new verification is added by the module when you click on it.

As you can see in the code : https://github.com/nenes25/eicaptcha/blob/master/eicaptcha.php#L284

On the last prestashop version, everything seems to work fine as you can check in my sample plateform :

http://web.h-hennes.fr/prestashop/prestashop_1-6-0-14/index.php?controller=contact&id_lang=1

 

Regards,

Share this post


Link to post
Share on other sites

Hi guys,

 

Can this module use in login user? How can i do that?

 

 

Thanks.

 

Hello,

 

Unfortunately for now, this module is not working for user login.

It works only for the folowing cases :

  • Contact Form
  • Account Creation Form
  • Send to Friend Form
  • Product comments form

Everything about this module can be found on github, https://github.com/nenes25/eicaptcha or on my website ( in french ) : http://www.h-hennes.fr/blog/module-recaptcha-pour-le-formulaire-de-contact-prestashop/

Everyone is welcome for contributing on the developpement of this module ;-)

 

For your problem it shouldn't be too hard, the process will be aproximately the same as on the Account Creation Form.

I'll see if i can implement this fonctionnality in the next module version.

 

Regards,

 

Share this post


Link to post
Share on other sites

Can please make your last module work for PS v 1.5 so it can work on

 

Send to Friend Form

Product comments form

or can you help us with code that need to added to 0.3.1 to make it work on above two forms

Share this post


Link to post
Share on other sites

Hello,

The last version of the module is compatible with Prestashop 1.5
The version 0.3.1 is for version under Prestashop 1.5

 

In order to make Send to Friend Form or Product comments form working on your prestashop version, all you need to do is to adapt the folowing files with the Prestashop 1.5 datas ( or your specific design datas )

 

I've written 2 blog articles on how it works, but unfortunately only in french.
If you have face too much problems, i'll check if i can put default files for Prestashop 1.5

 

Regards,

Share this post


Link to post
Share on other sites

Hello,

 

The last version of the module is compatible with Prestashop 1.5

The version 0.3.1 is for version under Prestashop 1.5

 

In order to make Send to Friend Form or Product comments form working on your prestashop version, all you need to do is to adapt the folowing files with the Prestashop 1.5 datas ( or your specific design datas )

 

I've written 2 blog articles on how it works, but unfortunately only in french.

If you have face too much problems, i'll check if i can put default files for Prestashop 1.5

 

Regards,

 

Hi there,

 

           Thanks for your help.  I have downloaded  V 0.4.3 from github and installed on prestashop 1.5.4.1 on localhost. Module was installed correct and captcha came up on contacts us and account creation form. But did not show up on send to friend. I looked at tpl file on github link provided by you and I inserted code (code copied from your file is in red colour )

 

*  @author PrestaShop SA <contact@prestashop.com>

*  @copyright  2007-2014 PrestaShop SA

*  @version  Release: $Revision$

*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)

*  International Registered Trademark & Property of PrestaShop SA

*}

 

{capture name=path}{l s='Send to a friend' mod='sendtoafriend'}{/capture}

{include file="$tpl_dir./breadcrumb.tpl"}

<div id="sendfriendpage">

    <h1>{l s='Send to a friend' mod='sendtoafriend'}</h1>

 

    <p class="bold"><strong>{l s='Send this page to a friend who might be interested in the item below.' mod='sendtoafriend'}.</strong></p>

    {include file="$tpl_dir/errors.tpl"}

 

    {if isset($smarty.get.submited)}

        <p class="success">{l s='Your email has been sent successfully' mod='sendtoafriend'}</p>

    {else}

            <form method="post" action="{$request_uri}" class="std">

                <fieldset>

                    <div class="product clearfix">

                        <a href="{$productLink}" class="img_link"><img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'small_default')|escape:'html'}" alt="" title="{$cover.legend}" /></a>

                        <a href="{$productLink}" class="product_desc"><br />{$product->name}</a>

                    </div>

 

                    <div id="send_friend_form_content">

                        <p class="text">

                            <label for="friend-name">{l s='Friend\'s name' mod='sendtoafriend'}</label>

                            <input type="text" id="friend-name" name="name" value="{if isset($smarty.post.name)}{$smarty.post.name|escape:'html':'UTF-8'|stripslashes}{/if}" />

                        </p>

                        <p class="text">

                            <label for="friend-address">{l s='Friend\'s email' mod='sendtoafriend'}</label>

                            <input type="text" id="friend-address" name="email" value="{if isset($smarty.post.name)}{$smarty.post.email|escape:'html'|stripslashes}{/if}" />

                        </p>

                        

                        {* Div d'affichage du captcha( Module EiCaptcha ) *}

                        <div id="recaptchaSendToAFriend"> </div>

                    </div>

 

                        <p class="submit">

                            <input type="submit" name="submitAddtoafriend" value="{l s='send' mod='sendtoafriend'}" class="button" />

                        </p>

                    </div>

                </fieldset>

            </form>

    {/if}

 

    <ul class="footer_links">

        <li><a href="{$productLink}">« {l s='Back to product page' mod='sendtoafriend'}</a></li>

    </ul>

</div>

 

{* Eicaptcha : Pour que le captcha soit bien visible on force la largeur du bloc à 700 px @ToDo : Gérer les cas responsives *}

{literal}

<style>

#send_friend_form {width:700px;}

</style>

{/literal}

 

{addJsDef stf_secure_key=$stf_secure_key}

{addJsDefL name=stf_msg_success}{l s='Your e-mail has been sent successfully' mod='sendtoafriend' js=1}{/addJsDefL}

{addJsDefL name=stf_msg_error}{l s='Your e-mail could not be sent. Please check the e-mail address and try again.' mod='sendtoafriend' js=1}{/addJsDefL}

{addJsDefL name=stf_msg_title}{l s='Send to a friend' mod='sendtoafriend' js=1}{/addJsDefL}

{addJsDefL name=stf_msg_required}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{/addJsDefL}

 

 

For js file in sendtofriend folder it was emply so i copied everything from your js file on github saved But capcha did not show up how to make this worik

 

 

I did not test on product comment because I have disabled  product comment on my site. I would like to have captcha on send to friend.

Share this post


Link to post
Share on other sites

Hello,

 

I've check on prestashop 1.5.4.1, and it changes a bit from the current 1.6 version.
There is no js files for the module sendtofriend.

 

But it's not too complicated to add the captcha, you have to create a file in themes/default/modules/sendtoafriend/sendtoafriend-extra.tpl ( replace default by the theme your site is using )
Then juste paste the folowing content in this file.

<script text="javascript">
{literal}
$('document').ready(function(){
	$('#send_friend_button').fancybox({
		'hideOnContentClick': false
	});

	$('#sendEmail').click(function(){
		var datas = [];
		$('#fancybox-content').find('input').each(function(index){
			var o = {};
			o.key = $(this).attr('name');
			o.value = $(this).val();
			if (o.value != '')
				datas.push(o);
		});
		
	//Module Eicaptcha
        if (!grecaptcha.getResponse()) {
			$.ajax({
				method: "POST",
				url: checkCaptchaUrl,
				data: "action=display_captcha_error",
				success: function (msg) {
					$("#send_friend_form_error").html("").html(msg);
				}
				});

			return false;
		}
		if (datas.length >= 3)
		{
			$.ajax({
				{/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal}
				type: "POST",
				headers: {"cache-control": "no-cache"},
				data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/u/g, '%u'))},{/literal}{literal}
				dataType: "json",
				success: function(result){
					$.fancybox.close();
				}
			});
		}
		else
			$('#send_friend_form_error').text("{/literal}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{literal}");
	});
});
{/literal}
</script>
<li class="sendtofriend">
	<a id="send_friend_button" href="#send_friend_form">{l s='Send to a friend' mod='sendtoafriend'}</a>
</li>

<div style="display: none;">
	<div id="send_friend_form">
			<h2 class="title">{l s='Send to a friend' mod='sendtoafriend'}</h2>
			<div class="product clearfix">
				<img src="{$link->getImageLink($stf_product->link_rewrite, $stf_product_cover, 'home_default')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$stf_product->name|escape:html:'UTF-8'}" />
				<div class="product_desc">
					<p class="product_name"><strong>{$stf_product->name}</strong></p>
					{$stf_product->description_short}
				</div>
			</div>
			
			<div class="send_friend_form_content">
				<div id="send_friend_form_error"></div>
				<div class="form_container">
					<p class="intro_form">{l s='Recipient' mod='sendtoafriend'} :</p>
					<p class="text">
						<label for="friend_name">{l s='Name of your friend' mod='sendtoafriend'} <sup class="required">*</sup> :</label>
						<input id="friend_name" name="friend_name" type="text" value=""/>
					</p>
					<p class="text">
						<label for="friend_email">{l s='E-mail address of your friend' mod='sendtoafriend'} <sup class="required">*</sup> :</label>
						<input id="friend_email" name="friend_email" type="text" value=""/>
					</p>
					<!-- Module EiCaptcha -->
					<div id="recaptchaSendToAFriend"> </div>
					
					<p class="txt_required"><sup class="required">*</sup> {l s='Required fields' mod='sendtoafriend'}</p>
					
				</div>
				<p class="submit">
					<input id="id_product_comment_send" name="id_product" type="hidden" value="{$stf_product->id}" />
					<a href="#" onclick="$.fancybox.close();">{l s='Cancel' mod='sendtoafriend'}</a> {l s='or' mod='sendtoafriend'} 
					<input id="sendEmail" class="button" name="sendEmail" type="submit" value="{l s='Send' mod='sendtoafriend'}" />
				</p>
			</div>
	</div>
</div>

I've manage to get it works on a basic 1.5.4.1 version.

Regards,

Share this post


Link to post
Share on other sites

I have been fighting this thing for days now. V2 selected in the back-end and It works fine in the contact and registration pages. But no matter what I try, I can not get it to work on the send to a friend or the Product reviews. The pages show up just fine but the no captcha does not show.

 

I am using PS 1.6.014 and the latest of reCaptcha-0.4.3. I have done exactly everything that is required. I have a test on my machine (xampp) and on a test server and neither one work.

 

Please help.

 

Thanks,

Jeff

Share this post


Link to post
Share on other sites

I have been fighting this thing for days now. V2 selected in the back-end and It works fine in the contact and registration pages. But no matter what I try, I can not get it to work on the send to a friend or the Product reviews. The pages show up just fine but the no captcha does not show.

 

I am using PS 1.6.014 and the latest of reCaptcha-0.4.3. I have done exactly everything that is required. I have a test on my machine (xampp) and on a test server and neither one work.

 

Please help.

 

Thanks,

Jeff

 

 

Hello,

 

You need to get the lastest module version ( in which API V2 is the only used )

https://github.com/nenes25/eicaptcha/archive/master.zip

 

Then you can read the following articles, which explain how to add the captcha on theses modules :

 

Unfortunalely they are in french ( i send you links with google translate ), i need to write them in english asap.

https://translate.google.com/translate?sl=fr&tl=en&js=y&prev=_t&hl=fr&ie=UTF-8&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F06%2F17%2Fprestashop-captcha-commentaires-produit%2F&edit-text=

https://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F05%2F22%2Fprestashop-mettre-en-place-un-captcha-sur-le-formulaire-envoyer-a-un-ami%2F

Share this post


Link to post
Share on other sites

Hello,

 

You need to get the lastest module version ( in which API V2 is the only used )

https://github.com/nenes25/eicaptcha/archive/master.zip

 

Then you can read the following articles, which explain how to add the captcha on theses modules :

 

Unfortunalely they are in french ( i send you links with google translate ), i need to write them in english asap.

https://translate.google.com/translate?sl=fr&tl=en&js=y&prev=_t&hl=fr&ie=UTF-8&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F06%2F17%2Fprestashop-captcha-commentaires-produit%2F&edit-text=

https://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F05%2F22%2Fprestashop-mettre-en-place-un-captcha-sur-le-formulaire-envoyer-a-un-ami%2F

Hi and thanks much for your help and all that you do on this module!!

Ok that got me going but there is still a problem.

The "Send to a Friend" works just fine but the "Product Review" does not. It will let me send without checking the captcha, BUT only the first time. When I try it again it gives me the error that I need to check the captcha, so I check it and it turns green but then it will not send the review. I close it and try it again and all it does now is come up with a error and say that the captcha is not validated.

Share this post


Link to post
Share on other sites

OK i've found the problem.

 

It only appears when you use captcha on both productcomments and sendtofriend module.

The version 0.4.4 should correct this issue.

 

https://github.com/n...hive/master.zip

 

Regards,

PERFECT!!!

Everything works like a champ now. Again I cant thank you enough for all of the work you are doing with this module and still putting it out there for free. To people like myself who are on a very very low start up budget, this means alot.

 

Thanks and have a great day!!,

Jeff

Share this post


Link to post
Share on other sites

Many thanks for creating it and for offering it for free, Hervé. Unfortunately, I am able to send without verifying from Send to a Friend, and Product Comments.

 

I have added following files as per instructions above:

 

js/modules/productcomments/js/productcomments.js

js/modules/sendtoafriend/sendtoafriend.js

 

modules/productcomments/productcomments.tpl

modules/sendtoafriend/sendtoafriend-extra-15.tpl & sendtoafriend-extra.tpl

Edited by Walrus

Share this post


Link to post
Share on other sites

Many thanks for creating it and for offering it for free, Hervé. Unfortunately, I am able to send without verifying from Send to a Friend, and Product Comments.

 

I have added following files as per instructions above:

 

js/modules/productcomments/js/productcomments.js

js/modules/sendtoafriend/sendtoafriend.js

 

modules/productcomments/productcomments.tpl

modules/sendtoafriend/sendtoafriend-extra-15.tpl & sendtoafriend-extra.tpl

 

Hello,

 

In order to let me help you could you please answer the folowing questions :

 

Could you please tell me the prestashop version ?

Which version of the module do you have ?

Do you use a specific theme ?

 

Regards,

Share this post


Link to post
Share on other sites

I am using a custom theme. However, it's working today on all of the pages!

 

Not sure I will keep it though because some tests are too difficult.

 

I can see users just giving up, so have disabled it in account and product comments.

 

Is it possible to add a bottom margin? Currently, the Send button is butting against it (see attached).

 

SUGGESTION

This may involve too much work but having options in Admin after install would be good.

 

For example, Enable reCAPTCHA on:

[ ] Contact page

[ ] Create Account

[ ] Product Comments

[ ] Send to a Friend

 

Very minor but consider changing labels in Admin to same as on the Google page:

reCAPTCHA site key

reCAPTCHA secret key

 

And in above order.

 

post-877408-0-79687900-1439118474_thumb.png

Share this post


Link to post
Share on other sites

Hello,

You can change margin usings css on div #captcha-box

Thanks for your returns, I will try to take your suggestions in consideration for the next module version.

 

Regards,

Share this post


Link to post
Share on other sites

Thanks that only works in browser dev tools, but not when added to my custom template's CSS, or in eicaptcha.css.

 

I had asked the theme developer for help and he suggested same fix as you. I added following with no effect:

 

#captcha-box {

 margin-bottom:12px;
 margin-left: 6px;
 }
 
Above might work on the create account page but I have disabled it there as I don't want customers to be put off. I don't think it's needed there as there are lots of required fields, which bots will have problems filling (I may be wrong about this).
 
How are you adding the box to the contact us page? It's not been modified, so there is no div with captcha-box ID to control position. Is that why the above code has no effect?
 
Thanks.

Share this post


Link to post
Share on other sites

If you add width and height to the div #captcha box on the contact-page, then the margins should be applied.

#contact #captcha box { width:305px; height:80px; margin-top:15px; ...}

Share this post


Link to post
Share on other sites

Do you mean add to contact-form.tpl following:

       <div id="captcha-box" width:305px; height:80px; margin-top:15px; margin-bottom: 12px; margin-left: 8px;></div>

 
That doesn't work. I think something is being lost in translation.  :unsure:
 
It looks to me (not CSS or PHP expert) as if the captcha-box is being added "magically" to the Contact Us page.
 
With another captcha, which works but didn't stop spammers, I had to add some code to the contact-form.tpl page, and then control it with CSS but there is nothing from eiCaptcha in contact-form.tpl to control. 

Share this post


Link to post
Share on other sites

The rule is ignored if I add to global.css (this is what theme developer also suggested, as I said above). Something unexplainable is preventing it from "sticking."

 

I just added following to global.css:

 

#captcha-box {

 border: 2px solid red;
 }
 
Result: I see a thin red line but below the captcha box.

Share this post


Link to post
Share on other sites

This problem should be linked to your custom theme, I've done what i've told you, and it works as expected as you can see on the folowing link :

http://web.h-hennes.fr/prestashop/prestashop_1-6-0-14/index.php?controller=contact

#captcha-box { width:305px; height:80px; margin-top:15px; margin-left:10px; border:1px solid #FF0000;}

Share this post


Link to post
Share on other sites

I installed module on another site that uses default theme and the rules stick, so has to be a custom theme problem. Will follow it up with developer. Thanks.

Share this post


Link to post
Share on other sites

Please consider hashing the private key, or both, in Config. For example:

 

Captcha private key [•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••w1le]

Share this post


Link to post
Share on other sites

Even Prestashop 1.6.1.1 still has no built in CAPTCHA ... ?!

I must retire for the evening with some heavy sedative to consider whether the prestashop architects are worthy of my custom ... really, YHGTBFJ ... no BOT protection what so ever. :huh: 

Share this post


Link to post
Share on other sites

Hello,

It is working on my prestashop 1.6.1.1 with default theme and V0.4.5 Module Version.
The only thing is that product comment still keep the default prestashop captcha… I do not know why.

 

One other strange thing is that the captcha is correctly installed and displayed on the contact form on my computer

The problem is that it is not displayed when I visit the contact form from a mobile phone (iPhone).

I have make a test and I have been able to send a message…

 

It is also impossible for me to have it displayed on  the "Send to a Friend Form"

 

Captcha is diplayed correctly on registration form on booth devices…

 

Someone have the same problem?

Some help on these issues?

post-1106501-0-29709100-1444250927_thumb.pngpost-1106501-0-17581000-1444250922_thumb.pngpost-1106501-0-33890100-1444250923_thumb.pngpost-1106501-0-44196000-1444250924_thumb.pngpost-1106501-0-70351100-1444250925_thumb.png

Edited by StefArts

Share this post


Link to post
Share on other sites

Hello,

 

The only thing is that product comment still keep the default prestashop captcha… I do not know why.

 

As far as i know there is no Prestashop default captcha, so i don't know from where it comes

 

To add the captcha on both produt comments and send to a friend have you folow the inscrtuctions ?

https://github.com/nenes25/eicaptcha/blob/master/install-productcomments.md

https://github.com/nenes25/eicaptcha/blob/master/install-sendtoafriend.md

 

Unfortunately i'm not able to test the captcha with an iphone device, but it works with an andoid one :-)

 

Regards,

Share this post


Link to post
Share on other sites

Thank you very much for your answer.

 

Yes I have followed the instruction in installing the module.

Please find attached files.

I also join to this answer pictures from mobile and from computer.

In the case you need more files, please let me know

 

The thing that I'm not understanding is that the register form is showing reCaptcha on both devices (Mobile & Computer) and the contact form is only displaying it on the Computer.

You can see it on the attached pictures

 

The last picture is the admin panel of ProductComments.

As you can see there is a Captcha activation button for a...

 

Thank again.

Regards

 

productcomments.js.txtproductcomments.tpl.txtsendtoafriend.js.txtsendtoafriend-extra.tpl.txtpost-1106501-0-14118400-1444298685_thumb.pngpost-1106501-0-19439500-1444298701_thumb.pngpost-1106501-0-01238200-1444298718_thumb.pngpost-1106501-0-98854700-1444298750_thumb.pngpost-1106501-0-34121700-1444298769_thumb.pngpost-1106501-0-14891800-1444298781_thumb.pngpost-1106501-0-23042900-1444298801_thumb.pngpost-1106501-0-62763800-1444301792_thumb.png

Edited by StefArts

Share this post


Link to post
Share on other sites

I have solved Product Comments.

You were right... I was not using standard Product Comment but the module Okom More Info which have an integrated captcha.

 

Resuming:

Contact form

Computer: Yes

Mobile No

 

Registration Form:

Computer: Yes

Mobile: Yes

 

Product Comment:

Computer: Yes

Mobile Yes

 

Send to a friend:

Computer: No

Mobile: No

 

Thank you

Share this post


Link to post
Share on other sites

I have solved Send to a Friend Form

 

Resuming:

Contact form

Computer: Yes

Mobile No

 

Registration Form:

Computer: Yes

Mobile: Yes

 

Product Comment:

Computer: Yes

Mobile Yes

 

Send to a friend:

Computer: Yes

Mobile: Yes

 

The Mobile contact form issue still here.

I have no idea of how to solve it.

 

Thank you.

Share this post


Link to post
Share on other sites

Hello motion2082, herve25, StefArts and Everyone,

 

I have read this topic starting from Page 1. I understand that there were issues along the way and have since been resolved. Please advise:

(1) What is the latest version of the reCAPTCHA that is workable on Contact form, Registration Form, Product Comment & Send to a Friend, for Desktop, iPad and Andriod Mobile devices?

(2) Where can we find the download link for this latest reCAPTCHA version workable for Desktop, iPad and Andriod Mobile devicces?

(3) Does the latest reCAPTCHA version work for all browsers including IE11 and Microsoft Edge?

 

I am using 1.6.1.0 and default-bootstrap theme.

 

Thank you in advance for all your great help!

Share this post


Link to post
Share on other sites

Hello,

You can dowload the latest version on github. Everything works fine.

 

Juste remember to read how to apply the captcha on the send to à friend and product comments forms.

 

Regards,

Share this post


Link to post
Share on other sites

Hi herve25,

 

I have installed it in the path themes/default-bootstrap/modules. I have also gotten the SITE KEY and SECRET KEY.

 

Pardon me, I am stuck at Step (3): "Configure your EICAPTCHA Module and enter your PUBLIC KEY and SECRET KEY, SAVE"

 

Please advise how do I configure the EICAPTCHA Module? I cannot find the module at the BO.

 

Thank you in advance for your great help!

Share this post


Link to post
Share on other sites

Hello,

 

If you can't find the module in administration you should try to upload the module by FTP.

I guess you have try to install it with ZIP file ?

Share this post


Link to post
Share on other sites

Hello,

 

If you can't find the module in administration you should try to upload the module by FTP.

I guess you have try to install it with ZIP file ?

 

Hi,

 

I follow the steps written in page one of the topic. It said: Step (2) Download "EICAPTCHA-MASTER.ZIP" below. To install you will need to do this manually by uploading the ZIP file to your MODULES folder, Extracting it and Renaming it to EICAPTCHA. Bit of a pain I know.

 

This is exactly what I did: I upload the zip file to the path themes/default-bootstrap/modules; extract the zip file and rename it to "eicaptcha". Thought I can see the folder "eicaptcha" at the cPanel , but I cannot find the module "eicaptcha" at the BO.

 

Is there something I did wrongly? Please advise?

 

Thank you.

Share this post


Link to post
Share on other sites

Hello,

 

Yes you have done a mistake.
The module should be uploaded in the "modules" directory not in "themes/default-bootstrap/modules"

 

Regards,

Share this post


Link to post
Share on other sites

Hello,

 

Yes you have done a mistake.

The module should be uploaded in the "modules" directory not in "themes/default-bootstrap/modules"

 

Regards,

 

Hello herve25,

 

It works perfectly! Thank you for your awesome help! :)

 

On a separate note, I tested the "Send to a Friend" but the email landed into the receiver's Spam Folder. How do we prevent the "Send to a Friend" email from being treated as a Spam?

 

Thank you in advance again!

Share this post


Link to post
Share on other sites

Hi herve25,

I found and installed your module after we started receiving about one spam message per day via our contact form.  Thank you very much for making this available!

 

It seems to be working fine in that the captcha appears everywhere it's supposed to.

 

At first the spam stopped, but now it's coming back. 

 

I've verified that "I am not a robot" is still appearing on my contact form, on the web and on my Android device (in Chrome). So can the "I am not a robot" be bypassed by a clever spammer?

 

thanks,

glen

 

Share this post


Link to post
Share on other sites

Hello Buzzworm,

As far as i know the google recaptcha cannot be bypassed by robots for now.
It may be a real person which is sending spam.

You can watch in your log files from where it comes

 

Regards,

Share this post


Link to post
Share on other sites

Para prestahop 1.5.6  la versión que da motion2082 en el post #7 es la que ha funcionado, añadiendo correctamente el no-capcha de google en el formulario y sin necesidad de hacer el override por diversas modificaciones, pero eso sí, seleccionanado la opcion de API v2, como dive Zen_j1.

En este caso, se trata de una web donde hay varios formularios de contacto, con sus controllers especificos para distintas secciones de la web (ya que no se queria la opción desplegable para escoger departamento) y para que el captcha funcione en todos ellos, lo que hay que hacer es duplicar en el archivo eicaptcha.php las lineas

 

            if ($this->context->controller instanceof ContactController)
                $contact_form_controller = true;

 

Cambiando ContactController por el nombre del archivo controller que gestione cada formulario duplicado y el nombre de la variable$ por otra.

Por ejemplo:

 

else if ($this->context->controller instanceof ContactPdfController)
                $contactpdf_form_controller = true;

nosotros hemos cambiado ContactController por ContactPdfController (que el controller que hemos crado para gestionar un segundo formulario de contacto independiente del que vien por defecto en prestashop) y  $contact_form_controller por  $contactpdf_form_controller

 

y un poquito más abajo

 

        if ($page_name == 'contact-form' || $contact_form_controller) {
                    if ( Configuration::get('CAPTCHA_API_VERSION') == 1 )
            return $this->displayCaptchaContactForm();
                    else
                        return $this->displayCaptachContactFormApiV2

 

Cambiando aquí también $contact_form_controller por el nombre la variable, que hallamos dado anteriormente, en nuestro caso  $contactpdf_form_controller.

Share this post


Link to post
Share on other sites

Hi

is it works on multistore? and presta 1.6.1.4? in my shop I can configure module - looks ok. but I don't have it on the front

  •  
Edited by Marshalc

Share this post


Link to post
Share on other sites

Unfortunately, it doesnt work for my custom theme (Black Hawk), at least when it comes to contact-form. Everything is fine on create account page, though.

 

Any idea how to fix it? I used latest version of this module with "enable captcha on contact form" option in back office. After turning it on nothing happens.

 

http://rdwtest1.cba.pl/pl/kontakt

 

Prestashop 1.6.1.4

Edited by sekwoja

Share this post


Link to post
Share on other sites

I believe that there is some problem with controller, because eicaptcha.php in reference to contact form adds only couple of lines written in Javascript (jQuery). And above-mentioned code does nothing more than inputting recaptcha google api by means of JS/jQuery:

$(document).ready(function(){
            
               //Add div where the captcha will be displayed
               $(".submit").before("<div id=\"captcha-box\"></div>");
               
               //Manage form submit
                $("#submitMessage").click(function(){
                    //If no response we display an error
                    if ( ! grecaptcha.getResponse() ) {
                        $.ajax({
                                method : "POST",
                                url : "'._MODULE_DIR_.$this->name.'/eicaptcha-ajax.php",
                                data : "action=display_captcha_error",
                                success : function(msg){
                                    $(".'.$error_class.'").remove();    
                                    $("form.'.$form_class.'").before(msg);
                                }
                            });
                       
                        return false;
                    }
                });
            });

This solution may be helpful for some other users having issues with reCaptcha on Prestashop. So, after hours of tries I gave up and took code delivered by google (this one below) and put it inside my header.tpl.

<script src='https://www.google.com/recaptcha/api.js'></script>

Than I copied and pasted this:

<div class="g-recaptcha" data-sitekey="GOOGLE_PUBLIC_KEY"></div>

into contact-form.tpl in my theme. After couple of tries it turned out that it still doesnt work so I opened contactController.php and added:

else   if   ( ! ( $gcaptcha   =   ( int ) ( Tools:: getValue ( 'g-recaptcha-response' ) ) ) )

$this -> errors [ ]   =   Tools:: displayError ( 'Captcha nie zweryfikowana' ) ;

before last else in line 50 in public function postProccess.

 

Now it works. I am still wondering what is wrong with EiCaptcha module, because when it comes to create account page it works like a charm. The only one problem is on contact form page.

Edited by sekwoja

Share this post


Link to post
Share on other sites

Hello,

 

I guess that your problem should be linked with your theme.
As I've tested the module on the last prestashop version ( 1.6.1.4 ) et it works well.

You've well analyse it, an html div is dynamicaly added with jquery just before the submit button of the contact form.

Then the folowing code initialize recaptcha.

//Recaptcha CallBack Function
var onloadCallback = function() {grecaptcha.render("captcha-box", {"theme" : "'.$this->themes[Configuration::get('CAPTCHA_THEME')].'", "sitekey" : "'.Configuration::get('CAPTCHA_PUBLIC_KEY').'"});};
</script>';
$js .= '<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit&hl='.Configuration::get('CAPTCHA_FORCE_LANG').'" async defer></script>';

It's almost the same as the one your suggest in your post ;-)

 

 

In fact to make it works with another theme, i guess that you just have to change to folowing line :

//Add div where the captcha will be displayed
$(".submit").before("<div id=\"captcha-box\"></div>");

And replace ".submit", with the class of your submit button.

 

Regards,
Hervé

Edited by herve25

Share this post


Link to post
Share on other sites

Is it just me or this plugin sux ?

 

I have ps 1.6.0.11

 

When sending msg it redirect me to thank You msg and when You press f5 it will send the same message You sended before. You can spam someone mail box...

Share this post


Link to post
Share on other sites

Hey guys,

 

It took me a while to figure out a FREE way to easily Add Google reCAPTCHA to PS v1.6.0.14 as most of the posts in the forums are quite outdated. Most are now PAID solutions.

 

Therefore I have decided to start this thread to assist anyone else looking for a quick FREE solution.

 

Step 1) Setup your Google reCAPTCHA Account @ https://www.google.com/recaptcha/intro/index.html

 

Step 2) Download "EICAPTCHA-MASTER.ZIP" below. To install you will need to do this manually by uploading the ZIP file to your MODULES folder, Extracting it and Renaming it to EICAPTCHA. Bit of a pain I know.

 

Step 3) Configure your EICAPTCHA Module and enter your PUBLIC KEY and SECRET KEY, SAVE

 

Step 4) Make a Copy of your "contact-form.tpl" file at "/Themes/YourTheme/contact.tpl"

 

Step 5) Open "contact.tpl" and find:

<div style="text-align:right;" class="submit">
<button type="submit" name="submitMessage" id="submitMessage" class="button btn btn-default button-medium"><span>{l s='Send'}<i class="icon-chevron-right right"></i></span></button>
</div>

For me it was on Line 141

 

Directly above this div place the following code: 

{if $captcha}
<p>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div>
</p>
{/if}

NOTE: Be sure to replace "YOUR_PUBLIC_KEY" with your Google Public Key

 

Step 6: Save "contact-form.tpl" and upload it to your "theme/yourtheme/" folder via your FTP Program

 

Final Step: Refresh your browser and test your RECAPTCHA

 

 

EDIT: 20/6/15 - Latest EiCaptcha Module 0.4.3 Added

 

Hey guys,

 

It took me a while to figure out a FREE way to easily Add Google reCAPTCHA to PS v1.6.0.14 as most of the posts in the forums are quite outdated. Most are now PAID solutions.

 

Therefore I have decided to start this thread to assist anyone else looking for a quick FREE solution.

 

Step 1) Setup your Google reCAPTCHA Account @ https://www.google.com/recaptcha/intro/index.html

 

Step 2) Download "EICAPTCHA-MASTER.ZIP" below. To install you will need to do this manually by uploading the ZIP file to your MODULES folder, Extracting it and Renaming it to EICAPTCHA. Bit of a pain I know.

 

Step 3) Configure your EICAPTCHA Module and enter your PUBLIC KEY and SECRET KEY, SAVE

 

Step 4) Make a Copy of your "contact-form.tpl" file at "/Themes/YourTheme/contact.tpl"

 

Step 5) Open "contact.tpl" and find:

<div style="text-align:right;" class="submit">
<button type="submit" name="submitMessage" id="submitMessage" class="button btn btn-default button-medium"><span>{l s='Send'}<i class="icon-chevron-right right"></i></span></button>
</div>

For me it was on Line 141

 

Directly above this div place the following code: 

{if $captcha}
<p>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div>
</p>
{/if}

NOTE: Be sure to replace "YOUR_PUBLIC_KEY" with your Google Public Key

 

Step 6: Save "contact-form.tpl" and upload it to your "theme/yourtheme/" folder via your FTP Program

 

Final Step: Refresh your browser and test your RECAPTCHA

 

 

EDIT: 20/6/15 - Latest EiCaptcha Module 0.4.3 Added

Hi, first of all Thank you for great Module, i have installed successfully. I want to ask you if its possible of course, I also want to place Recaptcha under my Sign in form, where should i paste the code please?

 

Thank you

Dilshod

Share this post


Link to post
Share on other sites

Hey guys,

 

It took me a while to figure out a FREE way to easily Add Google reCAPTCHA to PS v1.6.0.14 as most of the posts in the forums are quite outdated. Most are now PAID solutions.

 

Therefore I have decided to start this thread to assist anyone else looking for a quick FREE solution.

 

Step 1) Setup your Google reCAPTCHA Account @ https://www.google.com/recaptcha/intro/index.html

 

Step 2) Download "EICAPTCHA-MASTER.ZIP" below. To install you will need to do this manually by uploading the ZIP file to your MODULES folder, Extracting it and Renaming it to EICAPTCHA. Bit of a pain I know.

 

Step 3) Configure your EICAPTCHA Module and enter your PUBLIC KEY and SECRET KEY, SAVE

 

Step 4) Make a Copy of your "contact-form.tpl" file at "/Themes/YourTheme/contact.tpl"

 

Step 5) Open "contact.tpl" and find:

<div style="text-align:right;" class="submit">
<button type="submit" name="submitMessage" id="submitMessage" class="button btn btn-default button-medium"><span>{l s='Send'}<i class="icon-chevron-right right"></i></span></button>
</div>

For me it was on Line 141

 

Directly above this div place the following code: 

{if $captcha}
<p>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div>
</p>
{/if}

NOTE: Be sure to replace "YOUR_PUBLIC_KEY" with your Google Public Key

 

Step 6: Save "contact-form.tpl" and upload it to your "theme/yourtheme/" folder via your FTP Program

 

Final Step: Refresh your browser and test your RECAPTCHA

 

 

EDIT: 20/6/15 - Latest EiCaptcha Module 0.4.3 Added

Hi, first of all Thank you for great Module, i have installed successfully. I want to ask you if its possible of course, I also want to place Recaptcha under my Sign in form, where should i paste the code please?

 

Thank you

Dilshod

Share this post


Link to post
Share on other sites

Hello,

 

If you means in the registration form, you just have to enable the option in the module configuration.
If it's related to the login form it's not yet managed by the module.

 

Regards,

Share this post


Link to post
Share on other sites

Hi,

 

I want to add your reCaptcha module to the 'check out' page of the shopping cart? Is that possible?

 

How would I do it?

 

Thanks for sharing the code :)

 

Cheers,

Michael

Share this post


Link to post
Share on other sites

Hello,

 

You need to get the lastest module version ( in which API V2 is the only used )

https://github.com/nenes25/eicaptcha/archive/master.zip

 

Then you can read the following articles, which explain how to add the captcha on theses modules :

 

Unfortunalely they are in french ( i send you links with google translate ), i need to write them in english asap.

https://translate.google.com/translate?sl=fr&tl=en&js=y&prev=_t&hl=fr&ie=UTF-8&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F06%2F17%2Fprestashop-captcha-commentaires-produit%2F&edit-text=

https://translate.google.com/translate?hl=fr&sl=fr&tl=en&u=http%3A%2F%2Fwww.h-hennes.fr%2Fblog%2F2015%2F05%2F22%2Fprestashop-mettre-en-place-un-captcha-sur-le-formulaire-envoyer-a-un-ami%2F

 worked perfectly for me on the contact page and sendtofriend, prestashop 1.6.1.4

 

Thank you..!!!!

Share this post


Link to post
Share on other sites

Hi, Thanks for the free module!

 

I've installed and configured it and it works perfectly on the contact page.. On the new account creation page a new account can still be created without filling in the captcha input. How can I fix this? I'm on Prestashop v 1.6.1.4.

Thanks!

Share this post


Link to post
Share on other sites

Hi, Thanks for the free module!

 

I've installed and configured it and it works perfectly on the contact page.. On the new account creation page a new account can still be created without filling in the captcha input. How can I fix this? I'm on Prestashop v 1.6.1.4.

 

Thanks!

 

No problem, figured it out. Added the lines

 

{if $captcha}

                <p>

                    <script src='https://www.google.com/recaptcha/api.js'></script>

                    <div class="g-recaptcha" data-sitekey="MY_PUBLIC_KEY"></div>

                </p>

            {/if}

 

to themes/default-bootstrap/authentication.tlp above the submit button and it works fine now.

Edited by adult-cafe

Share this post


Link to post
Share on other sites

Hi herve25,

 

The Ei Captcha Module has been working fine for me. But today when I clicked the "I'm not a robot" box, the Ei Captcha shows an additional blank "Verify Box" at both the Sendtoafriend and Productcomment Modules. Please take a look at the attached screen capture for detail. It is Ok for Contact Form and Registration Form.

 

Please advise how do I rectify the issue?

 

I am using Ei Captcha v0.4.5, Prestashop 1.6.1.0, default-bootstrap.

 

I look forward to your soonest reply.

 

Thank you in advance.

 

Regards,

tspl

 

post-1074605-0-19950500-1467349832_thumb.jpg

Share this post


Link to post
Share on other sites

Hello tspl,

 

Sorry for the delay, i was not notified about your message.
If you want a quick answer, it's better to open an issue on github : https://github.com/nenes25/eicaptcha/issues

 

Is this problem still present on your website ?

 

I've checked on one of my website and i'm not able to reproduce your problem.

 

Regards,
Hervé

Share this post


Link to post
Share on other sites

Hello tspl,

 

Sorry for the delay, i was not notified about your message.

If you want a quick answer, it's better to open an issue on github : https://github.com/nenes25/eicaptcha/issues

 

Is this problem still present on your website ?

 

I've checked on one of my website and i'm not able to reproduce your problem.

 

Regards,

Hervé

 

Hello herve25,

 

Thank you for your reply. This problem has somehow resolved by itself.

 

However, I am facing another issue. Please advise how to resize the reCaptcha box so that it appear within the fancybox, particularly at the Productcomment Module? It is Ok with the Sendtoafriend Module, Contact Form and Registration Form. Please see the attached screen capture.

 

I look forward to your soonest reply.

 

Thank you in advance.

 

Regards,

tspl

 

post-1074605-0-22661600-1468918851_thumb.jpg

Share this post


Link to post
Share on other sites

Hello,

 

This problem is linked with the fact that recaptcha block is not responsive.

I've found one solution which seems to work : https://geekgoddess.com/how-to-resize-the-google-nocaptcha-recaptcha/

 

Regards,

Hervé

 

Hi herve25,

 

I am not a programmer, could you kindly advise where and which file should I put the following code?

<div class="g-recaptcha" data-theme="light"data-sitekey="XXXXXXXXXXXXX"style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>

And this as well:

<style>@media screen and (max-height: 575px){#rc-imageselect, .g-recaptcha {transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;}</style>

I am using 1.6.1.0, default-bootstrap, Product Comments module v3.5.1.

 

Thank you.

 

Regards,

tspl

Share this post


Link to post
Share on other sites

Hello,
You can simply add this code in the global.css file.

@media screen and (max-height: 575px){
#rc-imageselect, .g-recaptcha {transform:scale(0.77);-webkit-
transform:scale(0.77);transform-origin:0 0;-webkit-
transform-origin:0 0;}

It should correct your issue.

 

Regards,

Share this post


Link to post
Share on other sites

Hello,

You can simply add this code in the global.css file.

@media screen and (max-height: 575px){
#rc-imageselect, .g-recaptcha {transform:scale(0.77);-webkit-
transform:scale(0.77);transform-origin:0 0;-webkit-
transform-origin:0 0;}

It should correct your issue.

 

Regards,

 

Hi herve25,

 

Added the code to global.css, clear cache, but it does not solve the issue.

 

I also tried putting the following code in themes/default-bootstrap/modules/productcomments/productcomments.tpl:

<div class="g-recaptcha" style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>

Neither does it solve the issue.

 

What is still missing here? Please advise?

 

I look forward to your soonest reply.

 

Thank you.

 

Regards,

tspl

Share this post


Link to post
Share on other sites

Hello,

I've tried to replicate your issue but on a fresh 1.6.1.0 version I was not able to reproduce.
Which browser and what is the screen size ?

For the css i've not tested on prestashop.

 

Regards

 


 

Share this post


Link to post
Share on other sites

Hello,

 

I've tried to replicate your issue but on a fresh 1.6.1.0 version I was not able to reproduce.

Which browser and what is the screen size ?

For the css i've not tested on prestashop.

 

Regards

 

 

 

Hi herve25,

 

I am using the following. Tthe issue occurs on both platforms.

(1) Firefox 47.0.1, Screen size 1024 x 768

(2) Safari, iOS9.3.2 iPad2

 

I look forward to your soonest reply.

 

Thank you in advance.

 

Regards,

tspl

Share this post


Link to post
Share on other sites

Hey guys,

 

It took me a while to figure out a FREE way to easily Add Google reCAPTCHA to PS v1.6.0.14 as most of the posts in the forums are quite outdated. Most are now PAID solutions.

 

Therefore I have decided to start this thread to assist anyone else looking for a quick FREE solution.

 

Step 1) Setup your Google reCAPTCHA Account @ https://www.google.com/recaptcha/intro/index.html

 

Step 2) Download "EICAPTCHA-MASTER.ZIP" below. To install you will need to do this manually by uploading the ZIP file to your MODULES folder, Extracting it and Renaming it to EICAPTCHA. Bit of a pain I know.

 

Step 3) Configure your EICAPTCHA Module and enter your PUBLIC KEY and SECRET KEY, SAVE

 

Step 4) Make a Copy of your "contact-form.tpl" file at "/Themes/YourTheme/contact.tpl"

 

Step 5) Open "contact.tpl" and find:

<div style="text-align:right;" class="submit">
<button type="submit" name="submitMessage" id="submitMessage" class="button btn btn-default button-medium"><span>{l s='Send'}<i class="icon-chevron-right right"></i></span></button>
</div>

For me it was on Line 141

 

Directly above this div place the following code: 

{if $captcha}
<p>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div>
</p>
{/if}

NOTE: Be sure to replace "YOUR_PUBLIC_KEY" with your Google Public Key

 

Step 6: Save "contact-form.tpl" and upload it to your "theme/yourtheme/" folder via your FTP Program

 

Final Step: Refresh your browser and test your RECAPTCHA

 

 

EDIT: 20/6/15 - Latest EiCaptcha Module 0.4.3 Added

 

Thanks for this module! It works perfectly!!

Share this post


Link to post
Share on other sites

Hello,

I installed and setup your addon, and it seems to work fine, but not everywhere.

It's displayed on account creation page, and contact form page when you are logged in, but it's not displayed when you're not logged.

 

Best regards,

Guillaume

Share this post


Link to post