简体   繁体   English

在客户批准 WooCommerce 中的订单时添加订单备注

[英]Add an order note to customers when they approve their orders in WooCommerce

In WooCommerce, Allow customer to change order status in WooCommerce answer to my previous question, allows the customer to approve (complete) orders in "My Account" page, but I don't know how to add a note automatically, so when the Customer approves an order (order status is changed to completed), I want to automatically add a note for customer.在 WooCommerce 中, 允许客户在 WooCommerce 中更改订单状态回答我之前的问题,允许客户在“我的帐户”页面中批准(完成)订单,但我不知道如何自动添加注释,所以当客户批准订单(订单状态更改为已完成),我想自动为客户添加备注。

Is it possible to add a Note when customer approve an order and status is changed to "completed"?当客户批准订单并且状态更改为“已完成”时,是否可以添加备注?

If you want an order note for the customer, replace the following code line:如果您想要客户的订单备注,请替换以下代码行:

        // Change order status to "completed"
        $order->update_status( 'completed', __('Approved by the customer', 'woocommerce') ) ;

by:经过:

        // 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') ) ;

WooCommerce Documentation: WC_Order method add_order_note() WooCommerce 文档: WC_Order方法add_order_note()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 WooCommerce 中为新客户订单添加订单备注 - Add order note to new customer orders in WooCommerce 在客户订单历史记录中显示最后一个 WooCommerce 管理员订单备注 - Display last WooCommerce admin order note in customers order history 查看 Woocommerce 订单账单电子邮件的访客客户的首单折扣 - First order discount for guest customers checking Woocommerce orders billing email WooCommerce 将订单备注添加到订单已完成的电子邮件 - WooCommerce add order note to orderCompleted email 在 Woocommerce 中添加自定义字段作为订单备注 - Add custom field as an order note in Woocommerce 在 Woocommerce 管理订单编辑页面中以编程方式添加自定义订单备注 - Add a custom order note programmatically in Woocommerce admin order edit pages Wordpress - WooCommerce - 在桌面外显示“添加订单备注”表单 - Wordpress - WooCommerce - Displaying "Add Order Note" form outside desktop 将订单客户注释添加到YITH Woocommerce PDF发票 - Add order customer note to YITH Woocommerce PDF Invoice 选择所有有待处理订单的 woocommerce 客户 - Select all woocommerce customers with pending orders 在Woocommerce中将订单交易ID添加到管理员新订单电子邮件通知中 - Add orders transaction id to admin new order email notification in Woocommerce
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM