我需要通过检查进入“处理”状态而不是“暂停”状态来使 WooCommerce 推送付款。我尝试了下面的代码段,但它似乎没有效果。
这是我的代码:
add_filter( 'woocommerce_payment_complete_order_status', 'sf_wc_autocomplete_paid_orders' );
function sf_wc_autocomplete_paid_orders( $order_status, $order_id ) {
$order = wc_get_order( $order_id );
if ($order->status == 'on-hold') {
return 'processing';
}
return $order_status;
}
我怎样才能做到这一点?
谢谢。