Activate google recaptcha at registration page in Opencart
Activate google recaptcha at registration page in Opencart

Go to the link below to see how to setup in OpenCart version 2.3.0.1
https://webocreation.com/blog/set-google-recaptcha-basic-captcha-opencart-2-3-0-1

In part 1 we showed how to activate google reCaptcha in contact us page, now let’s show it in registration page. Although it is not that simple as showing in the contact us page, we have to make change in code. For now I am not using OCMOD, i am changing directly into the default file although it is not recommended :). I will try to provide OCMOD soon in next post so you need to wait for next post.

Steps are as follows:

Changes to be made at the language file:

  1. First go to catalog/language/english/account/ and open register.php file.
  2. Add the following code to the end of the file.
  3. Save the file

Changes to be made at the controller file:

  1. Go to catalog/controller/account/ and open register.php file
  2. Find following lines of code which is inside index method
  3. Just above that code paste following code
  4. Now find following lines of code which is inside validate method.
  5. Now above that code paste following code.
  6. Save the file and your controller is ready

Changes to be made at the template theme file:

  1. Go to catalog/view/theme/default*/account/ and open register.tpl
    default* means if you are not using default theme then it will be theme name you are using.
  2. Find following line of code
  3. Just above the code above, paste the following code
  4. Save the file

Now go to your registration page and you will see the page like below:

Activate google recaptcha at registration page in Opencart
Activate google recaptcha at registration page in Opencart

Let me know if I missed anything and if you need any help.

Thanks
Rupak Nepali

4 COMMENTS

  1. Really great tutorial, thank you a lot! 🙂

    “Go to catalog/view/theme/default*/account/ and open register.tpl”
    should be
    “Go to catalog/view/theme/default*/template/account/ and open register.tpl”

LEAVE A REPLY

Please enter your comment!
Please enter your name here