vahidafshari Posted January 1, 2014 Share Posted January 1, 2014 Hello How can I show details of special manufactur (id=336) in product.tpl? Link to comment Share on other sites More sharing options...
vekia Posted January 1, 2014 Share Posted January 1, 2014 in product controller to smarty array you have to add variable with manufacturer object: $mymanufacturer = new Manufacturer(336); then add it to smarty array. $this->context->smarty->assign('mymanufacturer',$mymanufacturer); then in product.tpl file you can use {$mymanufacturer} variable (remember that this is object) 2 Link to comment Share on other sites More sharing options...
vahidafshari Posted January 2, 2014 Author Share Posted January 2, 2014 (edited) in product controller to smarty array you have to add variable with manufacturer object: $mymanufacturer = new Manufacturer(336); then add it to smarty array. $this->context->smarty->assign('mymanufacturer',$mymanufacturer); then in product.tpl file you can use {$mymanufacturer} variable (remember that this is object) Tnx vekia but i couldn't use it! I created a ProducController.php in overwrite/controller/front and I put below lines <?php class ProductControllerCore extends FrontController { $mymanufacturer = new Manufacturer(336); $this->context->smarty->assign('mymanufacturer',$mymanufacturer); } ?> and use {$mymanufacturer} in product.tpl! it doesn't work Edited January 2, 2014 by vahidafshari (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 2, 2014 Share Posted January 2, 2014 code you used will not work. you have to use code in init() function, or in initcontent() function 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