View Single Post
  #9  
Old 11-11-2019, 10:43 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Redirecting a customer to a custom page after login, depending on parameter

Changing the parameter name didn't help. I managed to place $this->getAllParams
in the main body of the class (using __construct), but it still picks up the parameters for login action, not the ones for arriving the login form page.



I ended up with the following code.
Code:
public function getParam() { $instance = \XLite\Core\Request::getInstance(); $fro = $instance->getData(); $url = $fro["returnURL"]; $from = parse_url($url, PHP_URL_QUERY); $pieces = explode("&",$from); foreach($pieces as $key => $value) { $part=explode("=",$value); if ($part[0]=="param") {return $part[1];} } return null; }
This does the job, but I feel somehow stupid... Anyway, thank you very much for all your help and your patience.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote