SHARE
TWEET

Change status Woocommerce

a guest Oct 10th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function set_order_status_when_tim($order_id){
  2.   global $woocommerce;
  3.   $tim = $needs_timologio = get_post_meta( $order->id, '_billing_needs_timologio', true );
  4.  
  5.    if($tim == 1) {
  6.    
  7.    $order = new WC_Order( $order_id );
  8.    $order->update_status('on-hold');
  9.    }
  10.  
  11. }
  12. add_action('woocommerce_thankyou','set_order_status_when_tim',10,1);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top