Author Topic: Invoice Header and Footer  (Read 608 times)

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Invoice Header and Footer
« on: March 18, 2019, 17:17:00 pm »
Virtuemart 3.4.3 .9975
Joomla 3.9.4

Header and footer in invoices remain in the default language.
There is no problem with the content.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Re: Invoice Header and Footer
« Reply #1 on: May 16, 2019, 15:54:25 pm »
VirtueMart 3.4.5 10057

The situation is the same.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 388
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Invoice Header and Footer
« Reply #2 on: May 16, 2019, 18:10:13 pm »
You can edit the invoice and mail layouts and set a language variable there.
echo vmText::_('SOME_HEADER');

The header and footer are normally given in VM config - Shop - Shop. This is plain text/HTML without translation. Mostly it makes sense if the shop owner wants to use the legal language in his country.

You might ask iStraxx if they can add a translatable field there for a membership. Maybe they are interested in doing that. The override with vmText will do though.

Regards
Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Re: Invoice Header and Footer
« Reply #3 on: May 16, 2019, 18:59:28 pm »
The configuration (VM config - Shop - Shop - Invoices/Emails) has "Invoice Head" and "Invoice footer" settings.
They are different for all languages and may change with an editor. You can change fonts, size, and even put text into tables.
If the store owner wants to be only in his / her own language, he can only put such content for all languages.

All this works in the emails without any problem and changes the languages according to the user.
Of course, I chose the "Invoice in user language" option from the configuration. (VM config - Configuration - Configuration - Orders)

In the invoices it also works normally and shows everything as I have set it up (fonts, sizes ...).
It only does not change the language in the header and footer. The content (user data, products, prices) is in the correct language. Status of the order too.

Only the header and footer on the invoice are in the default language.


Added to post: By the way, this happened after some update, but I do not remember exactly which one.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 388
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Invoice Header and Footer
« Reply #4 on: May 16, 2019, 19:34:40 pm »
I tried that just now, you are right.
I never expected it to work because there are no language flags for the fields like in the other views like for product names.
Only for the CSS stile. Strange.

Thanks for pointing that out and proving me wrong.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Re: Invoice Header and Footer
« Reply #5 on: May 16, 2019, 20:02:39 pm »
No problem. It is good to solve this problem as well.
It is important that Virtuemart is getting better.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 388
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Invoice Header and Footer
« Reply #6 on: May 16, 2019, 20:16:16 pm »
Maybe you find a hint why it does not work if you switch the setting in VM config - tab Orders "invoice in user language" on and off.

Check the name of the input element in the setting and search for that in the core files.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Re: Invoice Header and Footer
« Reply #7 on: May 16, 2019, 20:20:24 pm »
Yes, this is a good idea.
I will look for it, but in a few days, because I have important tasks at the moment, and I am late in the deadlines.

Thank you
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 274
    • Audio Store
Re: Invoice Header and Footer
« Reply #8 on: May 16, 2019, 20:39:25 pm »
By the way, a quick search:

components\com_virtuemart\views\invoice\view.html.php

Code: [Select]
if(VmConfig::get('invoiceInUserLang', false) and !empty($orderDetails['details']['BT']->order_language)){
if($orderDetails['details']['BT']->order_language!=VmConfig::$vmlangTag){
shopFunctionsF::loadOrderLanguages($orderDetails['details']['BT']->order_language);
$orderDetails = $orderModel->getOrder($orderDetails['details']['BT']->virtuemart_order_id);
}
}

The element name (invoiceInUserLang) only occurs there.

Maybe Max can give more information.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English