Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Woocommerce客户订单电子邮件-希伯来语编码问题_Php_Wordpress_Encoding_Utf 8_Woocommerce - Fatal编程技术网

Php Woocommerce客户订单电子邮件-希伯来语编码问题

Php Woocommerce客户订单电子邮件-希伯来语编码问题,php,wordpress,encoding,utf-8,woocommerce,Php,Wordpress,Encoding,Utf 8,Woocommerce,我移动了一个站点服务器并升级到Woocommerce;从那时起,我就遇到了发送给客户的电子邮件问题(新订单,订单中添加了注释): 如果电子邮件中出现希伯来文字母/单词,它们将显示为问号。在他们使用的变化以希伯来语出现之前没有任何问题。 管理员收到的有关新订单、库存等的电子邮件,以及所有网站的希伯来文邮件,看起来没有问题 电子邮件如下所示: 您的订单已收到,正在处理中。您点的菜 详情如下所示,供您参考: ??????: ?? ??? ?????? ?? ?????? ???? ???? ?????

我移动了一个站点服务器并升级到Woocommerce;从那时起,我就遇到了发送给客户的电子邮件问题(新订单,订单中添加了注释):

如果电子邮件中出现希伯来文字母/单词,它们将显示为问号。在他们使用的变化以希伯来语出现之前没有任何问题。 管理员收到的有关新订单、库存等的电子邮件,以及所有网站的希伯来文邮件,看起来没有问题

电子邮件如下所示:

您的订单已收到,正在处理中。您点的菜 详情如下所示,供您参考: ??????: ?? ??? ?????? ?? ?????? ???? ???? ????? ?????? ????? ?????: 312700 ????: 783 ??? ?????? ?”? ???? ????.

?????? ?????? ?? ????? ?? ??? + ???? ?????. ??? ????? ?? ???? ?????? ??? 2045 ?????? , ????? “???? 2045″.
?? ?? ??? ???? ????? ?? ?????? ????? ????? ???.
* ?????? ?? ???? ?? ??????? ?????.
* ????? ??????? ?? ????? ??? ??? ?????, ?????? ????? ????????
*?????? ??? ????? ??? 3 ??? ?????

 ???? ?????
 StoreName
 Our Bank Details
 ???? ???? - ??????

 Account Number: 879878
 Sort Code: ???? 989

 Order #2656
 Product  Quantity    Price
 ???? ???????? ????? ?? OFRA   1  ₪170.00
 Cart Subtotal:   ₪170.00
 Shipping:    ????? ????
 Payment Method:  ????? ??????
 Order Total:     ₪170.00
 Your details

 Email: email@gmail.com

 Tel: 90809
 Billing address

 ???????? ??????
 ?????
 ?????
 09809

 Shipping address

 ???????? ??????
 ?????
 ?????
 09809
当站点设置为希伯来语时,所有电子邮件都是
(数字除外);我将其设置为英语,以确保这不仅仅是翻译问题


有什么想法吗?

batz尝试打开
/wp content/plugins/woocommerce/includes/emails/class wc email.php
,查找以下代码:

/**
 * get_headers function.
 *
 * @return string
 */
public function get_headers() {
    return apply_filters( 'woocommerce_email_headers', "Content-Type: " . $this->get_content_type() . "\r\n", $this->id, $this->object );
}
add_action('woocommerce_email_header', 'add_css_to_email');

function add_css_to_email() {
echo '
<style type="text/css">
* {
    font-family: sans-serif !important;
}
</style>
';
}
并将其更改为:

/**
 * get_headers function.
 *
 * @return string
 */
public function get_headers() {
    return apply_filters( 'woocommerce_email_headers', "Content-Type: " . $this->get_content_type() . "; charset=UTF-8\r\n", $this->id, $this->object );
}

batz很抱歉,我不能完全测试我的答案,所以我仍然不能保证它们会起作用。要找出这个错误的确切原因是很困难的

到目前为止,我发现WooCommerce电子邮件不支持从右到左的脚本,因此即使我们得到正确的图示符来显示,您可能仍然遇到一些问题。但是值得一试

方法1 在主题的
functions.php
文件中添加以下代码:

/**
 * get_headers function.
 *
 * @return string
 */
public function get_headers() {
    return apply_filters( 'woocommerce_email_headers', "Content-Type: " . $this->get_content_type() . "\r\n", $this->id, $this->object );
}
add_action('woocommerce_email_header', 'add_css_to_email');

function add_css_to_email() {
echo '
<style type="text/css">
* {
    font-family: sans-serif !important;
}
</style>
';
}
add_action('woocommerce_email_header','add_css_to_email');
函数add_css_to_email(){
回声'
* {
字体系列:无衬线!重要;
}
';
}
方法2 如果方法1不起作用,请尝试转到
仪表板>WooCommerce>设置>电子邮件
,然后逐个选择所有电子邮件,并将
电子邮件类型
HTML
更改为
纯文本
。这可能不是一个理想的解决方案,但它可以:

  • 帮助我们找到问题的根源-请让我知道将电子邮件更改为纯文本是否有帮助
  • 至少使文本可见

  • batz你能分享你网站的url吗?P.s.我在服务器的不同域上安装了另一个新的安装,同样的问题。我想这和服务器有关。问题是到底是什么。检查了,同样的问题。谢谢。谢谢你的帮助。方法2有效。方法1不起作用。但是我需要html选项才能工作。如果你想现场测试,我在服务器上安装了WordPress和woo,也有同样的问题。地址:shulchani.com。要访问管理员,如果您想要用户:admin,请通过:123456。您可以在那里随意更改,这是唯一的测试域。