Jump to content

reCAPTURE on Old V3 Site


garywhitling

Recommended Posts

Hi,

I need to add a reCAPTURE to an old version 3 cube cart store and was wondering if this has been done before?

I have the code for the reCAPTURE however i require some pointers as to how i can get it to become part of the registration form (i.e a user is not able to complete the sign up unless they pass the reCAPTURE test)

Any help would be much appreciated

Gary

Link to comment
Share on other sites

The CC3 style of submitting a form is to send the name of the form to a javascript function via an <a href="javascript:submitDoc('registerForm');"> tag.

Depending what Google's reCaptcha API is looking for, you may need to change this to a form's <input type="submit"> button.

But, you would put the javascript you acquired in the skin's /styleTemplates/global/index.tpl file, <head> section.

Then you may need to add an identifying class (according to what the javascript needs to find) to the form's button that initiates the 'submit' action. That is in the /styleTemplates/content/reg.tpl file.

Link to comment
Share on other sites

  • 2 weeks later...

Hi bsmither,

Thank you for the help,

I can get the reCapture showing on the page, however i cannot seem to get it linked to the current submit and continue button. 

When i say link i mean that the reCapture is not having any effect on the page (Someone can just bypass it and still continue)

I added the following to the /styleTemplates/global/index.tpl and the /styleTemplates/global/cart.tpl

<!-- Start - reCapture by Gary -->
    <script type="text/javascript">
  var onloadCallback = function() {
    alert("grecaptcha is ready!");
  };
</script>
    
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>    
<!-- End - reCapture by Gary -->     

and added the following to the reg.tpl page

I have moved the code around the page to try different things but have been unsuccesful 

Tried this

<form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="my site key details removed"></div>
            </form>

Tried this

<form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="my site key details removed"></div>
      <br/>
      <input type="submit" value="Submit">
            </form>

This is the code for the submit button

<a href="javascript:{VERIFY_TAX_FORMAT} submitDoc('registerForm');" class="txtButton" tabindex="17" >{LANG_REGISTER_SUBMIT}</a>

Should some of the code be added to this link?

Any suggestions 🙂

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...