Jump to content

probléme override prestashop 1.7


Recommended Posts

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 by Ceed57 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...