Advertisement
Guest User

Change status Woocommerce

a guest
Oct 10th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement