How to update WooCommerce order status to processing when an order is placed using PayPal

Jun 27, 2018 | WooCommerce Tips | 0 comments

How to update WooCommerce order status to processing when an order is placed using PayPal.

Add the following PHP code to your child theme functions.php file.

function update_wc_order_status($posted) {
    $order_id = isset($posted['invoice']) ? $posted['invoice'] : '';
    if(!empty($order_id)) {
        $order = new WC_Order($order_id);
        $order->update_status('processing');
    }
}
add_action('paypal_ipn_for_wordpress_payment_status_completed', 'update_wc_order_status', 10, 1);

0 Comments

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.