A
A
Andrey2018-10-30 10:17:53
opencart
Andrey, 2018-10-30 10:17:53

How to redirect to Opencart?

Good afternoon!
I have such a question, I made an authorization form on the site in the header, well, so that I could log in on any page. But when logging in, it redirects to the /my-account page.
And I can’t figure out a little how to fix this, opencart version 2.1
Maybe someone has come across or knows how to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azaza, 2018-10-30
@Andrey_Tech

In controller/account/login.php

if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], $this->config->get('config_url')) !== false || strpos($this->request->post['redirect'], $this->config->get('config_ssl')) !== false)) {
                $this->redirect(str_replace('&', '&', $this->request->post['redirect']));
            } else {
                $this->redirect($this->url->link('account/account', '', 'SSL'));
            }

For example, change the path from 'account/account' to 'common/home'. The redirect will go to the main page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question