Jump to content

PHP scripts inside Product Description field


cercamon

Recommended Posts

Hi, I'm looking for a way to customize product descriptions in a way in which we can include not only HTML but also PHP scripts.

 

I'm aware that we can turn php tags on in smarty compiler, so we can use PHP scripts in tpl files, but I couldn't find any reference on how to include PHP inside the product description field.

 

Those familiar with Drupal surely know how handy could be such a feature. Any hints?

 

Thanks!

Link to comment
Share on other sites

It's going to be a struggle to get that to process in any way, you'd be trying to access php commands from within a template variable.. which would involve a number of none recommended practices by smarty, and an eval command in the php which is also highly not recommended

 

Generally you want to instead be writing a module or at least an override to the class/controller, that will process the php where it should be, and just output it as template variables

Link to comment
Share on other sites

Thanks for your reply. Actually I want to acomplish some degree of automation when generating product description HTML.

 

Depending on the product features, I want the description to include certain HTML blocks and snippets.

 

Actually we are doing this like a 2-step process where we have our own PHP content generation scripts, and we paste the HTML output in the product description field.

 

As far as I'm aware, this is not something that could be done through a module.

 

I'd like to customize prestashop in a way that would do it in one single step, like Drupal filters allow to do.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...