Author Topic: VM 3.2.6 invoice not in shop language [solved]  (Read 182 times)

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 146
    • Barg IT
VM 3.2.6 invoice not in shop language [solved]
« on: November 26, 2017, 16:17:04 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9415
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 3.2.6 invoice not in shop language
« Reply #1 on: November 27, 2017, 21:21:57 pm »
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 ?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 146
    • Barg IT
Re: VM 3.2.6 invoice not in shop language
« Reply #2 on: November 28, 2017, 09:33:28 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9415
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM 3.2.6 invoice not in shop language
« Reply #3 on: November 28, 2017, 12:27:34 pm »
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:
Code: [Select]
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
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 146
    • Barg IT
Re: VM 3.2.6 invoice not in shop language
« Reply #4 on: November 28, 2017, 13:30:52 pm »
I've tested that from the backend and frontend and the invoice is still in English...

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 146
    • Barg IT
Re: VM 3.2.6 invoice not in shop language
« Reply #5 on: December 07, 2017, 16:46:15 pm »
Solved in VM 3.2.8