Skip to content
Snippets Groups Projects

Change order status to Completed after the successful payment

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Krzysztof Dyszczyk
    Change order status to Completed after the successful payment.php 237 B
    add_action( 'woocommerce_payment_complete', 'wpdesk_set_completed_for_paid_orders' );
    
    function wpdesk_set_completed_for_paid_orders( $order_id ) {
    
        $order = wc_get_order( $order_id );
        $order->update_status( 'completed' );
        
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment