- Posts: 27
- Thank you received: 4
Order confirmation email language stays in default
11 years 1 month ago #210879
by fengel
Order confirmation email language stays in default was created by fengel
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.10
-- Browser(s) name and version -- : Firefox 38.0.5
The languages in use are Danish and English, with English being default.
1) User logs in and has Danish language set
2) User completes order and enters the ePay gateway (overlay)
3) User receives email for Order Created in Danish. This is correct
4) User completes ePay payment (in Danish) and gets sent to Thank You page, also in Danish
5) Email for Order Confirmed is received. However, it's in English
6) Another email for ePay Payment Confirmed is received in English
According to this thread , it could be a problem with the notification URL. However, I've checked the ePay file and it matches the one in PayPal. Not sure what else could be the problem.
Is the ePay plugin maintained by the Hikashop team or ePay?
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.10
-- Browser(s) name and version -- : Firefox 38.0.5
The languages in use are Danish and English, with English being default.
1) User logs in and has Danish language set
2) User completes order and enters the ePay gateway (overlay)
3) User receives email for Order Created in Danish. This is correct
4) User completes ePay payment (in Danish) and gets sent to Thank You page, also in Danish
5) Email for Order Confirmed is received. However, it's in English
6) Another email for ePay Payment Confirmed is received in English
According to this thread , it could be a problem with the notification URL. However, I've checked the ePay file and it matches the one in PayPal. Not sure what else could be the problem.
Is the ePay plugin maintained by the Hikashop team or ePay?
Please Log in or Create an account to join the conversation.
11 years 1 month ago #210915
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Order confirmation email language stays in default
Hi,
The ePay payment plugin is not a plugin developed or managed by the HikaShop team but by www.hikashop.dk/
You're right with the other forum thread, it is the source of your problem.
So I suggest you to contact the plugin developer in order to fix the language parameter in the notification url.
Regards,
The ePay payment plugin is not a plugin developed or managed by the HikaShop team but by www.hikashop.dk/
You're right with the other forum thread, it is the source of your problem.
So I suggest you to contact the plugin developer in order to fix the language parameter in the notification url.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: fengel
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229683
by fengel
Replied by fengel on topic Order confirmation email language stays in default
Hikashop v. 2.6.1 Business
J! v. 3.4.8
Hi, sorry to revive this thread but I'm still having trouble with this problem. ePay is not providing tech support for the module anymore, so I need to find a fix myself.
According to the referenced thread above, the notify URL is the culprit. I have tried to find out if the "lang" parameter is set, and it is set.
I'm at a lost of what could be the problem.
J! v. 3.4.8
Hi, sorry to revive this thread but I'm still having trouble with this problem. ePay is not providing tech support for the module anymore, so I need to find a fix myself.
According to the referenced thread above, the notify URL is the culprit. I have tried to find out if the "lang" parameter is set, and it is set.
- I have done a var_dump for JInput inside the function onPaymentNotification, and I get everything back correctly. (ex. 'da', 'en')
- I have also checked if the current request URL matches the notify URL, and it does.
- I've tried to see if the controller is ever called, checkoutController->notify(). It doesn't seem to be called :huh:
- I've tried to hard code a language setting within both the checkout controller and the ePay plugin, but to no effect.
I'm at a lost of what could be the problem.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229741
by nicolas
Replied by nicolas on topic Order confirmation email language stays in default
Hi,
Try to add such code after the order is loaded by the payment plugin in the onPaymentNotification function:
That will force the reloading of the language based on the language of the customer of the order.
Try to add such code after the order is loaded by the payment plugin in the onPaymentNotification function:
Code:
$orderClass = hikashop_get('class.order');
$orderClass->loadLocale($order);
The following user(s) said Thank You: fengel
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229771
by fengel
Replied by fengel on topic Order confirmation email language stays in default
I've tried adding that but it had no effect.
I got it working but it required some extra steps:
I got it working but it required some extra steps:
Code:
// Have to set language, so that the order status (Confirmed) gets translated
// But we only have the locale from the GET array to work with
$lang = JFactory::getLanguage();
$langarr = $lang->getKnownLanguages();
$newarr = array_filter(array_keys($langarr), function($tag){
return (JRequest::getVar('lang', 'en') == substr($tag, 0, 2));
});
$lang->setLanguage(array_shift($newarr));
// Load classes
$userClass = hikashop_get('class.user');
$orderClass = hikashop_get('class.order');
// Load order
$dbOrder = $this->getOrder($order_id);
// Force reloading of language based on customer's language
// However, we're missing the order's customer info. We have to load that first
// I've tried use loadFullOrder, but it kept giving NULL
$dbOrder->customer = $userClass->get($dbOrder->order_user_id);
$locale = $orderClass->loadLocale($dbOrder);
Please Log in or Create an account to join the conversation.
8 years 5 months ago #291305
by dyvel
Replied by dyvel on topic Order confirmation email language stays in default
Thank you for sharing this fix. Had the same issue...
Please Log in or Create an account to join the conversation.
Time to create page: 0.188 seconds