PHPackages                             aeyoll/pow\_captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aeyoll/pow\_captcha

ActivePrestashop-module[Utility &amp; Helpers](/categories/utility)

aeyoll/pow\_captcha
===================

PowCaptcha for PrestaShop

14231PHP

Since May 15Pushed 4w ago1 watchersCompare

[ Source](https://github.com/aeyoll/pow-captcha-for-prestashop)[ Packagist](https://packagist.org/packages/aeyoll/pow_captcha)[ RSS](/packages/aeyoll-pow-captcha/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Pow Captcha for PrestaShop
==========================

[](#pow-captcha-for-prestashop)

This plugin allows you to validate the contact form using Pow Captcha. Tested on PrestaShop 1.6 to 8.1.

Requirements
------------

[](#requirements)

PHP 7.1+ and php\_curl is needed to use this module.

Installation
------------

[](#installation)

### PrestaShop 1.7+

[](#prestashop-17)

For PrestaShop 1.7+, require the plugin with Composer using the following command:

```
composer require aeyoll/pow_captcha
```

### PrestaShop 1.6

[](#prestashop-16)

For Prestashop 1.6, this minimum composer.json file is required at the root of your project.

```
{
    "name": "project-name/project-name",
    "require": {
        "aeyoll/pow_captcha": "dev-main",
        "composer/installers": "^1.0.21"
    },
    "config": {
        "allow-plugins": {
            "composer/installers": true
        },
        "sort-packages": true
    },
    "minimum-stability": "dev"
}
```

Then, you need to override this Controller class (`classes/controller/Controller.php`), so the `actionControllerInitAfter` is called:

```
/**
  * Initialize the page
  */
public function init()
{
    if (_PS_MODE_DEV_ && $this->controller_type == 'admin') {
        set_error_handler(array(__CLASS__, 'myErrorHandler'));
    }

    if (!defined('_PS_BASE_URL_')) {
        define('_PS_BASE_URL_', Tools::getShopDomain(true));
    }

    if (!defined('_PS_BASE_URL_SSL_')) {
        define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));
    }

    // Override
    Hook::exec(
        'actionControllerInitAfter',
        [
            'controller' => $this,
        ]
    );
    // /Override
}
```

Usage
-----

[](#usage)

In each form template, add the following above the submit button:

```
{hook h='displayBeforeContactFormSubmit' m='pow_captcha'}

```

Configuration
-------------

[](#configuration)

You can override the default values for GetChallenge timeout and cache lifetime by defining the following constants in your `defines.inc.php` file:

To override GetChallenge timeout:

```
