Hi,
I have a plugin which is supposed to redirect the user from the standard Joomla registration page to the Virtuemart registration page. The plugin works fine on a regular site, but on a multilingual site, it isn't working. The lang=xx parameter doesn't seem to be added to the redirection URL. This code is for Joomla 2.5 and Joomla 3.x sites.
This is the code that I am using:
[code]
$url = 'index.php?option=com_virtuemart&view=user';
$menuid = (int) $this->params->get("menuid", 0); // Get the menu id parameter
// Check if this is a multi-lingual site
if (JLanguageMultilang::isEnabled()) {
$lang = JFactory::getLanguage();
$languages = JLanguageHelper::getLanguages();
// loop through the lanuguages looking for the one active on the frontend currently
foreach ($languages as $language) {
// Check to see if this is the active frontend language
if ($language->lang_code == $lang->getTag()) {
$url = $url . '&lang=' . $language->sef .( $itemID ? '&Itemid=' . $itemID : '&Itemid=' . $menuid );
break;
}
}
} else {
// code for non-multi-lingual site
$url = $url . ( $itemID ? '&Itemid=' . $itemID : '&Itemid=' . $menuid );
}
$app->redirect( JRoute::_( $url, false ), null, null, true, true );
}
[/code]
Does anyone know what is wrong with this code?
Thanks for any help on this.