mtor Posted January 3, 2009 Share Posted January 3, 2009 Bonjour,Souhaitant déplacer le module newsletter dans le footer, j'ai modifié le module newsletter disponible avec prestashop en rajoutant dans le fichier blocknewsletter.php : function hookFooter($params) { global $smarty; if (Tools::isSubmit('submitNewsletter')) { $this->newsletterRegistration(); if ($this->error) { $smarty->assign(array('color' => 'red', 'msg' => $this->error, 'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false, 'nw_error' => true, 'action' => $_POST['action'])); } elseif ($this->valid) { if (Configuration::get('NW_CONFIRMATION_EMAIL') AND isset($_POST['action']) AND intval($_POST['action']) == 0) Mail::Send(intval($params['cookie']->id_lang), 'newsletter_conf', $this->l('Newsletter confirmation'), array(), pSQL($_POST['email']), NULL, NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); $smarty->assign(array('color' => 'green', 'msg' => $this->valid, 'nw_error' => false)); } } $smarty->assign('this_path', $this->_path); return $this->display(__FILE__, 'blocknewsletter_footer.tpl'); } Le code mon template blocknewsletter_footer.tpl est celui de base légèrement modifié pour tout mettre sur une seule ligne : <!-- Block Newsletter module--> {l s='Newsletter' mod='blocknewsletter'} <form action="{$base_dir}" method="post"> <input type="text" name="email" size="21" value="{if $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter_devtronic'}{/if}"> {l s='Subscribe' mod='blocknewsletter'} {l s='Unsubscribe' mod='blocknewsletter'} <input type="submit" value="ok" class="button_mini" style="display: inline;" name="submitNewsletter" /> </form> {if $msg} {$msg} {/if} <!-- /Block Newsletter module--> J'ai ensuite greffé le bloc newsletter au Footer.Seul problème, dans le footer la langue n'est plus prise en compte et les textes dans le module newsletter sont en anglais alors que la langue par défaut de ma boutique est en français.Y-a-t'il une variable supplémentaire à globaliser dans la méthode hookFooter de la classe Blocknewsletter afin que la langue soit prise en compte ?Merci d'avance pour votre aide Link to comment Share on other sites More sharing options...
mtor Posted January 5, 2009 Author Share Posted January 5, 2009 Est-ce que cela pourrait-être un bug ? Link to comment Share on other sites More sharing options...
lefred Posted May 18, 2011 Share Posted May 18, 2011 J'ai le meme problème, tu as trouvé une solution ? 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