Title: Prevent orders from processing automatically
Last modified: June 9, 2020

---

# Prevent orders from processing automatically

 *  [alphadesigndev](https://wordpress.org/support/users/alphadesigndev/)
 * (@alphadesigndev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/prevent-orders-from-processing-automatically/)
 * My credit card gateway automatically captures the payment when the order is placed.
   By default, WooCommerce then marks the order as Processing. I need to prevent
   it from skipping over On Hold due to our order workflow. How can you prevent 
   WooCommerce from automatically going to Processing (so the order is received,
   payment captured, but the order status stays at On Hold)? I tried the snippet
   below but that results in the order updating to Payment Pending instead of On
   Hold:
 * add_action( ‘woocommerce_thankyou’, ‘stop_auto_complete_order’ );
    function stop_auto_complete_order(
   $order_id ) { if ( ! $order_id ) { return; }
 *  $order = wc_get_order( $order_id );
    $order->update_status( ‘on_hold’ ); }

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Rynald0s](https://wordpress.org/support/users/rynald0s/)
 * (@rynald0s)
 * Automattic Happiness Engineer
 * [5 years, 11 months ago](https://wordpress.org/support/topic/prevent-orders-from-processing-automatically/#post-12965138)
 * Hi [@alphadesigndev](https://wordpress.org/support/users/alphadesigndev/)!
 * You need to replace `on_hold` with `on-hold`
 * Cheers!
 *  Thread Starter [alphadesigndev](https://wordpress.org/support/users/alphadesigndev/)
 * (@alphadesigndev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/prevent-orders-from-processing-automatically/#post-12966463)
 * I corrected the slug but the order still goes to Processing before being changed
   back to On Hold. This creates a problem because the temporary Processing status
   triggers our order processing email to be sent. This email notifies the customer
   that their order is ready for pickup when it has only been received. Can we adjust
   the function I provided previously to prevent this intermediate step?
 * I was able to prevent this from happening with Cash on Delivery orders using 
   the following function:
 * // change COD payment method order status from processing to on-hold
    add_filter(‘
   woocommerce_cod_process_payment_order_status’,’change_cod_payment_order_status’,
   10, 2 ); function change_cod_payment_order_status( $order_status, $order ) { 
   return ‘on-hold’; }
 * Is it possible to adapt this to my Elavon CC gateway or to have it apply to ALL
   orders/payment gateways?
 *  Thread Starter [alphadesigndev](https://wordpress.org/support/users/alphadesigndev/)
 * (@alphadesigndev)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/prevent-orders-from-processing-automatically/#post-12966481)
 * With the original function, the order goes through the following process:
 * 1) Order received – status set to Payment Pending
    2) status changes from Payment
   Pending to Processing (for only a moment) 3) status changes from Processing to
   On Hold
 * Step 2 is causing confusion with our customers because they receive an email 
   saying their order is ready for pickup before they receive the order received(
   On Hold) email.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Prevent orders from processing automatically’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [alphadesigndev](https://wordpress.org/support/users/alphadesigndev/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/prevent-orders-from-processing-automatically/#post-12966481)
 * Status: not resolved