Order confirmation email language stays in default

  • Posts: 27
  • Thank you received: 4
9 years 3 months ago #210879

-- 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?

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #210915

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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: fengel

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 4
8 years 9 months ago #229683

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 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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 9 months ago #229741

Hi,

Try to add such code after the order is loaded by the payment plugin in the onPaymentNotification function:

$orderClass = hikashop_get('class.order');
$orderClass->loadLocale($order);
That will force the reloading of the language based on the language of the customer of the order.

The following user(s) said Thank You: fengel

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 4
8 years 9 months ago #229771

I've tried adding that but it had no effect.

I got it working but it required some extra steps:

// 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);

The following user(s) said Thank You: nicolas, dyvel

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 19
6 years 7 months ago #291305

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.075 seconds
Powered by Kunena Forum