最佳答案
从动态订单 ID 中,您可以使用 WC_Order
add_order_note()
方法是这样的:
// If you don't have the WC_Order object (from a dynamic $order_id)
$order = wc_get_order( $order_id );
// The text for the note
$note = __("This is my note's text…");
// Add the note
$order->add_order_note( $note );
经过测试并有效。
关于php - 在 Woocommerce 管理订单编辑页面中以编程方式添加自定义订单备注,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48667381/