在 WooCommerce 中,允許客戶在 WooCommerce 中更改訂單狀態回答我之前的問題,允許客戶在“我的帳戶”頁面中批準(完成)訂單,但我不知道如何自動添加注釋,因此當客戶批準訂單(訂單狀態更改為已完成),我想自動為客戶添加注釋。當客戶批準訂單并且狀態更改為“已完成”時,是否可以添加注釋?
1 回答

慕的地6264312
TA貢獻1817條經驗 獲得超6個贊
如果您想要客戶的訂單備注,請替換以下代碼行:
? ? ? ? // Change order status to "completed"
? ? ? ? $order->update_status( 'completed', __('Approved by the customer', 'woocommerce') ) ;
經過:
? ? ? ? // Add an order note for the customer (blue background note in admin orders)
? ? ? ? $order->add_order_note( __('You have approved this order on', 'woocommerce') . ' ' . date_i18n( 'F j, Y' ), true );
? ? ? ? // Change order status to "completed"
? ? ? ? $order->update_status( 'completed', __('Approved by the customer', 'woocommerce') ) ;
- 1 回答
- 0 關注
- 118 瀏覽
添加回答
舉報
0/150
提交
取消