1: | <?php
2: | namespace Opencart\Catalog\Model\Extension\Opencart\Total;
3: | /**
4: | * Class SubTotal
5: | *
6: | * @package Opencart\Catalog\Model\Extension\Opencart\Total
7: | */
8: | class SubTotal extends \Opencart\System\Engine\Model {
9: | /**
10: | * Get Total
11: | *
12: | * @param array<int, array<string, mixed>> $totals
13: | * @param array<int, float> $taxes
14: | * @param float $total
15: | *
16: | * @return void
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: |

OpenCart API API documentation generated by ApiGen dev-master