Page 1 of 1

User login lost on redirect.

Posted: Wed Oct 05, 2022 8:55 pm
by Pittino
Hi,
on opencart 4.0.1.1 when I try to redirect to checkout (for example on payment cancellation) I lost the user login connection and Opencart will not re-present the checkout but the empty cart page (no user login connection):
this is the code that I use after payment cancellation:
if ($charge->status === 'ACCEPTED') {
$this->load->model('checkout/order');
$this->model_checkout_order->addOrderHistory($charge->metadata->order_id, 1);
$this->response->redirect($this->url->link('checkout/success'));
} else {
$this->response->redirect($this->url->link('checkout/checkout'));
}
The code
$this->response->redirect($this->url->link('checkout/checkout'));
not work properly.
Can someone help me?
Thanks so much.

Re: User login lost on redirect.

Posted: Wed Oct 05, 2022 9:53 pm
by xxvirusxx
Replace with latest github version and see if work
https://github.com/opencart/opencart

Re: User login lost on redirect.

Posted: Wed Oct 05, 2022 11:07 pm
by straightlight
There were recent changes with the Authorize methods that were still worked on this week on the MB. It may be though to tell if those changes have been completed or if it's still a work in progress.

Re: User login lost on redirect.

Posted: Wed Oct 05, 2022 11:49 pm
by Pittino
I've tried to replace with latest github but same problem...
The http redirect link with command code : $this->response->redirect($this->url->link('checkout/checkout')); is:
index.php?route=checkout/cart&language=en-gb
and not:
index.php?route=checkout/checkout&language=en-gb

Re: User login lost on redirect.

Posted: Wed Oct 05, 2022 11:57 pm
by straightlight
I would suggest creating an issue case on the Github opencart repository and fill in the template with the detailed explanation in order to know how the described issue can be reproduced in order for the OC team to review it.

Re: User login lost on redirect.

Posted: Thu Oct 06, 2022 2:22 pm
by Pittino
Ok. I'll do it....
Thanks to all.