title: OpenCart: Get $this->session->data['order_id'] in module before ControllerCheckoutSuccess class unsets it
body: <p>I am developing an OpenCart module and struggling with getting the order_id by using <code>$this-&gt;session-&gt;data['order_id']</code>. </p>
  
  <p>My module is working fine if I comment out the part which unsets the order_id session variable in <code>ControllerCheckoutSuccess</code> class.</p>
  
  <p>How can I ensure that I get the order_id before <code>ControllerCheckoutSuccess</code> unsets it?</p>
  
  <p><strong>Edit1:</strong> I need the order id to extract details like customer name, total amount, subtotal etc for that particular order. Is there some other method by which I can get the order id?</p>
  
  <p><strong>Edit2:</strong> Added this code in <code>'store/catalog/controller/module/myModule.php'</code> in <code>index()</code> function. Using it to store order_id in temp session variable and use it on order success -</p>
  
  <pre><code>if (isset($this-&gt;session-&gt;data['temp_order_id']) 
       &amp;&amp; isset($this-&gt;request-&gt;get['route']) 
       &amp;&amp; $this-&gt;request-&gt;get['route'] == 'checkout/success')
  {
      // perform custom action
      unset($this-&gt;session-&gt;data['temp_order_id']);
  } 
  elseif (isset($this-&gt;session-&gt;data['order_id']))
  {
      $this-&gt;session-&gt;data['temp_order_id'] = $this-&gt;session-&gt;data['order_id'];
  }
  </code></pre>
  
  <p><br/>
  Please help!</p>