'CS-cart - assigning variables into config file
In my CS-cart 4
PHP project I have a Smarty 3
(tpl) view file..
There I have defined one JavaScript function like:
<script type="text/javascript">
api_key: 'JSABFISAG472IB4'
....
I am very new at using it, so I wanted to ask/check if this hardcoded API key could be added on a config? Where and how? Still have a trouble finding similar examples online..
Checked: CS-cart documentation
Checked: Smarty Help Forum
Solution 1:[1]
Do you have a config.php or config.local.php file? if not create one and add it there define('KEY','1234567890');
And call it like this in tpl {$smarty.const.KEY}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |