×

 

Home Contact Us Payments SC Commerce SC Commerce Docs SC Commerce Snippets

Simply Computing

We make websites. Simple.

Auto-complete all SC Commerce orders

Automatically set orders to completed.

		/**
 * Auto complete all SC Commerce orders
 */
 
add_action('woocommerce_thankyou', 'cc_auto_complete_order');

function cc_auto_complete_order($order_id) { 

  if (! $order_id) {
    return;
  }

  $order = wc_get_order($order_id);
  $order->update_status('completed');

}
	
   View Raw Code ID: 9943