嗯,我回答了我自己的问题。这有点特殊,但将有助于那些还想在其woocommerce网站上手动添加装运报价,或在woocommerce电子邮件中添加条件代码的人。
我们这样做是因为我们的许多订单不能由简单的承运人装运,但必须为散装或托盘上的卡车装运做好准备。这些通常要求我们在找到最佳交易之前向多家卡车公司发送报价。
无论如何,我可以编辑customer-processing-order.php
电子邮件模板(当然,在我的孩子主题中)并添加条件测试,以查看使用的付款方式。当它是“cod”(在前端客户看来是“提交订单以便装运报价”)时,他们会收到一条适当的消息。否则,他们会看到他们的订单已发布到制造部门。
条件部分(包含两行用于上下文的标准woocommerce模板)是:
do_action( \'woocommerce_email_header\', $email_heading, $email ); ?>
<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( esc_html__( \'Hi %s,\', \'woocommerce\' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
<p><?php
if ($order->get_payment_method() == cod)
{
printf( esc_html__( \'Order #%s\', \'woocommerce\' ), esc_html( $order->get_order_number() ) );
printf(\'
Thank you for your order, which has now been sent to our office staff to find the best method to ship this order to you. <strong>Within 1 business day we will send you an updated invoice including a shipping quote and link</strong> which will take you to our credit card payment page. If you have any questions, special requests, or need to have this order expedited, please call our office during business hours at xxx-xxx-xxxx (or 1-800-xxxxxxx)\');
}
else
{
printf( esc_html__( \'Order #%s is now released to manufacturing\', \'woocommerce\' ), esc_html( $order->get_order_number() ) );
printf(\'
<strong>Thank you for your payment</strong>, which has been received successfully. Below is the complete order. Please review it for errors or omissions. If you have any further questions call our office during business hours at xxx-xxx-xxxx (or 1-800-xxxxxxx)\');
}
?></p>