yvesbj Posted June 24, 2012 Share Posted June 24, 2012 (edited) Bonjour à tous,Comme il est dit dans mon titre, j'aimerais ajouter des boutons radios dans mon formulaire de contact.Il s'agit ici de pouvoir préciser si il s'agit d'un "Particulier" ou bien d'un "Professionnel".J'ai donc modifier le fichier contact-form.tpl auquel j'ai rajouté le code suivant : <p class="radio"> <span>{l s='You are'}</span> <input type="radio" id="id_statut1" name="id_statut" value="1" {if $smarty.post.id_statut == 1 OR !$smarty.post.id_statut}checked="checked"{/if} /> <label for="id_statut1">{l s='Privately'}</label> <input type="radio" id="id_statut2" name="id_statut" value="2" {if $smarty.post.id_statut == 2}checked="checked"{/if} /> <label for="id_statut2">{l s='Professional'}</label> </p> Au niveau visuel, ça s'affiche correctement sur le site.Et dans le fichier contact.html et txt : <p>Message provenant d'un : {statut}</p> Par contre, je ne sais pas du tout quoi mettre puis ou dans le fichier ContactController.phpPourriez-vous m'aider svp ?Je suis sous Prestashop 1.4.7. Edited January 5, 2015 by yvesbj (see edit history) Link to comment Share on other sites More sharing options...
yvesbj Posted June 25, 2012 Author Share Posted June 25, 2012 Je viens de tester ce code dans le ContactController.php mais ça ne fonctionne toujours pas : 'statut' =>Tools::getValue('statut'), Link to comment Share on other sites More sharing options...
yvesbj Posted June 25, 2012 Author Share Posted June 25, 2012 Quelqu'un pour m'aider svp ? Je galère bien comme il faut Link to comment Share on other sites More sharing options...
yvesbj Posted September 6, 2012 Author Share Posted September 6, 2012 ronrrron zzzzz zzzzzz roon zzzz.... Link to comment Share on other sites More sharing options...
yvesbj Posted November 17, 2013 Author Share Posted November 17, 2013 Hein ? Quoi ? Ah ok fausse alerte je me rendors... ron ron ron zzz... Link to comment Share on other sites More sharing options...
ghost4life Posted December 28, 2014 Share Posted December 28, 2014 up ! (A moins que tu ai trouvé la solution ^^ ?) Link to comment Share on other sites More sharing options...
yvesbj Posted December 29, 2014 Author Share Posted December 29, 2014 Non désolé, malgré l'ancienneté du post, je n'ai pas trouvé de solution... Link to comment Share on other sites More sharing options...
herve25 Posted December 29, 2014 Share Posted December 29, 2014 Bonjour, Dans ton code le champ se nomme id_statut <input type="radio" id="id_statut1" name="id_statut" value="1" ... Dans ton controller tu récupére la variable statut 'statut' =>Tools::getValue('statut'), L'approche est bonne c'est juste le nom de la variable qui est mauvais ;-) Le code suivant devrait donc fonctionner. 'statut' =>Tools::getValue('id_statut'), Link to comment Share on other sites More sharing options...
ghost4life Posted December 29, 2014 Share Posted December 29, 2014 Merci j'ai réussi Link to comment Share on other sites More sharing options...
yvesbj Posted January 5, 2015 Author Share Posted January 5, 2015 Merci pour votre aide herve25 et bonne année 2015 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