Jump to content

Quick Question


zzTop99

Recommended Posts

Hi folks. I have a quick question , maybe someone could help me

 

So {$product->description} in a tpl file returns the description of the current product.

I made an extra column in the database, alongside description (named it description2 ) .

Of course {product->description2} doesn't work , and I can't figure it out where and how to initialize $product-description2 with the the `description2` from db .

I can't even find where (in which file) does prestashop build $product->description.

 

Anyone knows what should I do ? Any help would be much appreciated :)

Link to comment
Share on other sites

Also, you'll have to add the field to the product class definition. Overriding the class is the best way, I suppose. But I did it directly in the product.php file in the classes directory.

 

You have to add a property, and later the field in the definition array.

 

Doing this allows all the other units to find your field automatically. Beware that it will be an automatic feature in all "blanket" accesses to the DB, So, you may break things that don't know it is there. Make sure to run through the back end to see where you have to add the field to make things right.

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