title: How opencart is calculating the price using the extensions
body: <p>In the cofirmation page of opencart, the price is being calculated using some extensions, saved in database having extension type "total". Here is the code that has been used there,</p>
  
  <pre><code>$total_data = array();
  $total = 0;
  $taxes = $this-&gt;cart-&gt;getTaxes();
  
  $this-&gt;load-&gt;model('checkout/extension');
  $sort_order = array(); 
  
  $results = $this-&gt;model_checkout_extension-&gt;getExtensions('total');
  foreach ($results as $key =&gt; $value) {
      $sort_order[$key] = $this-&gt;config-&gt;get($value['key'] . '_sort_order');
  }
  
  array_multisort($sort_order, SORT_ASC, $results);
  
  foreach ($results as $result) {
      $this-&gt;load-&gt;model('total/' . $result['key']);
      $this-&gt;{'model_total_' . $result['key']}-&gt;getTotal($total_data, $total, $taxes);
  }
  
  $sort_order = array();
  
  foreach ($total_data as $key =&gt; $value) {
          $sort_order[$key] = $value['sort_order'];
  }
  
  array_multisort($sort_order, SORT_ASC, $total_data);
  </code></pre>
  
  <p>After this calculation the variable <code>$total_data</code> is used to disply in the template file as the pricing detail. I am really confused how the calculation is being done. I want to add some extra data to calculation.</p>