hello chris, we had located the problem to the VM's vmLang javascript variable which in your case incorrectly sends lang=en instead of lang=eu to decide which langauge should be set within the Ajax content.
for now we had suggested a VM fix for vm3.0.10 that can be downloaded from here:
http://www.rupostel.com/svn3/patch.1435839641.svn.txthttp://www.rupostel.com/svn3/vmjsapi.phpfor anybody having problems with VM3 on multi lang sites, we would suggest this code change:
locate file:
\administrator\components\com_virtuemart\helpers\vmjsapi.php
look for this code:
- Code: Select all
if(VmConfig::get( 'vmlang_js', 1 )) {
$jsVars .= "vmLang = '&lang=".substr( VmConfig::$vmLangSelected, 0, 2 )."' ;\n";
} else {
$jsVars .= 'vmLang = "";'."\n";
}
and change to:
- Code: Select all
$langs = VmConfig::get('active_languages', array());
if (count($langs)>1)
{
$code = self::getLangCode();
if (!empty($code))
$jsVars .= "vmLang = '&lang=".$code."'; \n";
else
$jsVars .= "vmLang = ''; \n";
} else {
$jsVars .= 'vmLang = ""; '."\n";
}
and the most importantly ADD THIS FUCNTION to the class (before the last ending bracket at the end of the file):
- Code: Select all
/*stAn function - detect proper SEF language variable on j2.5/j3.x/j1.5 */
public static function getLangCode()
{
$langO = JFactory::getLanguage();
$lang = JRequest::getVar('lang', '');
$locales = $langO->getLocale();
$tag = $langO->getTag();
$app = JFactory::getApplication();
/* this code is uses logic derived from language filter plugin in j3 and should work on most 2.5 versions as well */
if (class_exists('JLanguageHelper') && (method_exists('JLanguageHelper', 'getLanguages')))
{
$sefs = JLanguageHelper::getLanguages('sef');
foreach ($sefs as $k=>$v)
{
if ($v->lang_code == $tag)
if (isset($v->sef))
{
$ret = $v->sef;
return $ret;
}
}
}
if ( version_compare( JVERSION, '3.0', '<' ) == 1) {
if (isset($locales[6]) && (strlen($locales[6])==2))
{
/* this is joomla 2.5 sef language var */
$action_url .= '&lang='.$locales[6];
$lang = $locales[6];
return $lang;
}
else
if ( version_compare( JVERSION, '1.6', '<' ) == 1)
if (!empty($locales[4]))
{
/* this is legacy joomla 1.5 code to detect sef language var*/
$lang = $locales[4];
if (stripos($lang, '_')!==false)
{
$la = explode('_', $lang);
$lang = $la[1];
if (stripos($lang, '.')!==false)
{
$la2 = explode('.', $lang);
$lang = strtolower($la2[0]);
}
}
return $lang;
}
else
{
return $lang;
}
}
// return what we got at first
return $lang;
}
if you want to keep compatiblity with upcoming Joomla 3.5, you may need to change JRequest to vRequest.
The code comes from our OPC and is tested on 1000 sites.
Best Regards, Stan