- Posts: 154
- Thank you received: 4
PDF attachment plugin uses wrong language file
- olivnewton
-
Topic Author
- Offline
-- Joomla version -- : 3.3.0
dear team,
i purchased and installed the pdf attachment plugin, all works fine, but, all text in PDF created and attached to the mail is in EN, even though the whole page is in DE and all mails created etc. are displayed in DE. is there an option to switch or set the PDF attachment plugin to DE? am i missing something?
best regards and thanks in advance!
Please Log in or Create an account to join the conversation.
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:
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
thanks.
do i need to keep track of this change, or will it be part of the next possible pdf-attachment-plugin update?
also,
it is usually common to show the invoice number also in the filename, so i changed in the same file:
$mailer->addAttachment($invoiceFolder.DS.$invoiceFile,JText::_('INVOICE').'.pdf');
to
$mailer->addAttachment($invoiceFolder.DS.$invoiceFile,JText::_('INVOICE').'_'.$data->data->order_invoice_number.'.pdf');
could this also be incorporated into the next update or do you think there is no need for this?
Please Log in or Create an account to join the conversation.
The Nicola's patch will be integrated into the invoice PDF plugin.
About your feature request, it's a good idea but I think that we will use a specific translation like
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
while paypal is working after the fix, bank transfer plugin still shows the invoice.pdf in the wring language...
any idea?
PS: FYI: only the attached invoice has the wring language, if i create the invoice in the backend its ok...
Please Log in or Create an account to join the conversation.
I don't see why the payment method selection would change anything for the language of the invoice since the patch I gave forces the system to reload the language of the user of the order before generating the PDF.
Are you sure that it's not because the user account you used had the language of the invoice set in it ?
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
if the user in the backend, who sets the order manually to "confirmed" uses as backend language EN then the PDF-invoice generated will use the EN language file, thus being in english...
if the user uses german, then invoice is correct.
shouldnt this rather be different? for example, no matter what a backend language the user dealing with the shop and orders has, the pdf invoice shuold be generated with the default language of the site. does that make sense?
Please Log in or Create an account to join the conversation.
The HIkaShop emails are loading the user language in order to send the notification emails with the user language and not the backend logged user one.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
what language does the system use in this case?
i repeat for the sake of being complete on this post:
- if the user in the backend, who sets the order manually to "confirmed" uses as backend language EN then the PDF-invoice generated will use the EN language file, thus being in english...
- if the user uses german, then invoice is correct.
- this happens only with "HikaShop bank transfer payment plugin", not with paypal
Please Log in or Create an account to join the conversation.
If the user uses the guest checkout, the language information cannot be stored in the user data of the Joomla user account.
So in that case, the system doesn't know the language of the user and simply use the current language.
For PayPal, the system will use the language of the frontend and when we send the user to PayPal we give it the notification url with the current language so the language will correspond to the language of the user. So even even if we don't know the language of the user when the user guest checkout, the current language is the correct one during the payment notification and thus the user gets the PDF in the correct language.
For the bank transfer, there is no such information in the order and since you confirm the order manually from the backend, it just uses the language you're using.
I don't really have a solution here as the information is not stored and there is no place to store it at the moment so it would require substantial modifications to be able to handle that.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
- Posts: 154
- Thank you received: 4
so the joomla user handling all orders in the backend and setting the bank transfer orders manually to "confirmed" HAS to have setup GERMAN in order for the plugin to create the PDF invoice in german, right?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.