WooCommerce 电子邮件模板定制
WooCommerce Email Template Customization
我正在尝试在 WooCommerce 网站的订单确认电子邮件中添加一段。我将对 WooCommerce 的支持添加到我的子主题的 functions.php 文件中。然后我将电子邮件模板复制到我的子主题中的正确文件夹中。这是我尝试的模板文件。但是当我测试电子邮件(通过插件)时,我得到,"There has been a critical error on your website." 我通过验证器 运行 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
存在语法错误。试试下面更正的那个。
<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>
我正在尝试在 WooCommerce 网站的订单确认电子邮件中添加一段。我将对 WooCommerce 的支持添加到我的子主题的 functions.php 文件中。然后我将电子邮件模板复制到我的子主题中的正确文件夹中。这是我尝试的模板文件。但是当我测试电子邮件(通过插件)时,我得到,"There has been a critical error on your website." 我通过验证器 运行 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
存在语法错误。试试下面更正的那个。
<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>