【问题标题】:WooCommerce Email Template CustomizationWooCommerce 电子邮件模板自定义
【发布时间】:2020-08-31 18:20:45
【问题描述】:

我正在尝试在 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

【问题讨论】:

    标签: php wordpress woocommerce customization hook-woocommerce


    【解决方案1】:

    存在语法错误。试试下面更正的那个。

    <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2018-01-20
      • 2016-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多