Jump to content

Adding a Year field to my product description text


VictoryKing

Recommended Posts

I have the current year YYYY as part of many of my product descriptions.   Every year, I have to update all the descriptions manually.   How can I use a variable for the current year?   I've looked thru many posts online, but couldn't find how to do this in Prestashop 1.7.  Not sure if I have to make changes to PHP and TPL files in order to reference the Year.  Thank you.

Link to comment
Share on other sites

Hi,
You can try to add a variable to the product descriptions (like {YearVariable} ) and inside the Product controller override you can replace it with the current year using str_replace. You have to make changes in PHP this way.

Or if you want you can make the replace part inside the tpl where the product description variable is displayed.
I hope that I could help.
Have a nice day, Leo.

  • Thanks 1
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...