Post by RichMo » Tue Jul 24, 2012 11:26 pm

Hi,

I would like to be able to redirect my customer back to the page they were viewing when they clicked 'login'. For example, if they are viewing a product, or any other page on my website.

I have ubercheckout mod installed which does redirect the login to its own pages. I was thinking of changing the vqmod file for this so that it can capture a $_GET[] variable, but its not working. I think perhaps it is not picking up the $_GET value.

I changed the xml code that modifies catalog/controller/checkout/checkout.php

Code: Select all

// Uber checkout redirect
			if ($this->config->get('uber_checkout_status')) {
				if ($this->request->get['redir'] != "") {
					$url = "http://www.example.com/".$this->request->get['redir']."?p=".$this->request->get['p'];
					$this->redirect($url);
					} else {
						$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/checkout_two');
					}
				}
I suppose I can not read the GET this way right? How might I do this?

New member

Posts

Joined
Tue Jul 10, 2012 5:54 pm

Post by boxaltcoin » Sun Mar 20, 2022 1:51 am

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

find for this

Code: Select all

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

Code: Select all

 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

Newbie

Posts

Joined
Tue Mar 15, 2022 12:56 am

Post by straightlight » Sun Mar 20, 2022 3:34 am

boxaltcoin wrote:
Sun Mar 20, 2022 1:51 am
You would need to edit catalog/controller/account/login.php

find for this

Code: Select all

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

Code: Select all

 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
viewtopic.php?f=20&t=86758#p839642

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 32 guests