Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aeyoll/pow-captcha-for-prestashop
A PrestaShop module for validating forms using Pow Captcha
https://github.com/aeyoll/pow-captcha-for-prestashop
captcha pow-captcha prestashop
Last synced: 2 months ago
JSON representation
A PrestaShop module for validating forms using Pow Captcha
- Host: GitHub
- URL: https://github.com/aeyoll/pow-captcha-for-prestashop
- Owner: aeyoll
- Created: 2023-10-13T10:09:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-01T12:48:46.000Z (6 months ago)
- Last Synced: 2024-09-27T11:41:15.854Z (3 months ago)
- Topics: captcha, pow-captcha, prestashop
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
---PHP 7.1+ and php_curl is needed to use this module.
Installation
---### PrestaShop 1.7+
For PrestaShop 1.7+, require the plugin with Composer using the following command:
```sh
composer require aeyoll/pow_captcha
```### PrestaShop 1.6
For Prestashop 1.6, this minimum composer.json file is required at the root of your project.
```json
{
"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:
```php
/**
* 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
---In each form template, add the following above the submit button:
```
{hook h='displayBeforeContactFormSubmit' m='pow_captcha'}
```