Created
          October 1, 2013 00:23 
        
      - 
      
- 
        Save maxrice/6772280 to your computer and use it in GitHub Desktop. 
    Automatically change the status for an order placed with a Check or BACS gateway
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // Automatically update the order status to "completed" for cheque orders | |
| function skyverge_auto_complete_on_hold_order( $order_id ) { | |
| $order = new WC_Order( $order_id ); | |
| if ( 'on-hold' === $order->status ) | |
| $order->update_status( 'completed' ); | |
| } | |
| add_action( 'woocommerce_thankyou', 'skyverge_auto_complete_on_hold_order' ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment