diff options
Diffstat (limited to 'public/catalog/model/extension/total/sub_total.php')
-rw-r--r-- | public/catalog/model/extension/total/sub_total.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/public/catalog/model/extension/total/sub_total.php b/public/catalog/model/extension/total/sub_total.php new file mode 100644 index 0000000..48b77fe --- /dev/null +++ b/public/catalog/model/extension/total/sub_total.php @@ -0,0 +1,23 @@ +<?php +class ModelExtensionTotalSubTotal extends Model { + public function getTotal($total) { + $this->load->language('extension/total/sub_total'); + + $sub_total = $this->cart->getSubTotal(); + + if (!empty($this->session->data['vouchers'])) { + foreach ($this->session->data['vouchers'] as $voucher) { + $sub_total += $voucher['amount']; + } + } + + $total['totals'][] = array( + 'code' => 'sub_total', + 'title' => $this->language->get('text_sub_total'), + 'value' => $sub_total, + 'sort_order' => $this->config->get('sub_total_sort_order') + ); + + $total['total'] += $sub_total; + } +} |