Jump to content

SlideCaptcha Problem in Prestashop 1.5.3.1


Recommended Posts

Hi,

 

I tried to implement SlideCaptcha version:2.0 module in PS 1.5.3.1 for the account creation form but the slider does not appear on the first load and account is created if no error occurs, slider appears only if form errors are generated. What seems to be the problem?

 

All suggestions are appreciated.

 

Regards,

FH

Link to comment
Share on other sites

Hi,

 

I added the following code in the authentication.tpl file just above the submit button,

 

<fieldset class="account_creation">

<div class="exclusive">{include file="$tpl_dir./../../modules/slidecaptcha/slidecaptcha.tpl"}</div>

</fieldset>

 

<p class="cart_navigation required submit">

<input type="hidden" name="email_create" value="1" />

<input type="hidden" name="is_new_customer" value="1" />

{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}

 

<input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="exclusive" />

<span><sup>*</sup>{l s='Required field'}</span>

</p>

</form>

{/if}

 

I hope this gets the idea clear.

 

Regards,

FH

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 3 weeks later...
  • 2 months later...

you should ask module developer, his nickname is: @shacker he is very helpfull and i suppose that he will fix it for each of you

 

Looks like @shacker is too busy with other developments. We should help him guys.

However it would be nice to have you involved @shacker as this module will need an upgrade.

 

I was trying to resolve this issue and I think I have got a bit ahead.

 

Here is what I discovered:

 

First the module works just fine on Contact Us form and fails to load the first time on Create an account page. Nothing new, we all know that.

 

Why? That's a million dollar question...

 

This is because 'Create an account' page is an asynchronous call to the authentication page itself and the module code works on document.ready jQuery call. Let me explain...

 

Problem:

If you look into '/themes/default/authentication.tpl', the page has four forms, first two 'Email to create a new account' and 'User login' forms are displayed when you first access this page.

 

At this stage; if slide captcha module is working properly, you have 'slidecaptcha-footer.tpl' code in the footer of your web page. You can see this using developers tool of the browser you are using. You will see the necessary jQuery reference on the web page.

 

The 'slidecaptcha.tpl' however does not get loaded until the last form 'Create an account' is called using ajax. This is when you type email and hit 'Create an account'. 

If you look carefully in the code of 'slidecaptcha-footer.tpl', you will see that there is a jQuery doing some operation on document.ready event. Which means that the query will run only when the page is loaded first time and not on ajax calls.

 

Hence you see the slider second time onwards when there is error on page. In this situation the request is being sent to server and back to show 'Create an account' form along with 'slidecaptcha.tpl'.

 

 

Solution:

 

Here is what I did...

I added another line of code just after 'slidecaptcha.tpl' call. My code looks like follows inside last form on 'authentication.tpl' page.

 

<input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="exclusive submitMessage" />
<span><sup>*</sup>{l s='Required field'}</span>

                {include file="$tpl_dir./../../modules/slidecaptcha/slidecaptcha.tpl"}

                {include file="$tpl_dir./../../modules/slidecaptcha/slidecaptcha-footer.tpl"}

 

You will also not that the submit button has a different name and id 'submitAccount'. That holds the key to why Register button does not hide where as 'Send' button does on Contact Us page.

 

Easy fix I just added a class 'submitMessage' as you can see in above code.  :rolleyes:

 

Well guess what, after saving and accessing the form in browser, I could see the slider and Register button was hidden. Oh... my god....  :D  I was the happiest man on earth at that very moment.

 

Only until I slided the slider to right....

 

and nothing happened....  :o

 

I thought I had it solved.... yes I got as exited as you guys but I was that....... ||....... close to fixing the problem.

 

For some reason the slider loses its event listeners or the randon Id that gets generated for the slider is not registered and it does not work.

Now I have a dead form that just does not want to register. (ofcourse I can roll back changes and have a live form again with all the spams). :huh:

 

But I have hit a wall with it and I need @shacker to please please please help us. As you have more knowledge that any one of us here.

 

By the way guys have you thought of donating a bit to this guy, I think this is a great module and deserves a bit more funding.

 

Please help!

Edited by amit.monash (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...