News:

Looking for documentation? Take a look on our wiki

Main Menu

VM 3.2.6 invoice not in shop language [solved]

Started by p.barg, November 26, 2017, 16:17:04 PM

Previous topic - Next topic

p.barg

Hello,
after updating VM 3.2.4 to 3.2.6 the invoices are no longer created in shop language, but in English.
The site is mulitlingual (German, English), the shop language is set to German and the option "invoice in user language"
is disabled.
Am I missing something?

-- Petra

Milbo

Hmmm, no clue, I have to take a look. can you please post me the vmdebug, the language line?

I just wonder about, the used line (at least by your settings) is shopFunctionsF::loadOrderLanguages(VmConfig::$jDefLangTag);

I just wonder, what is your VmConfig::$jDefLangTag? and the VmConfig::$vmlangTag; in FE/controllers/invoice.php line 232 ?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

This is the debug line in backend:
1 vmdebug 2 Languages, default shoplanguage (VmConfig::$jDefLang): de_de de-DE Selected VM language (VmConfig::$vmlang): de_de de-DE SEF: de

In frontend it looks like this:
1 vmdebug 2 Languages, default shoplanguage (VmConfig::$jDefLang): de_de de-DE Fallback language (VmConfig::$defaultLang): de_de Selected VM language (VmConfig::$vmlang): en_gb en-GB SEF: en


Milbo

So jDefLang point to german. I also just tested it locally and it works fine for me. Hmm, I just notice, it works fine for me using the Backend.

When I am in the frontend and browse the german store in english, I see this vmdebug 2 Languages, default shoplanguage (VmConfig::$jDefLang): de_de de-DE Fallback language (VmConfig::$defaultLang): de_de Selected VM language (VmConfig::$vmlang): en_gb en-GB SEF: en

That means that (VmConfig::$jDefLang): de_de is indeed the correct value for the invoice.

Ahhh, there is it. I think I found it.

Please try in the controller/invoice.php around line 227, this here:

if(VmConfig::get('invoiceInUserLang', false) and !empty($orderDetails['details']) and !empty($orderDetails['details']['BT']->order_language)) {
$orderLang = $orderDetails['details']['BT']->order_language;
} else {
$orderLang = VmConfig::$jDefLangTag;
}

shopFunctionsF::loadOrderLanguages($orderLang);
if($orderLang!=VmConfig::$vmlangTag){
$orderDetails = $orderModel->getOrder($orderDetails['details']['BT']->virtuemart_order_id);
}


I did not reload the order. And the function "getOrder" uses translations, so we must call it after loading the new order language
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

I've tested that from the backend and frontend and the invoice is still in English...

p.barg