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

TIPS

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.
[php]
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);
[/php]

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields