When I want to set a global variable in template (.tpl
files), I just use global
in opencart 2.2 or older version.
For example:
<?php global $config; if($config->get('my_options')== 1) { ?>....<?php } ?>
but, it does not work in Latest OpenCart 2.3.0.2
Because predefined global $config
in controller rather inconvenient (we have use config value in many template file).
Hopefully someone with more experience will have an answer to this problem.