Ceed57 Posted September 8, 2020 Share Posted September 8, 2020 (edited) Bonjours j'ai installé un rcaptcha sur la connexion utilisateur du coup j'ai override la classe /classes/form/CustomerLoginFormCore.php dans override/classes/form/CustomerLoginFormCore.php Jusque-là tout va bien sa fonctionne , mais j'aimerais pourvoir utiliser parent::submit(); qui normalement (si j'ai bien compris) exécute la méthode "non override" cela évite un copier/collier du code et utile pour les futur Maj de prestashop class CustomerLoginFormCore extends AbstractForm { public function submit() { if($this->rcaptcha($_POST['g-recaptcha-response'])) { /**********************************/ if ($this->validate()) { Hook::exec('actionAuthenticationBefore'); $customer = new Customer(); $authentication = $customer->getByEmail( $this->getValue('email'), $this->getValue('password') ); if (isset($authentication->active) && !$authentication->active) { $this->errors[''][] = $this->translator->trans('Your account isn\'t available at this time, please contact us', [], 'Shop.Notifications.Error'); } elseif (!$authentication || !$customer->id || $customer->is_guest) { $this->errors[''][] = $this->translator->trans('Authentication failed.', [], 'Shop.Notifications.Error'); } else { $this->context->updateCustomer($customer); Hook::exec('actionAuthentication', ['customer' => $this->context->customer]); // Login information have changed, so we check if the cart rules still apply CartRule::autoRemoveFromCart($this->context); CartRule::autoAddToCart($this->context); } } return !$this->hasErrors(); /**********************************/ // parent::submit(); }else { return false; } } } si vous avez des pistes ou solutions je suis preneur cordialement Edited September 8, 2020 by Ceed57 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now