Jump to content
webmatersweetch

Update id_lang dans 'identify'.tpl

Recommended Posts

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
Posted (edited)

I will guide you to change order reference to number / order ID in Prestashop 1.7. There are four parts showing order refercens, they are: Order history, Guest tracking order, Order invoice and Order confirmation email. You can change one or two or all of them accordion to you needs myloweslife.

Edited by Angelica546 (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More