1: | <?php
|
2: | namespace Opencart\Catalog\Model\Extension\Opencart\Total;
|
3: | |
4: | |
5: | |
6: | |
7: |
|
8: | class SubTotal extends \Opencart\System\Engine\Model {
|
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: |
|
18: | public function getTotal(array &$totals, array &$taxes, float &$total): void {
|
19: | $this->load->language('extension/opencart/total/sub_total');
|
20: |
|
21: | $sub_total = $this->cart->getSubTotal();
|
22: |
|
23: | if (!empty($this->session->data['vouchers'])) {
|
24: | foreach ($this->session->data['vouchers'] as $voucher) {
|
25: | $sub_total += $voucher['amount'];
|
26: | }
|
27: | }
|
28: |
|
29: | $totals[] = [
|
30: | 'extension' => 'opencart',
|
31: | 'code' => 'sub_total',
|
32: | 'title' => $this->language->get('text_sub_total'),
|
33: | 'value' => $sub_total,
|
34: | 'sort_order' => (int)$this->config->get('total_sub_total_sort_order')
|
35: | ];
|
36: |
|
37: | $total += $sub_total;
|
38: | }
|
39: | }
|
40: | |