Product Icon

PayPal Payments for WooCommerce

Trending
PayPal’s brand recognition helps give customers the confidence to buy. PayPal’s all-in-one checkout solution allows you to offer PayPal, Venmo (US), Pay Later, credit and debit cards, country-specific payment options and more.

on hold PayPal Payments for WooCommerce

Is it possible to automatically set the status to “on hold” after a successful payment?
I tried it with this script. It works with Stripe. Unfortunately, it doesn’t work with this PayPal plugin. Please help me. Thank you!
Best regards,
Anton

add_action( ‘woocommerce_thankyou’, ‘custom_woocommerce_auto_complete_order’ );

function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}

$order = wc_get_order( $order_id );

// Check if the order was paid with Stripe
if ( $order->get_payment_method() == ‘stripe’ ) {
// Update order status to ‘on-hold’
$order->update_status( ‘on-hold’, ‘Order automatically put on hold, since it was paid with Stripe.’ );
}

// Check if the order was paid with PayPal
if ( $order->get_payment_method() == ‘paypal’ ) {
// Update order status to ‘on-hold’
$order->update_status( ‘on-hold’, ‘Order automatically put on hold, since it was paid with PayPal.’ );
}
}

Author

Anton

Current Status

Open

Last updated: January 10, 2025

0 comments

Log in to comment on this feature request.