Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

woocommerce custom payment process method

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 )
    );
}
Source by docs.woocommerce.com #
 
PREVIOUS NEXT
Tagged: #woocommerce #custom #payment #process #method
ADD COMMENT
Topic
Name
6+5 =