hideaki Posted May 23, 2012 Share Posted May 23, 2012 Hi guys, I'm curious about the relationship between PHP and TPL files used in PrestaShop. Today I decided I needed to do some coding to get custom information passed to the product.tpl. So I went to the product.php and added my custom code there (product.php) $lastVisitedCat = new Category(intval($cookie->last_visited_category), intval($cookie->id_lang)); $lastVisitedCatName = $category->name; $smarty->assign('lastVisitedCatName', $lastVisitedCatName); However, when I tried using {lastVisitedCatName} on product.tpl, the information is not shown. I doubt there is anything wrong with the code as when I tried the example on Smarty's site. it doesn't work as well: $smarty->assign('Name', 'Fred'); I have a sense that it's something to do with controllers. But how do I go about in that approach? Hope to hear suggestions and feedbacks. Thanks! Link to comment Share on other sites More sharing options...
Prescol Posted June 3, 2012 Share Posted June 3, 2012 The assignments of smarty are made in the controllers. So you should do this in productcontroller->Function process 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