http-redirectauthenticationopencartopencart-3

How to redirect to same page after login in opencart 3.0.2.0?


How to redirect to same page viewed page after login in opencart 3.0.2.0?

Any one please help me

Thanks


Solution

  • You would need to edit catalog/controller/account/login.php

    find for this

    if ($this->customer->isLogged()) {
            $this->response->redirect($this->url->link('account/account', '', true));
        }
    

    and replace it by

     if ($this->customer->isLogged()) {  
         $this->response->redirect($this->url->link('account/account', '', 'ture'));
    }elseif(!isset($this->session->data['redirect']) && isset($_SERVER['HTTP_REFERER'])){
    $this->session->data['redirect'] = $_SERVER['HTTP_REFERER'];
    }
    

    Hope this might help You