Magento"忘记密码"电子邮件以错误的语言发送

Gli*_*orm 4 email multilingual magento forgot-password magento-1.7

我有一个Magento网站,有多种语言.我已经设置了语言包,一切似乎都在网站上正确翻译.此外,交易电子邮件以正确的语言发送,除了" 忘记密码 "电子邮件,该电子邮件始终以德语发送.这是我做的:

  • 安装语言包并确保所有模板和文件夹结构都正确无误.例:/app/locale/nl_NL/template/email/
  • 系统»交易电子邮件下:我应用了模板,选择了区域设置并保存.
  • 然后我转到系统»配置»销售电子邮件,我从" 当前配置范围 "下拉列表切换到每种语言,我选择了我在每个语言(每个商店视图)的交易电子邮件中创建的模板.

在网上寻找解决方案后,似乎其他人也遇到了这个问题,有人提到Magento正在从/ app/locale /中找到的第一个语言环境文件夹中选择"忘记密码"模板.在我来说,我有:de_DE,en_US,fr_FR,nl_NL.所以它从德国de_DE包中挑选模板.

注意:此外,在"配置"下的后端,左侧有一个名为"LOCALE PACKS"的选项卡,其下只有"Locale de_DE",即使我有其他语言包没有显示在这里.不确定这是否相关.

网站:http://site1.cp1.glimworm.com/magento/

Magento社区版本:1.7.0.2

区域包:

  • Mage_Locale_en_US
  • Locale_Mage_community_de_DE
  • Locale_Mage_community_fr_FR
  • Mage_Locale_nl_NL

知道如何从相应的语言中获取正确的电子邮件模板,而不是总是德语?任何帮助将不胜感激!我也可以提供更多信息.

小智 5

我在magento v1.5中遇到同样的问题.经过长时间的研究,我找到了这个解决方案,并为我工作.

Mage/Customer/Model/Customer.php

in this file i have make some changes as following.
find this line of code
if (!$storeId) 
{
    $storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId());
}

and replace with

$storeId = ($storeId == '0')?$this->getSendemailStoreId():$storeId;
if ($this->getWebsiteId() != '0' && $storeId == '0') 
{
    $storeIds = Mage::app()->getWebsite($this->getWebsiteId())->getStoreIds();
    reset($storeIds);
    $storeId = current($storeIds);
}
Run Code Online (Sandbox Code Playgroud)