1: | <?php
2: | namespace Opencart\Admin\Controller\Event;
3: | /**
4: | * Class Currency
5: | *
6: | * @package Opencart\Admin\Controller\Event
7: | */
8: | class Currency extends \Opencart\System\Engine\Controller {
9: | /**
10: | * Index
11: | *
12: | * Auto update currencies
13: | *
14: | * model/setting/setting/editSetting
15: | * model/localisation/currency/addCurrency
16: | * model/localisation/currency/editCurrency
17: | *
18: | * @param string $route
19: | * @param array<int, mixed> $args
20: | * @param mixed $output
21: | *
22: | * @return void
23: | */
24: | public function index(string &$route, array &$args, &$output): void {
25: | if ($route == 'model/setting/setting/editSetting' && $args[0] == 'config' && isset($args[1]['config_currency'])) {
26: | $currency = $args[1]['config_currency'];
27: | } else {
28: | $currency = $this->config->get('config_currency');
29: | }
30: |
31: | $this->load->model('setting/extension');
32: |
33: | $extension_info = $this->model_setting_extension->getExtensionByCode('currency', $this->config->get('config_currency_engine'));
34: |
35: | if ($extension_info) {
36: | $this->load->controller('extension/' . $extension_info['extension'] . '/currency/' . $extension_info['code'] . '.currency', $currency);
37: | }
38: | }
39: | }
40: |

OpenCart API API documentation generated by ApiGen dev-master