Author Topic: [! for the developers] Translation of 2 variables in the router  (Read 465 times)

arcturus

  • Jr. Member
  • **
  • Posts: 119
  • VirtueMart Version: 3.8.9 10514
I did a few improvements to the translation of 2 variables in the /components/com_virtuemart/router.php file. It is helpful if 'number' and 'id'are translated as strings in /language/[lang]/[lang].com_virtuemart.sef.ini:

Code: [Select]
COM_VIRTUEMART_SEF_NUMBER="number_translated"
COM_VIRTUEMART_SEF_ID="id_translated"
COM_VIRTUEMART_SEF_ORDERDONE="order_sent_translated"

Lines 341, 344 and 570, per revision 10514:

Code: [Select]
if ( isset($query['order_number']) ) {
$segments[] = $helper->lang('number').'/'.$query['order_number'];# this translates the 'number' variable
unset ($query['order_number'],$query['layout']);
} else if ( isset($query['virtuemart_order_id']) ) {
$segments[] = $helper->lang('id').'/'.$query['virtuemart_order_id'];# this translates the 'id' variable
unset ($query['virtuemart_order_id'],$query['layout']);
}

Code: [Select]
if ( !empty($segments) ) {
if ($segments[0] == $helper->lang('number'))# this translates the 'number' variable
$vars['order_number'] = $segments[1] ;
else $vars['virtuemart_order_id'] = $segments[1] ;
$vars['layout'] = 'details';
}
Cheers,
George
https://www.proxima-mundi.ro

Currentl using Joomla! 3.9.28 and VM 3.8.9 10514 on PHP 7.4