WooCommerce电子邮件模板定制

问题描述 投票:1回答:1

我想在WooCommerce网站的订单确认邮件中添加一段文字。我在我的子主题的function.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
php wordpress woocommerce customization hook-woocommerce
1个回答
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>
© www.soinside.com 2019 - 2024. All rights reserved.