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
not work properly.$this->response->redirect($this->url->link('checkout/checkout'));
Can someone help me?
Thanks so much.