Wednesday, July 08, 2015

Enable the PrestaShop 1.6 Smarty Debug Console

  1. In /config/defines.inc.php, changed _PS_MODE_DEV_ to true.
  2. In /config/smarty.config.inc.php, after the assignment of the $smarty variable, add the following code:
    if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
        $smarty->debugging = true;
  3. In the template (.tpl file) you want to see debug info, add the following line at the very end of the template
    {debug}
  4. MAKE SURE there is a return after {debug}
  5. In the back office / advanced parameters / performance, click the "Clear Cache" button at the top right.
  6. In the URL that you are testing, add the param SMARTY_DEBUG (e.g. http://ls/index.php?id_product=57&controller=product&SMARTY_DEBUG).
  7. Make sure that you are not getting a pop-up blocked by your browser. Once you allow the popup, you will get your console.
  8. If you are still having problems, set the "PS_SMARTY_CONSOLE" value in the configuration table to 1.

Note that San Binario wrote up an alternative method to get the debug console working which changes the core code, which I wanted to avoid. I didn't try their method... but maybe it works better for you.

No comments: