Title about sums it up.
Something like this
If (customer came from a different page on my site) {
redirect back to that page;
} else {
redirect as usual;
}
Any ideas on this?
The first thing you do is set up the url in a session variable on the page you are trying to go to. For example if you are trying to go to your account section then in the account.php control file just add:
Now in the login.php control just add the redirect after a successful login. Fill it in with the session variable:
or if you have ampersands involved
Code: Select all
$this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL');
Code: Select all
$this->redirect($this->session->data['redirect']);
Code: Select all
$this->redirect(str_replace('&', '&', $this->request->post['redirect']));
Since I won't know what page the user will come from, I should put
at the top of each tpl file, with account/account being changed?
Code: Select all
$this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL');
I would suggest going with a "header login" extension. So, the customer can be on any page and log in directly from the header, staying on the same page after login (or being redirected to another page if you wish).
I use this one:
http://www.opencart.com/index.php?route ... on_id=2609
And I use the "stay on same page or redirect to whatever" redirects from this one:
http://www.opencart.com/index.php?route ... on_id=6979
The second one has several redirects set up for different pages (homepage, login page, logout page, everything else).
I use this one:
http://www.opencart.com/index.php?route ... on_id=2609
And I use the "stay on same page or redirect to whatever" redirects from this one:
http://www.opencart.com/index.php?route ... on_id=6979
The second one has several redirects set up for different pages (homepage, login page, logout page, everything else).
I cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
Active Member
An extension for this on the Opencart.
https://www.opencart.com/index.php?rout ... n_id=13998
It has 3 features: Page after login. Page after logout. Plus Strict Login.
https://www.opencart.com/index.php?rout ... n_id=13998
It has 3 features: Page after login. Page after logout. Plus Strict Login.
Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com
Who is online
Users browsing this forum: psytanium and 16 guests