Page 1 of 1

Global Custom Constants

Posted: Fri Jun 06, 2014 4:28 pm
by itdes
Hello,

Is there a way to define a couple of array constants in OpenCart, that I could use throughout the view template files and inside the controllers? Now I'm defining the same array constants in a couple of files and every time I have to change some value, I have to search and change them in all files that I use them, it could be much more easier and error free if I could just make those constants available to all OpenCart files.

Thank you.

Re: Global Custom Constants

Posted: Sat Jun 07, 2014 2:38 am
by rph
I would recommend adding it to config so you can call it with $this->config->get('whatever_key'). Otherwise you can define a constant in /system/startup.php.