在管理仪表板的订单备注部分中显示 wooCommerce 'payment method'



我想将支付方法传递给Woocommerce order的订单注释部分(当在后端查看订单时)

这个字段被导入到我们的ShipStation软件中。现在,我无法知道客户在查看ShipStation的订单时使用了什么付款方式。(当使用某种付款方式时,我们会免费赠送礼物。)

首先,可以在Wordpress Admin中查看付款方式。你只需要在屏幕选项中启用它。如果要将Shipment方法添加到订单备注中,只需将其添加到functions.php:

add_action( ‘woocommerce_new_order’, ‘add_engraving_notes’, 1, 1 );
function add_engraving_notes( $order_id ) {
$order = new WC_Order( $order_id );
$note = $order->getShippingMethod();;
$order->add_order_note( $note );
$order->save();
}  

最新更新