Smarty is the php template engine used by PrestaShop.
For smarty configuration, you need to follow some steps:
- From the Performance page find the Smarty section. It is the topmost section.
- Under the Template Cache setting, ensure the option labeled "Recompile templates if the files have been updated" is selected.
- Next, ensure the Cache toggle is set to "Yes".
How does Smarty helps to perform better?
It is sturdy, fast, easy to learn and use. and has a clean and compact design-dedicated syntax. It helps building a much simpler HTML code, and works by compiling then caching each page.
A few things that you should avoid when using Smarty:
- Do not make direct call PrestaShop's constants. Most particularly, do not even use {$smarty.const._DB_PASSWD_}, for obvious reasons.
- Do not override PrestaShop's assigned variables.
- Do not make the code needlessly hard to read. For instance, refrain from making include calls from within an already included file.
- Do not make direct PHP calls. For instance, do not use {php} // PHP code {/php}