Jump to content

reCAPTURE on Old V3 Site

Recommended Posts


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


Link to post
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 post
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 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>

Tried this

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

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...