How To Use Static Methods In Prestashop Theme Files

September 24, 2013 Alex Simonchik Prestashop, Tips&Tricks
How To Use Static Methods In Prestashop Theme Files

Once again I am posting a quick tip, based on rather frequently asked question on Prestashop forums. I feel like it will be helpful to a lot of people.

Today’s topic: static methods usage in Prestashop theme files.

The question goes like this –

Is it possible to use {php} tags in Prestashop template files?

As you know {php} tags are excluded from Smarty and therefore you cannot use Smarty {php} for Prestashop.

In such cases, if you want to use a static method you can call it the same way as in PHP but using {} to separate common HTML from Smarty, e.g.:



Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *