当客户在 WooCommerce 中批准订单时向他们添加订单备注

在 WooCommerce 中,允许客户在 WooCommerce 中更改订单状态回答我之前的问题,允许客户在“我的帐户”页面中批准(完成)订单,但我不知道如何自动添加注释,因此当客户批准订单(订单状态更改为已完成),我想自动为客户添加注释。

当客户批准订单并且状态更改为“已完成”时,是否可以添加注释?


慕斯王
浏览 88回答 1
1回答

慕的地6264312

如果您想要客户的订单备注,请替换以下代码行:        // 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') ) ;
打开App,查看更多内容
随时随地看视频慕课网APP