I need to parse any variable passed to any static page in Prestashop and replace anything that starts with “http” (in plain text) with “a href”s.
I already have the regular expression but I need to know how can I do that using a module without modifying the core functions and without using override directory for classes or controllers.
The variables needs to be parsed BEFORE sending the result to tpl files; I already found a solution overriding ObjectModel class but I need to do this inside a module.
The problem is that it is not clear to me how I can do that because ObjectModel grabs data from database using its constructor.
Somehow I need to override ObjectModel constructor within my module and be able to parse the database values before sending data to any tpl included on page.
Can anyone help me with that ?
EDIT: I also need to be able to do that for email templates.
Probably the easiest way to ensure that you capture all instances would be to perform the required processing within smarty rather than Prestashop itself.
Depending on your needs you could either implement this as a Smarty prefilter or postfilter