News:

Looking for documentation? Take a look on our wiki

Main Menu

Standard Payment Configuration in two languages

Started by thepet, November 12, 2016, 17:40:13 PM

Previous topic - Next topic

thepet

Hi there,

Joomla 3.6.4
Virtuemart 3.0.18

I've been searching throughout the forum and the entire internet but did not find a solution, even though this question has arosen several times, it was never answered satisfactory and/or the topic just remain unanswered.

The payment plugin can be configured in multi languages in general, but only the content within the tab "Payment Method Information", the tab "Configuration" remains as single language only (default language).

This is really annoying, as the field "Payment Info" contains information which is being displayed upon confirmation of an order and this should be also language specific.
I've tried, of course, all "Tutorials" about language override, but a language key is not accepted in this field.

I found that the information within the "Configuration" tab is going to the table #_virtuemart_paymentmethods, instead of going to the language specific tables #_virtuemart_paymentmethods_en_gb or others for other languages.

Is there any way to tell the component to direct and retrieve this info from the language specific files as well, of course, only if respective columns have been added by SQL-command?

Since this seems to be of interest for several users, I would highly appreciate if one of the experts could help us out here.

Best Regards
Hartmut-the pet
Hartmut - thepet

Jörgen

Hello

A quick fix would be making an instance for each of the countries in a different language.

Another would be making overrides in the views and make sure the language constant is being translated.

This could probably also be fixed with css <span class="pmi_fr"> My french payment method information</span> or <span class="pmi_en">My english payment method information</span>

There could of course be better fixes than this  8)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

thepet

#2
Hi Jörgen and @ all (who have the same issue)

one instance for each country is no option in my case coz I'm selling in one country only and need Chinese & English...

However, you brought me on the right track...

This workaround will help, until the multilinguale ability of Virtuemart is finally completed ;)

open plugins/vmpayment/standard/standard/tmpl/post_payment.php

insert at line 25: (or where ever you like to have it visible)

<div class="post_payment_payment_info" style="width: 100%">
   <span class="post_payment_payment_info"><?php echo vmText::_ ('VMPAYMENT_STANDARD_INFO2'); ?> </span>
</div>

VMPAYMENT_STANDARD_INFO2 is the language key, which must be placed and translated in the respecteive override files (/language/overrides), of course.

I hope this helps others out of this problem which is really an issue and it is not really understandable that this function is still not competed.

Thanks again Jörgen, for kicking me in the right direction :)

Best Regards

Hartmut-the pet
Hartmut - thepet

Jörgen

Great

I didn´t think that the PHP would be accepted in that field, nicely done :)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

Quote from: thepet on November 12, 2016, 17:40:13 PM
...
This is really annoying, as the field "Payment Info" contains information which is being displayed upon confirmation of an order and this should be also language specific.
I've tried, of course, all "Tutorials" about language override, but a language key is not accepted in this field.

I found that the information within the "Configuration" tab is going to the table #_virtuemart_paymentmethods, instead of going to the language specific tables #_virtuemart_paymentmethods_en_gb or others for other languages.

Is there any way to tell the component to direct and retrieve this info from the language specific files as well, of course, only if respective columns have been added by SQL-command?

This is actually quite easy and we may set it as standard to the core. Just open the table file "paymentmethods.php" in BE/tables.

The constructor has


$this->setTranslatable(array('payment_name', 'payment_desc'));


Just add 'payment_desc' (I think you mean this with payment info)


$this->setTranslatable(array('payment_name', 'payment_desc','payment_desc'));


Maybe it is even enough to store the method to get the new column in the table. Or run in tools the tableupdater.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

thepet

Hi Milbo,

thanks for reply.

No I actually did not mean Payment description, I meant the text box which contains the payment info. It's under the tab configuration if you select (or create) a payment method.

It also doesn't make sense to me to have 'payment_desc' repeated there.

Nevertheless, I tried but no success :(

Best Regards
Hartmut
Hartmut - thepet

Milbo

Quote from: thepet on November 12, 2016, 17:40:13 PM
This is really annoying, as the field "Payment Info" contains information which is being displayed upon confirmation of an order and this should be also language specific.
I've tried, of course, all "Tutorials" about language override, but a language key is not accepted in this field.
Why does it not work to write a language key into the field?

ah I just see in the code, it is inconsistent. It is translated after its use. I uploaded a version with a fix, please try http://dev.virtuemart.net/attachments/download/1028/com_virtuemart.3.0.18.3_extract_first.zip
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/