VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: panjarek on March 18, 2018, 18:05:44 PM

Title: Order comment in default page language not in order language
Post by: panjarek on March 18, 2018, 18:05:44 PM
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.
Title: Re: Order comment in default page language not in order language
Post by: panjarek on May 08, 2019, 20:11:20 PM
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