📌  相关文章
📜  woocommerce 自定义付款流程方法 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:41.244000             🧑  作者: Mango

代码示例1
function process_payment( $order_id ) {
    global $woocommerce;
    $order = new WC_Order( $order_id );

    // Mark as on-hold (we're awaiting the cheque)
    $order->update_status('on-hold', __( 'Awaiting cheque payment', 'woocommerce' ));

    // Remove cart
    $woocommerce->cart->empty_cart();

    // Return thankyou redirect
    return array(
        'result' => 'success',
        'redirect' => $this->get_return_url( $order )
    );
}