Author Topic: I found a dirty solution: Checkout page swich automatically to english when logi  (Read 3371 times)

adan

  • Beginner
  • *
  • Posts: 41
Hi,

I am using joomla 1.5.15, virtuemart 1.1.4 and joomfish 2.0.4.

My site uses 3 languages: english, french and arabic.
- I switch to arabic page.
- I go to the cart. I click on checkout, I am invited to login.
- I enter my login/password and submit, I am then switch to english page. It is the good page but in english.
- I don't have this problem if I login from a french page.
- I don't have this problem if I use the joomla login form to login.

I managed to find where this problem occurs it is in:
components\com_virtuemart\themes\default\templates\common\login_form.tpl.php
in the the line 51:
Code: [Select]
<input type="hidden" name="lang" value="<?php echo vmIsJoomla() ? $mosConfig_lang $GLOBALS['mosConfig_locale'?>" />

all I have to do to not switch to english page when logging in during the checkout process is to change this line to:
Code: [Select]
<input type="hidden" name="lang" value="<?php echo vmIsJoomla() ? $GLOBALS['mosConfig_locale'] :  $mosConfig_lang?>" />
I can put a if condition to use the original line or the modified one depending on the chosen language, but that's a dirty change. I thought that maybe you can help telling me where I should look to provide a better correction.

Thanks

adan

  • Beginner
  • *
  • Posts: 41
I cannot see the code I put, here are them again:
the original code:
<input type="hidden" name="lang" value="<?php echo vmIsJoomla() ? $mosConfig_lang : $GLOBALS['mosConfig_locale'] ?>" />

the modified code:
<input type="hidden" name="lang" value="<?php echo vmIsJoomla() ? $GLOBALS['mosConfig_locale'] :  $mosConfig_lang?>" />

Regards

aisy

  • Beginner
  • *
  • Posts: 1
Hi. I have the same problem :( Only my website is in two languages - english and armenian. Armenian is the default one. When I click on confirm order in english version the 'lang=en' in my url disappears and I am asked to login. The page is still in english. After I login, the page switches to armenian(site default language). I do not notice this problem when I click on confirm order being already logged in. All the other things regarding the languages work correctly.

The solution mentioned in the above post did not change anything for me.

I very much appreciate help, because it is a rather long time I can't find a solution.

Thanks in advance.

adan

  • Beginner
  • *
  • Posts: 41
Here is an easier question: does anyone know what's the role of the variables $GLOBALS['mosConfig_locale'] and $mosConfig_lang and where are they initialized?

Thanks

JaviG

  • Beginner
  • *
  • Posts: 10
Ill bump this, to see if someone else found a solution, I´m having the exact same problem as aisy. Language automatically changes to default one after login in. Im using VM 1.1.4  and Multilingual (m17n)

Regards