zzTop99 Posted February 5, 2013 Share Posted February 5, 2013 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 More sharing options...
El Patron Posted February 5, 2013 Share Posted February 5, 2013 search for the controller that calls the .tpl file.. there you would need to pass desciption2 in the smarty array 1 Link to comment Share on other sites More sharing options...
afranco Posted February 6, 2013 Share Posted February 6, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now