Check if your issue exists
Your prestashop version
8.1.x
Eicaptcha version
2.5.x
Do you use a specific theme ?
No
Describe the bug
I wasn't working with PrestaShop 9, but now it works if you fix the following files...
/modules/eicaptcha/override/controllers/front/AuthController.php
<?php
class AuthController extends AuthControllerCore
{
public function initContent(): void
{
if (Tools::isSubmit('submitCreate') && (int) Configuration::get('CAPTCHA_USE_AUTHCONTROLLER_OVERRIDE') === 1) {
Hook::exec('actionCustomerRegisterSubmitCaptcha');
// si NO hay errores -> flujo normal
if (!count($this->errors) && !count($this->context->controller->errors)) {
parent::initContent();
return;
}
// con errores -> reconstruir formulario
$register_form = $this
->makeCustomerForm()
->setGuestAllowed(false)
->fillWith(Tools::getAllValues());
// en PS9 usa el parent, no FrontController::initContent()
parent::initContent();
$this->context->smarty->assign([
'register_form' => $register_form->getProxy(),
'hook_create_account_top' => Hook::exec('displayCustomerAccountFormTop'),
]);
$this->setTemplate('customer/registration');
return;
}
parent::initContent();
}
}
/modules/eicaptcha/override/controllers/front/OrderController.php
<?php
class OrderController extends OrderControllerCore
{
public function postProcess(): void
{
if (
Tools::isSubmit('submitCreate')
&& version_compare(_PS_VERSION_, '8.2.1', '<') // en PS9 será false (se usa el override de Auth)
&& Module::isInstalled('eicaptcha')
&& Module::isEnabled('eicaptcha')
) {
$mod = Module::getInstanceByName('eicaptcha');
if ($mod && method_exists($mod, 'hookActionCustomerRegisterSubmitCaptcha')) {
$ok = (bool) $mod->hookActionCustomerRegisterSubmitCaptcha([]);
if ($ok === false && !empty($this->errors)) {
unset($_POST['submitCreate']);
}
}
}
parent::postProcess();
}
}
Screenshots
No response
Additional context
No response
Check if your issue exists
Your prestashop version
8.1.x
Eicaptcha version
2.5.x
Do you use a specific theme ?
No
Describe the bug
I wasn't working with PrestaShop 9, but now it works if you fix the following files...
/modules/eicaptcha/override/controllers/front/AuthController.php
/modules/eicaptcha/override/controllers/front/OrderController.php
Screenshots
No response
Additional context
No response