WooCommerce电子邮件模板自定义

时间:2020-05-15 02:05:15

标签: php wordpress woocommerce customization hook-woocommerce

我正在尝试在WooCommerce网站的订单确认电子邮件中添加一个段落。我在子主题的functions.php文件中添加了对WooCommerce的支持。然后,我将电子邮件模板复制到了子主题中的相应文件夹中。这是我的尝试的模板文件。但是,当我(通过插件)测试电子邮件时,我得到:“您的网站上存在严重错误。”我通过验证程序运行了PHP,但有一个错误-但是我不精通PHP。有人可以帮助我找出要成功添加段落所做的更改吗?我在临时环境中工作。提前致谢。

<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
<?php /* translators: %s: Order number */ ?>
<p><?php printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></p>


<p><?php printf( esc_html__( 'We are busy baking your products for delivery from our kitchen to your door\. Any products ordered last week\, including over the past weekend\, are being baked this week and will ship next week\. So\, your order will be delivered in 3 to 10 days from the date of your order\. Look for another email providing your tracking number.'); ?> </p>
<?php

1 个答案:

答案 0 :(得分:0)

存在语法错误。请尝试以下更正的内容。

<p><?php printf( esc_html__( 'We are busy baking your products for delivery from our kitchen to your door. Any products ordered last week, including over the past weekend, are being baked this week and will ship next week. So, your order will be delivered in 3 to 10 days from the date of your order. Look for another email providing your tracking number.')); ?> </p>