Hi,
It's probably because you're using a payment gateway which notifies the website with a server to server connection and it doesn't specify any language for that notification. Because of that the current language is the main language of the website instead of the language of the user that the email system of HikaShop is able to handle.
Try to replace the code:
$order = $class->loadFullOrder($orderId,true,false);
$fields['order'] = $fieldsClass->getFields('backend',$order,'order');
ob_start();
if(file_exists(HIKASHOP_MEDIA.'plugins'.DS.'invoice.php')){
$file = HIKASHOP_MEDIA.'plugins'.DS.'invoice.php';
}else{
$file = dirname(__FILE__).DS.'attachinvoice'.DS.'invoice.php';
}
require($file);
$pdfContent[] = ob_get_clean();
with:
$order = $class->loadFullOrder($orderId,true,false);
$class->loadLocale($order);
$fields['order'] = $fieldsClass->getFields('backend',$order,'order');
ob_start();
if(file_exists(HIKASHOP_MEDIA.'plugins'.DS.'invoice.php')){
$file = HIKASHOP_MEDIA.'plugins'.DS.'invoice.php';
}else{
$file = dirname(__FILE__).DS.'attachinvoice'.DS.'invoice.php';
}
require($file);
$pdfContent[] = ob_get_clean();
if(method_exists($class,'loadBackLocale')){
$class->loadBackLocale();
}else{
if($app->isAdmin()) {
$config = JFactory::getConfig();
if(!empty($class->oldLocale)){
$config->set('language',$class->oldLocale);
$debug = $config->get('debug');
if(HIKASHOP_J25) JFactory::$language = new hikaLanguage($class->oldLocale, $debug);
}
$lang = JFactory::getLanguage();
$override_path = JLanguage::getLanguagePath(JPATH_ROOT).DS.'overrides'.$lang->getTag().'.override.ini';
if(version_compare(JVERSION,'1.6','>=')&& file_exists($override_path)) {
$lang->override = $lang->parse($override_path);
}
$lang->load(HIKASHOP_COMPONENT, JPATH_SITE, null, true );
if(version_compare(JVERSION,'1.6','<') && file_exists($override_path)) {
$lang->_load($override_path,'override');
}elseif(HIKASHOP_J25){
$lang->publicLoadLanguage($override_path,'override');
}
}
}
in the file plugins/hikashop/attachinvoice/attachinvoice.php so that it switch the language automatically based on the language of the user of the order for the display of the invoice.