I'm developing an extension for opencart 2.3. I want to retrieve the order Id when a customer comes to checkout/success page. This is my code in the extension?
if(isset($this->request->get['route']) && $this->request->get['route'] == "checkout/success")
{
if (isset($this->session->data['order_id']) && (!empty($this->session->data['order_id'])))
{ $order_id = $this->session->data['order_id']; ... }
}
I know this doesn't work because I saw this code unset($this->session->data['order_id']);
in \catalog\controller\checkoutsuccess.php
.
can anybody help me about this without touching to main document of opencart
?