News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Order comment in default page language not in order language

Started by panjarek, March 18, 2018, 18:05:44 PM

Previous topic - Next topic

panjarek

Hello,

I am facing a problem with a payment plugin comment in orders. When a user makes an order and pays eg. via PayPal, after the payment authorization, PayPal plugin adds a comment to the order. Something like this: "Your payment for order %s has been confirmed by PayPal." This comment is also sent in the confirmation email to the user. The problem is that this comment is always in the page default language not in the order language. Everything else is translated correctly, only this particular comment is not translated. I have this error also for an other payment plugin (Przelewy24). I tested it with turned off all overwrites so I think this is not a template issue. Have you faced this error? Do you have any solution?

VirtueMart 3.2.12
Joomla 3.8.6
PHP 7.0.24

Add:
With VirtueMart 3.2.14 and Joomla 3.8.7 the problem still exists.

Best regard
Jarek S.

panjarek

I think I found solution. I added code from below in method plgVmOnPaymentNotification() in /plugins/vmpayment/paypal/paypal.php.


$orderModel = VmModel::getModel('orders');
$order = $orderModel->getOrder($virtuemart_order_id);

//insert
$order_language = $order['details']['BT']->order_language;
if (!empty($order_language)) {
vmLanguage::setLanguageByTag($order_language);
}
//end insert