manuel81 Posted February 16, 2013 Share Posted February 16, 2013 Pour faire de l'ajax dans un module, j'essaie de récupérer un template sous forme de string. if($this->context->customer->logged){ $this->smarty->assign('customerName' , $this->context->customer->firstname.' '.$this->context->customer->lastname); $tpl = $this->display(__FILE__, 'blockaccountlogged.tpl'); // le code s'arrête là $return = array( 'hasError' => 0, 'html' => $tpl, //alors que je veux l'afficher ici 'token' => Tools::getToken(false) ); die (Tools::jsonEncode($return)); Au display le template s'affiche et la page die. J'ai essayé aussi : $tpl = $this->context->smarty->fetch($this->getTemplatePath('blockaccountlogged.tpl')); Mais le résultat est le même à la différence près que ma variable ne s'affiche plus. Une idée ? Merci Link to comment Share on other sites More sharing options...
manuel81 Posted February 16, 2013 Author Share Posted February 16, 2013 $smarty = new Smarty(); $smarty->assign('customerName' , $this->context->customer->firstname.' '.$this->context->customer->lastname); $tpl = $smarty->fetch($this->getTemplatePath('blockaccountlogged.tpl')); Fonctionne mais me prive de fonctionnalités dont j'ai besoin.... 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