![](/img/trans.png)
[英]Woocommerce Bookings - Send Booking Confirmation Email to Custom Field Value
[英]WooCommerce: Custom field (order comments) to confirmation email
我正在寻找一个像这样工作的简单插件:
查看订单:添加文本字段(订单评论)
确认 email 模板:获取 [order_comments] 如果存在
到目前为止,我已经能够找到过于复杂的订单跟踪插件或只是添加 WC 默认评论(我不想显示,除非客户注意)。 ACF 可以工作,但我希望在这里有一个更简单的选择。
<h2><?php _e( 'Order Notes', 'woocommerce' ); ?></h2>
<?php
$comments = wc_get_order_notes([ 'order_id' => $order->get_id(), 'type' => 'customer']);
foreach($comments as $comment) :
echo '<p>'.$comment->content.'</p>';
endforeach;
?>
试试这个代码 - 只打印客户备注。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.