Debugging Prestashop Templates
While stumbling around the internet as you do when pondering a particularly awkward programming challenge, I came across an excellent post on smarty debug with FireBug. This inspired me to pull together a Prestashop module to allow store owners, designers and developers to view indepth debugging data from right within the Prestashop environment.
Dowload it Now: Prestashop Smarty Debug 0.1.0
Update – 22nd March 2011: Easy Smarty debugging for Prestashop 1.4.x
I think most people working on Prestashop development projects have longed for an easy way of identifying which template variables are set on which page, and although this doesn’t tell you at which point in the page rendering process a variable may be available, it does give an important insight into how to leverage otherwise missed opportunities to enhance a site’s design and functionality, and catch errors.
All credit for the FireBug template has to go to the original author’s post at PHPhulp on Smarty Firebug debug.tpl. The latest version adds support for themes using either Smarty2 or Smarty 3, depending on the admin setting.
How to use it
You must install FireBug in your Firefox Browser to use this with the ‘Use FireBug’ module option enabled (default).
You can however disable FireBug support in the module and use the traditional javascript popup instead. Just enable debug in the module admin settings page and visit your front office page. Note that you may need to refresh your page for it to render correctly in this mode, and remember that every visitor to your site will see the popup!!
Recommended steps to use this tool
- If you haven’t already, then install the FireBug Add-on to Firefox.
- Enable the Console in FireBug by clicking on the down arrow beside “Console” and selecting ‘Enable’.
- In the module settings enable the smarty debugging in Prestashop by ticking the ‘Debug’ option and clicking update.
- *At the FireBug console prompt (>>>) enter: Smarty_debug(); or Smarty_debug(true); (both case-sensitive) after each page load to display debug data.
- Enjoy viewing all you ever needed to know about your module or theme’s template internals!
- Disable the ‘Debug’ option in this module as soon as you are finished your debug session.
*Note: Using Smarty_debug(true); enables grouping so that some of the elements can be collapsed to improve readability.









Hi Paul,
Great work! I don’t suppose you’ve any idea how easy it would be to get something similar working on Chrome?
Mark
are you going to update this module for v1.4
Thanks
As you can see from the above, it’s already done
You can use this module also in Opera 11.x because now Opera supports many Firebug functions (API).
Enable Dragonfly->Scripts->Repl
Type “Smarty_debug(true); ” and it is done.
Nice !!!
Thanks for this great tool.
Hi, is possible to update this module for Presta 1.4? Thanks
Done, and should be posted shortly!
Hi ,
This is a very interesting module you have created, I tried following the instructions mentioned in your post however, I keep getting this error
ReferenceError: Smarty_debug is not defined { message=”Smarty_debug is not defined”, more…}
Is there anything I might be doing wrong which is causing this.
Thank you !!
I was trying to follow the steps mentioned in your posts however I wasn’t able to find
# In the module settings enable the smarty debugging in Prestashop by ticking the ‘Debug’ option and clicking update.
I am a novice to Prestashop , and I think this would be pretty useful.
Using Presashop 1.3.0
Cheers,
[...] eCartService.net has a module and theme development tool for use with Firebug [...]
+1
Pingback: Prestashop Plugins, Modules, and Tips « Clotted Nonsense