×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Joseph Riviello
Added: May 12, 2014 4:39 PM
Views: 15
Tags: no tags
  1. /* Auto-complete orders that are paid for instead of marking as processing */
  2. add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
  3. function custom_woocommerce_auto_complete_order( $order_id ) {
  4.     global $woocommerce;
  5.      if ( !$order_id )
  6.         return;
  7.     $order = new WC_Order( $order_id );
  8.     $order->update_status( 'completed' );
  9. }