webmatersweetch Posted June 18, 2019 Posted June 18, 2019 Bonjour, J'essaye de donner la possibilité au customer de changer la langue par default. Tout fonctionne, après avoir cliqué sur "Valider", j'ai fait un petit print_r de $customer->id_lang et cookie_id_lang et il y a bien les informations qui sont à jours. Mais a partir du moment ou j'actualise la page, les informations sont écrasé par les anciennes.. Voici mon code Identity.tpl : <p class="select"> <label for="languages">Languages</label> <select name="lang" id="lang"> <option value="1" {if $smarty.post.id_lang eq 1}selected="select"{/if}>French</option> <option value="2" {if $smarty.post.id_lang eq 2}selected="select"{/if}>Deutch</option> <option value="4" {if $smarty.post.id_lang eq 4}selected="select"{/if}>English</option> </select> </p> <p class="select"> <label for="languages">Languages</label> <select name="lang" id="lang"> <option value="1" {if $smarty.post.id_lang eq 1}selected="select"{/if}>French</option> <option value="2" {if $smarty.post.id_lang eq 2}selected="select"{/if}>Deutch</option> <option value="4" {if $smarty.post.id_lang eq 4}selected="select"{/if}>English</option> </select> </p> et mon code identifyController $lang = Tools::getValue('lang'); Context::getContext()->customer->id_lang = $lang; Context::getContext()->customer->save(); Pour l'instant, j'ai pas géré les erreurs, donc ne faites pas attention. Merci beaucoup pour votre aide. Share this post Link to post Share on other sites More sharing options...
webmatersweetch Posted June 18, 2019 Posted June 18, 2019 Up ! Share this post Link to post 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