Jump to content

How to extend a global variable?


Recommended Posts

So I have this $product.description inside a template file that contains the text from Product Description field. What would be the right way to work on this variable and produce derivatives? For example, I may want to filter numbers from that field or cut it and produce a new variable like $product.description_filtered. Text operations are easily done in PHP, but how do I actually create this variable so that my .tpl file can see it and display it? Do I need to create a new module? Do I need to use any hooks? What is the easiest and the most correct way to extend a variable?

Edited by JustJohn (see edit history)
Link to comment
Share on other sites

  • JustJohn changed the title to How to extend a global variable?

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...