sub_total.php (630B)
1 <?php 2 class ModelExtensionTotalSubTotal extends Model { 3 public function getTotal($total) { 4 $this->load->language('extension/total/sub_total'); 5 6 $sub_total = $this->cart->getSubTotal(); 7 8 if (!empty($this->session->data['vouchers'])) { 9 foreach ($this->session->data['vouchers'] as $voucher) { 10 $sub_total += $voucher['amount']; 11 } 12 } 13 14 $total['totals'][] = array( 15 'code' => 'sub_total', 16 'title' => $this->language->get('text_sub_total'), 17 'value' => $sub_total, 18 'sort_order' => $this->config->get('sub_total_sort_order') 19 ); 20 21 $total['total'] += $sub_total; 22 } 23 }