News:

Support the VirtueMart project and become a member

Main Menu

Adapt invoice and e-mail to shopper language..

Started by THLU, July 22, 2013, 15:04:22 PM

Previous topic - Next topic

THLU

I'm using Joomla 2.5 with virtuemart 2.0.22a.

I am setting up a multi-language shop and this works ok.
But now I'm setting up the handling of orders. Making invoice, sending e-mail when something changes.

This does not work ok for me. If I'm managing the orders from the BE. Then some very strange behaviour is in place:
When you create an invoice from the backend managing the invoice is made up in the language which is active on the frontend at that moment.
When a notices (e-mail) is send when changing status then this notice gets the language which is active in the  BE at that moment.

As far as I can read in the forums this strange behaviour is normal.

I want to have every correspondence to the customer in the language of his choice.

So in this case I would have to switch the backend and the frontend to have the documents of the shopper in its language of choice, given I know which language the shopper has chosen.

I'm trying to fix this. So I already adapted virtuemart with custom templates (edit_address.php) so The language chosen on the frontend when a shopper registers is automatically stored in the users profile. Strangely this was not already implemented.

I also have made some hacks in the invoice template so the language of the invoice created at the backend is not depending on the language of the FE, partly.
Only partly because the translations of the customfields are loaded in the order_details array, so in the invoice.php the override of the language is already to late.

Similar problems with the e-mail notification.

So it looks like I have to hack in to the core of virtuemart which I rather would like not to do because of future updates.

Now I'm wondering of somebody has got the same problem and has a proper solution for it. Any help would be appreciated

I'm not interested in some commercial plugin, because I know it also would be necessary to adapt that to my needs. In my opinion when I have to adapt it anyway I better can start from the free code and adapt that then pay for some code to adapt that.

THLU

Ok,
so I have found the place to change the language. Sadly it appears I have no option but changing some core file.

So for this I needed to change the view.html.php from the invoice component of virtuemart. Now the language of both the invoice creation and the e-mail notification now are determined by the language of the user and not the language of the administrator BE or FE.

I suppose this file '/components/com_virtuemart/views/invoice/view.html.php' cannot be overwritten with a file in the template directory?


p.barg

Hello,
could you please share your insights and elaborate on what you changed?

-- Petra

kreativa

I'm also interested in the solution of this problem.
What needs to be changed in this file?

Milbo

Kreativa, it honors you, that you found this old thread and that you searched. But the thread is 2 years old.

this problem is loong time ago solved. The orders have the language stored, which version do you use?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

kreativa

#5
This is strange.
I use VM 3.0.8, Joomla 3.4.1, PHP 5.4.4-14
Could it be the problem, that I use Falang (1.4.7) for the translations?
Thanks for the Answer

kreativa

#6
Hi,
I noticed some weird  things today.

If I use the option "Force creation of invoice" in the backend, then the language of pdf invoice is always the same as the user in the frontend - OK.
I can then also change status to confirmed and use button "Update Order Status" and the pdf Invoice in mail has the right language.

If I change status from "Confirmed by shopper" to "Confirmed" (without force creation of invoice) and then use Update Order status, the pdf invoice has the language of the backend - wrong.

There is also another problem with pdf invoice creation.
If there are more products that  can fit on one page, then the image in the footer on the first page gets mirrored and off the page or minimized (depending on footer margins).  On last page the footer image is again ok.

Also is there any possibility that "General mail attachment" in "checkout" options would be different for each language?
Regards

VM 3.0.8, Joomla 3.4.1, PHP 5.4.4-14