en 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More