1: | <?php
2: | namespace Opencart\Catalog\Controller\Startup;
3: | /**
4: | * Class Tax
5: | *
6: | * @package Opencart\Catalog\Controller\Startup
7: | */
8: | class Tax extends \Opencart\System\Engine\Controller {
9: | /**
10: | * @return void
11: | */
12: | public function index(): void {
13: | $this->registry->set('tax', new \Opencart\System\Library\Cart\Tax($this->registry));
14: |
15: | if (isset($this->session->data['shipping_address'])) {
16: | $this->tax->setShippingAddress((int)$this->session->data['shipping_address']['country_id'], (int)$this->session->data['shipping_address']['zone_id']);
17: | } elseif ($this->config->get('config_tax_default') == 'shipping') {
18: | $this->tax->setShippingAddress((int)$this->config->get('config_country_id'), (int)$this->config->get('config_zone_id'));
19: | }
20: |
21: | if (isset($this->session->data['payment_address'])) {
22: | $this->tax->setPaymentAddress((int)$this->session->data['payment_address']['country_id'], (int)$this->session->data['payment_address']['zone_id']);
23: | } elseif ($this->config->get('config_tax_default') == 'payment') {
24: | $this->tax->setPaymentAddress((int)$this->config->get('config_country_id'), (int)$this->config->get('config_zone_id'));
25: | }
26: |
27: | $this->tax->setStoreAddress((int)$this->config->get('config_country_id'), (int)$this->config->get('config_zone_id'));
28: | }
29: | }
30: |

OpenCart API API documentation generated by ApiGen dev-master